Separate out feature reading and feature adding

This commit is contained in:
Tom Payne
2014-03-25 16:51:26 +01:00
parent a31ad69ec4
commit 4a484a7ad3
3 changed files with 73 additions and 60 deletions

View File

@@ -95,7 +95,7 @@ var vectorSource = new ol.source.ServerVector({
var url = 'http://overpass-api.de/api/xapi?map?bbox=' +
epsg4326Extent.join(',');
$.ajax(url).then(function(response) {
vectorSource.readFeatures(response);
vectorSource.addFeatures(vectorSource.readFeatures(response));
});
},
strategy: ol.loadingstrategy.createTile(new ol.tilegrid.XYZ({