First off I'm using OL 3.6 with no additional plugins.Pretty simple question that I thought would have been asked already/would have been much more readily available, is there a way to store points from a GeoJSON file to an array? I'm thinking it would look something like this(?):
var features = new Array(of_some_size);for(var i = 0; i < of_some_size; i++){features = new ol.format.GeoJSON( url: './testData.geojson')};The file is local and this is just for personal use and I want it to work offline first and foremost, and I would like to try and shy away from ajax requests just because I am very new to javascript and OpenLayers and I am definitely still trying to grasp everything I've learned so far. I don't want to exclude it as a solution but I would prefer not to, if that's the only way, then that's the only way, nothing you can do about it. The .geojson looks like this:
{"type": "FeatureCollection","features":[{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0.13138, 49.4756 ] }, "properties": { "NAME": "227006760", "PROP2": "0" }}]}With a bunch more points(about 30). Any help is much appreciated, thanks!
أكثر...
var features = new Array(of_some_size);for(var i = 0; i < of_some_size; i++){features = new ol.format.GeoJSON( url: './testData.geojson')};The file is local and this is just for personal use and I want it to work offline first and foremost, and I would like to try and shy away from ajax requests just because I am very new to javascript and OpenLayers and I am definitely still trying to grasp everything I've learned so far. I don't want to exclude it as a solution but I would prefer not to, if that's the only way, then that's the only way, nothing you can do about it. The .geojson looks like this:
{"type": "FeatureCollection","features":[{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 0.13138, 49.4756 ] }, "properties": { "NAME": "227006760", "PROP2": "0" }}]}With a bunch more points(about 30). Any help is much appreciated, thanks!
أكثر...