Closed CosmicLaca closed 9 years ago
x_Geoms = L.geoJson(geoj); The geojson layer in leaflet extends the featuregroup layer. Imo you have to convert the geojson to featuregroup So the idea would be to use the commented method, swapping the coordinates (http://jsperf.com/switch-elements). It's a linear operation [O(n)], so it should be feasible
To swapping coordinates I think is very dirty solution for unknown size GEOMETRYCOLLECTION(), so I dont wanna use it.
The feature group conversion not succeed or I dont know how to do it. I created layer for leaflet.daw on previously included .js like this: var draw_layer = L.featureGroup().addTo(map);
What about something like
var draw_layer = L.featureGroup().addTo(map);
function moveToFeatureGroup (feature, layer){
layer.addTo(draw_layer);
}
x_Geoms = L.geoJson(geoj, {onEachFeature: moveToFeatureGroup});
Thank you! I trying / testing this method, and I have result.
Thank you, this is good solution, uploading the first version for testing
The problem is on the file: manager\modules\mcontent\views\edit.php started on row: 242.
Problem details:
Looking for solutions to read and display saved data, and edit same data with leaflet.draw at same interface. For WKT.parser() data have to be indexed (but how?), or using another method L.polyline(x_Geoms).addTo(draw_layer); the lan/lot data must be changed to lon/lat (on client side).