diff --git a/examples/vector-esri-edit.html b/examples/vector-esri-edit.html
index 9b187fc2bb..d11736588b 100644
--- a/examples/vector-esri-edit.html
+++ b/examples/vector-esri-edit.html
@@ -1,20 +1,16 @@
---
-layout: example.html
-title: esri ArcGIS REST Feature Service example with editing
+layout: strapless.html
+title: Editable ArcGIS REST Feature Service
shortdesc: Example of using an ArcGIS REST Feature Service in an editing application.
docs: >
This example loads features from ArcGIS REST Feature Service and allows to add new features or update existing features.
tags: "vector, esri, ArcGIS, REST, Feature, Service, bbox, loading, server, edit, updateFeature, addFeature"
---
-
+
+
diff --git a/examples/vector-esri-edit.js b/examples/vector-esri-edit.js
index d646f18b26..7d268d3afb 100644
--- a/examples/vector-esri-edit.js
+++ b/examples/vector-esri-edit.js
@@ -29,20 +29,18 @@ var vectorSource = new ol.source.Vector({
',"spatialReference":{"wkid":102100}}') +
'&geometryType=esriGeometryEnvelope&inSR=102100&outFields=*' +
'&outSR=102100';
- $.ajax({url: url, dataType: 'jsonp', success: function(response) {
- if (response.error) {
- alert(response.error.message + '\n' +
- response.error.details.join('\n'));
- } else {
- // dataProjection will be read from document
- var features = esrijsonFormat.readFeatures(response, {
- featureProjection: projection
- });
- if (features.length > 0) {
- vectorSource.addFeatures(features);
- }
+
+ fetch(url).then(function(response) {
+ return response.json();
+ }).then(function(json) {
+ // dataProjection will be read from document
+ var features = esrijsonFormat.readFeatures(json, {
+ featureProjection: projection
+ });
+ if (features.length > 0) {
+ vectorSource.addFeatures(features);
}
- }});
+ });
},
strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({
tileSize: 512
@@ -97,8 +95,12 @@ selected.on('remove', function(evt) {
featureProjection: map.getView().getProjection()
}) + ']';
var url = serviceUrl + layer + '/updateFeatures';
- $.post(url, { f: 'json', features: payload }).done(function(data) {
- var result = JSON.parse(data);
+ var data = new FormData();
+ data.append('f', 'json');
+ data.append('features', payload);
+ fetch(url, {method: 'POST', body: data}).then(function(response) {
+ return response.json();
+ }).then(function(result) {
if (result.updateResults && result.updateResults.length > 0) {
if (result.updateResults[0].success !== true) {
var error = result.updateResults[0].error;
@@ -117,8 +119,12 @@ draw.on('drawend', function(evt) {
featureProjection: map.getView().getProjection()
}) + ']';
var url = serviceUrl + layer + '/addFeatures';
- $.post(url, { f: 'json', features: payload }).done(function(data) {
- var result = JSON.parse(data);
+ var data = new FormData();
+ data.append('f', 'json');
+ data.append('features', payload);
+ fetch(url, {method: 'POST', body: data}).then(function(response) {
+ return response.json();
+ }).then(function(result) {
if (result.addResults && result.addResults.length > 0) {
if (result.addResults[0].success === true) {
feature.setId(result.addResults[0]['objectId']);
diff --git a/examples/vector-esri.html b/examples/vector-esri.html
index d2ff7ae3fa..1c9f490911 100644
--- a/examples/vector-esri.html
+++ b/examples/vector-esri.html
@@ -1,18 +1,12 @@
---
-layout: example.html
-title: esri ArcGIS REST Feature Service example
+layout: strapless.html
+title: ArcGIS REST Feature Service
shortdesc: Example of using an ArcGIS REST Feature Service with a BBOX strategy.
docs: >
This example loads new features from ArcGIS REST Feature Service when the view extent changes.
tags: "vector, esri, ArcGIS, REST, Feature, Service, bbox, loading, server"
+resources:
+ - https://code.jquery.com/jquery-1.11.2.min.js
---
-
+
+
diff --git a/examples/vector-labels.html b/examples/vector-labels.html
index 38b2d385f2..f0302de068 100644
--- a/examples/vector-labels.html
+++ b/examples/vector-labels.html
@@ -1,16 +1,12 @@
---
-layout: example.html
-title: Vector labels example
+layout: strapless.html
+title: Vector Labels
shortdesc: Example of GeoJSON features with labels.
docs: >
**Note:** The 'Text/Wrap' option is currently not working properly. This is because ol3 uses Canvas's strokeText and fillText functions that do not support text wrapping.
tags: "geojson, vector, openstreetmap, label"
---
-
+