Use fetch instead of $.ajax in JSTS example

This commit is contained in:
Tim Schaub
2015-11-15 15:05:28 -07:00
parent 2fff18fd0c
commit 6fd6b794ef
2 changed files with 7 additions and 12 deletions

View File

@@ -12,10 +12,11 @@ goog.require('ol.source.Vector');
var source = new ol.source.Vector();
$.ajax('data/geojson/roads-seoul.geojson').then(function(response) {
fetch('data/geojson/roads-seoul.geojson').then(function(response) {
return response.json();
}).then(function(json) {
var format = new ol.format.GeoJSON();
var features = format.readFeatures(response,
{featureProjection: 'EPSG:3857'});
var features = format.readFeatures(json, {featureProjection: 'EPSG:3857'});
var parser = new jsts.io.olParser();