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

get wkt when draw:editstop #411

Open
hmarina opened this issue Jun 3, 2015 · 2 comments
Open

get wkt when draw:editstop #411

hmarina opened this issue Jun 3, 2015 · 2 comments
Labels

Comments

@hmarina
Copy link

hmarina commented Jun 3, 2015

Hello every body, what is the best way or what I need you to do, to get wkt when I draw:editstop function. I am using terraformer library. What is wrong ?. Apreciate your help.

map.on('draw:editstop', function (e) {
    var geojson = e.layer.toGeoJSON();
    var wkt = Terraformer.WKT.convert(geojson.geometry);
    console.log(wkt);
    drawnItems.addLayer(e.layer);
});
@samirfor
Copy link

samirfor commented Sep 9, 2015

As you see in draw:editstop the given property is a edit handler, not a layer. Probably you must use draw:edited event like this:

map.on('draw:edited', function (e) {
    var layers = e.layers;
    layers.eachLayer(function (layer) {
        console.log(layer.toGeoJSON());
    });
});

@ddproxy
Copy link
Member

ddproxy commented Mar 8, 2016

@hmarina did you resolve your issues?

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

No branches or pull requests

3 participants