Leaflet will become even better if you add …

Convert vectors layers to GeoJSON

In the class L.geoJson we have the method geometryToLayer ("Creates a layer from a given GeoJSON feature"). It would be great if some sort of inverse operation was available. That is, in the class L.Path there should be a method "layerToGeometry" which would create the essential geoJson data for the given Vector Layer (be it a Polyline/Polygon/Rectangle, a MultiPolyline/MultiPolygon, or a Circle/CircleMarker, for which the radius could be stored in the properties). The class L.Marker should have this as well.

48 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    paulovieirapaulovieira shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Marian SteinbachMarian Steinbach commented  · 

        Isn't this solved, now that markers have the toGeoJSON() function?

      • paulovieirapaulovieira commented  · 

        Sorry for the duplicate. Please delete it if you can.

      Feedback and Knowledge Base