Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 30 03:34
    chenqing8 opened #1023
  • Jul 28 13:05
    qpincon commented #1008
  • Jul 28 13:03
    qpincon commented #1008
  • Jul 28 12:34
    qpincon synchronize #1008
  • Jul 23 10:52
    AllNickNamesAreBusySoITakenThis closed #1022
  • Jul 23 10:52
    AllNickNamesAreBusySoITakenThis commented #1022
  • Jul 23 06:44
    AllNickNamesAreBusySoITakenThis opened #1022
  • Jul 21 13:52
    cavasinf commented #321
  • Jul 20 15:45
    jarekucinski commented #265
  • Jul 20 15:44
    jarekucinski commented #265
  • Jul 11 19:35
    bacloud14 commented #880
  • Jul 07 09:07
    aqos156 commented #989
  • Jul 07 08:54
    aqos156 commented #665
  • Jun 11 15:26
    agusterodin commented #871
  • May 28 17:49
    ElijahKotyluk commented #44
  • May 27 20:58
    anawan1010 synchronize #1021
  • May 27 20:38
    anawan1010 opened #1021
  • May 13 06:38
    sunshineliukang opened #1020
  • May 12 06:38
    dmmishchenko commented #1015
  • May 11 15:31
    dmmishchenko edited #1019
Josh
@joshkopecek
@loanlaux are you still looking for a solution?
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
Screen Shot 2018-07-19 at 14.50.43.png
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?
Screen Shot 2018-07-19 at 14.58.34.png
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.
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
绘制circle后转geojson会变成point,这样重新展示数据时会被编译成maker
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