Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 17 12:56
    ilan-deepreach opened #965
  • Oct 17 12:53
    ilan-deepreach opened #964
  • Oct 16 03:23
    zlh2015 commented #664
  • Oct 15 21:38
    tustin2121 commented #880
  • Oct 14 12:18
    isak-glans opened #963
  • Oct 10 20:09
    isak-glans edited #962
  • Oct 10 20:09
    isak-glans edited #962
  • Oct 10 20:05
    isak-glans edited #962
  • Oct 10 20:03
    isak-glans opened #962
  • Oct 10 08:19
    vstyle commented #943
  • Oct 04 07:44
    NebojsaStanic commented #129
  • Oct 02 09:24
    astridx opened #961
  • Oct 02 05:52
    rannooo opened #960
  • Sep 29 00:46
    DustinKLo edited #959
  • Sep 29 00:45
    DustinKLo edited #959
  • Sep 29 00:35
    DustinKLo edited #959
  • Sep 29 00:34
    DustinKLo opened #959
  • Sep 24 16:34
    colbyfayock edited #958
  • Sep 24 16:33
    colbyfayock opened #958
  • Sep 23 08:34
    BitaShamsafar commented #34
Tal
@t1a2l
Hi, for some reason i'm experinceing all kinds of errors that was fixed already. I use cdn to get the latest version but still.
Jon West
@ddproxy
@t1a2l CDN should be updated nightly - sorry you had that issue. Which CDN are you using?
Loan Laux
@loanlaux
Does anyone know how to handle users drawing a polygon across the anti-meridian?
I'm building a web-app allowing users to draw polygons on a map using Leaflet.Draw and I need to get these polygons' coordinates. Problem is: when one of those polygons crosses the anti-meridian, Leaflet.Draw returns bounds that go outside the standard [0, 180]. I would expect to get a multi-polygon whose coordinates always stay within [0, 180].
Is there a way to get Leaflet to return that instead of a single polygon with non-standard coordinates?
Loan Laux
@loanlaux
Or should I find an npm package that can convert this single polygon into a [0, 180] MultiPolygon?
Would gladly appreciate a reply :)
Bexanderthebex
@Bexanderthebex
hello guys, leaflet draw control icons are not displaying properly, what do you think is the problem?
i am integrating it with angular.
Mayur Champaneria
@github-mayur
Hello Guys, I am using leaflet to display markerGroup. When I search something, my result get updated and I am printing result in table as well as showing markers on Map. But now i want to filter results when I zoomIn or zoomOut. like i.e. if I zoomIn, that covers 4 markers in map, then my search result will display only that 4 results in table listing. Any help?
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.