## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Nov 23 13:54
rmcf commented #625
• Nov 23 09:31
rmcf commented #625
• Nov 22 02:53
dependabot[bot] labeled #1055
• Nov 22 02:53
dependabot[bot] opened #1055
• Nov 21 03:05
akshyaprakash edited #1054
• Nov 21 03:04
akshyaprakash edited #1054
• Nov 21 03:03
akshyaprakash opened #1054
• Nov 11 08:41
poet-of-the-fall commented #945
• Nov 11 08:39
poet-of-the-fall commented #1013
• Nov 11 08:37
poet-of-the-fall opened #1053
• Nov 10 03:15
rhenaldkarrel commented #610
• Nov 10 03:15
rhenaldkarrel commented #610
• Nov 09 09:30
rhenaldkarrel commented #610
• Nov 03 06:51
jmon14 closed #1038
• Nov 01 03:53
rhenaldkarrel commented #1020
• Nov 01 03:28
rhenaldkarrel commented #1020
• Nov 01 03:19
rhenaldkarrel commented #1020
• Oct 28 21:07
dependabot[bot] closed #1037
• Oct 28 21:07
dependabot[bot] commented #1037
• Oct 28 21:07
dependabot[bot] labeled #1052
Loan Laux
@loanlaux
Hi @joshkopecek! I am, indeed
Josh
@joshkopecek
is the problem that some coordinates are outside of -180,180?
@loanlaux
Loan Laux
@loanlaux
Correct, and then we send the coordinates to a backend that uses MongoDB, which doesn't understand polygons that go outside of that range
I suppose the solution would be dividing any polygon that go beyond this range into multiple polygons that stay within [-180, 180]. Am I right? How would you go about it?
Josh
@joshkopecek
Of course. If for example you have a polygon [170,12],[181,12],[192, 14],[170,12] what would you expect to do with the larger numbers?
Loan Laux
@loanlaux
Suppose this polygon that crosses the antimeridian
Josh
@joshkopecek
Does it matter if you split it down the middle?
Loan Laux
@loanlaux
Exactly, that's the way I'm thinking of doing it
I'm drawing it to make sure we're on the same page
Josh
@joshkopecek
So just use the turf utility to truncate it twice.
http://turfjs.org/docs#bboxClip
create one which overlaps negatively, one which overlaps positively, and use a bbox of [-180,-90,180,90] on each.
then create a multipolygon from the two resulting polys
Loan Laux
@loanlaux
Aaaah yeah, that's exactly what I need!
Josh
@joshkopecek
:-)
Hope that helped
Loan Laux
@loanlaux
Thanks a lot. You're helping me solve an issue that's been collecting dust for months!
Much appreciated
Josh
@joshkopecek
@loanlaux you're very welcome. Ping me if you need help with the nitty gritty
@loanlaux you can use http://turfjs.org/docs#transformTranslate to move it by -360º
Loan Laux
@loanlaux
Just to be clear, we'd be ending up with a MultiPolygon that looks like this. Correct?
Josh
@joshkopecek
Yes
Loan Laux
@loanlaux
Perfect
I'll be back if I hit a roadblock, but I should be good now :)
Once again, thanks a lot
Josh
@joshkopecek
@loanlaux np
chrisbrainerd
@chrisbrainerd
:wave: Having an issue trying to edit a polygon with holes. I thought I remembered this working in an earlier version but I tried downgrading back to the point where leaflet 1.0 support was introduced and no dice.
I've been digging through the source and it looks like the way it's expecting to know whether a shape has an interior ring is a _holes property on the layer (https://github.com/Leaflet/Leaflet.draw/blob/f96fdaeb667e2d2cad8861857a82659dab73c24f/src/edit/handler/Edit.Poly.js#L71)
Problem is, _holes isn't used anywhere in leaflet >=1.0
From issue logs it seems like it was in Leaflet v0.7, but I'm not 100% on that
Seems like it's vestigal code that needs to be updated, but wanted a second opinion before I filed a ticket.
chrisbrainerd
@chrisbrainerd
:|
Ulrich Mayring
@realulim
Perhaps someone can help me track down a bug(?) in Leaflet Draw. Generally it works fine in my application, but on one execution path I am probably initialising it differently and that seems to trigger a weird behavior in the "delete" tool (the trash can icon). When I use the tool to click on a previously drawn shape, it doesn't disappear. However, it is actually deleted, because when I click save and reload the page, then the shape is gone. So it's only a screen update issue, the shape simply isn't deleted. It's fully reproducible, but only in a very complex user interaction scenario in my application. Where can I start looking to track this down well enough to file a meaningful bug report?
Ulrich Mayring
@realulim
I just found that the edit tool has a similar problem. When I move waypoints, then the route is drawn along the new waypoints, but the old route does not disappear. This is likely an update problem in Leaflet Draw and I would really like to track down how to trigger it outside of my complex application.
tamirgilany
@tamirgilany

Hello @/all,
I try to understand how can I get the precision level of a polygon I drew in order to convert the Latlang into a geohash.

Anyone here can help me out and tell me how can I know the precision level?

Thanks!

Aner S.
@aner-shab
Hi there,
I'm drawing polylines, and when entering the edit mode, the default behaviour seems to be that clicking on a vertex deletes it from the polyline altogether. I can't seem to figure out from the docs if there's a way to stop that behavior (is there a way to preventDefault from draw:editvertex?) without having to modify the leaflet-draw src.
2 replies
nunofreitasbotelho
@nunofreitasbotelho
How do you guys deal with needing something that is not fixed yet on the repository? I mean, theres a PR for it but i dont think is going to be approved anytime soon
James Cosford
@jamescosford
Hi! Does anyone have experience using Leaflet.Draw with Scala.js and ScalablyTyped?
Tal
@t1a2l
Hello, how do i change the text of the button on the toolbar? for example replace the "draw a ###" with other text..
jtWeb99
@jtWeb99

If I draw a circle and convert it to GeoJSON, it will turn into a point, so it will be redisplayed as marker. How can I solve this problem?
johnd0e
@johnd0e
@jtWeb99 https://leafletjs.com/reference-1.7.1.html#geojson-pointtolayer
(not related to Leaflet.draw though)
Dimplejain23
@Dimplejain23
Hey, can anybody help me with not allowing user to create multiple polygons using - L.Control.Draw
Tal
@t1a2l
Hey, i cant move the handles after creating the polygon, can anybody help? it seems like the events are not registering when the marker icons of the polygons are created
it is like they are being ignored
i use leaflet 1.7.1 and leaflet draw 1.0.4
Prawesh Lamsal
@praweshlamsal
Hey, i have been stuck in very funny situation i want my polygon draw feature alike leaflet geoman where the point goes to collide with nearest draw and