I am trying to export GeoJSON for a list of feature objects. The features are in EPSG:3857 projection and I would like to convert all geometries to EPSG:4326. I am perfectly capable of doing this by looping through the features like so:
var construccionFeatures = layerCONSTRUCCION.features; for (var i = 0; i < construccionFeatures.length; i++) { construccionFeatures.geometry = construccionFeatures.geometry.transform('EPSG:3857', 'EPSG:4326'); }var json = new OpenLayers.Format.GeoJSON().write(construccionFeatures);I just would like to know whether there is a quicker solution. Is it possible to directly transform all geometries in the list in one go? Speed is key here since I run this process after a WFS layer loadend event in order to feed the GeoJSON to the OSMBuildings library.
Thanks. D.
أكثر...
var construccionFeatures = layerCONSTRUCCION.features; for (var i = 0; i < construccionFeatures.length; i++) { construccionFeatures.geometry = construccionFeatures.geometry.transform('EPSG:3857', 'EPSG:4326'); }var json = new OpenLayers.Format.GeoJSON().write(construccionFeatures);I just would like to know whether there is a quicker solution. Is it possible to directly transform all geometries in the list in one go? Speed is key here since I run this process after a WFS layer loadend event in order to feed the GeoJSON to the OSMBuildings library.
Thanks. D.
أكثر...