You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #171. Right now there is no way to return the geometry of feature(s) in a usable WKT or GeoJSON format unless using the edit behavior. You can get a simple array of coordinates for a feature using layer.getSource().getFeatureById(id).getGeometry().getCoordinates(); which is fine for Point geometries but less convenient for Polygon and other more complex geometries.
Because the edit control already has functions for this perhaps this could be easier to expose than my request in #171. I think the only consideration is if & how we export these functions and what impact it will have on the bundle size(s). I believe this would require including the openalyers WKT and GeoJSON classes which could be quite large.
I don't need the edit behavior for my use-case because I don't need the user to manipulate geometries in the map. Instead, I'm loading a GeoJSON layer of property boundaries and asking the user to select which boundaries they want to import. I need to collect the geometries of selected features when submitting the form.
Similar to #171. Right now there is no way to return the geometry of feature(s) in a usable WKT or GeoJSON format unless using the edit behavior. You can get a simple array of coordinates for a feature using
layer.getSource().getFeatureById(id).getGeometry().getCoordinates();
which is fine forPoint
geometries but less convenient forPolygon
and other more complex geometries.Because the
edit
control already has functions for this perhaps this could be easier to expose than my request in #171. I think the only consideration is if & how we export these functions and what impact it will have on the bundle size(s). I believe this would require including the openalyersWKT
andGeoJSON
classes which could be quite large.WKT:
farmOS-map/src/control/Edit/Edit.js
Lines 514 to 521 in d3fcfc6
GeoJson:
farmOS-map/src/control/Edit/Edit.js
Lines 523 to 531 in d3fcfc6
The text was updated successfully, but these errors were encountered: