Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Leaflet.FileLayer directly compatible with Leaflet.Draw and provide simple example. #38

Open
spydmobile opened this issue Mar 21, 2017 · 4 comments

Comments

@spydmobile
Copy link

Thanks for this amazing component, its fast and I love it, however I have spent many hours trying to get draw to edit my GPX uploads with no success yet. Close but no success. My use case is that my field techs are uploading a GPS track (GPX LineString) which is actually a wildfire boundary so it needs to be edited and closed into a polygon in the mapplication. I have tried a multitude of approaches including loading in turfJS and using custom Turf Script to convert the GeoJson LineString to a bonifide Polygon, but then I am unable to load the result into draw for editing. Would be so sweet to just have these two awesome components work together out of the box somehow.

@spydmobile
Copy link
Author

I now have this working but it involved converting the geojson from the GPX using turf and then feeding it back to the draw module. Not sure there is anything for you to do.

@leplatrem
Copy link
Collaborator

It would be awesome if you could contribute a small demo of what you've done! (in an examples/ folder here for example)

@spydmobile
Copy link
Author

In theory a great idea, in practice however, a lot of work to extract the realavant code from my gong-show, but I will put it on my todo list ;-)

@suseday
Copy link

suseday commented May 4, 2017

Oh I would LOVE to see how to edit the points and tracks (uploaded with FileLayer) in Leaflet.Draw.
I too tried to import so that the elements can be edited but I gave up :-( So I would love to see how it works.
My assumption is/was that FileLayer just need to draw the elements to the Leaflet.Draw FeatureGroup
var drawnItems = L.featureGroup().addTo(map);

I guess they can then be edited if the elements are in that FeatureGroup. But how to get them into it? I have no idea :-(

btw: Great Plugin! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants