New answers tagged

2

Your data is stored in the features array. You can access that by specifying a custom datasource within the ajax property like this: "dataSrc": "features". I haven't found a way to get the GeoJSON property "type": "FeatureCollection" that way, it is outside of the actual data "rows". The complete code: $(document).ready(function() { $('#example')....


3

Your code is a bit complicated concering your callback:loadFeatures function. Within the function you add features for both requests to both sources. Try to distinguis them using two separate functions and see if this is your case. var geojsonFormat = new ol.format.GeoJSON(); var vectorSource = new ol.source.Vector({ loader: function(extent, resolution, ...



Top 50 recent answers are included