Questions tagged [leaflet-draw]

42 questions
0
votes
1 answer

Leaflet custom edit ?handler?

Is it possible to change the rectangle shown in edit mode to something else, like a marker, circle or an icon?
smurfo
  • 81
  • 9
0
votes
0 answers

How to add leaflet draw for non-geographical map (e.g. floor plan)?

I try to make an interactive floor plan like this example here but I'm using php. The images are non-geographical. As for now, I can add the floor plan image as the background in the map like this. But now I'm looking for ways on how to draw…
Chxk
  • 47
  • 10
0
votes
0 answers

Is there any function in leaflet that can draw a layer(either marker or circle) on specific angle (eg: 30 degree)?

i am trying to get a point on circle's 30 degree angle but don't know the specific thing that i have to try. Until now i tried two example 1) get angle by applying formula : x = Xc + R * cos(angle) y = Yc + R *…
0
votes
1 answer

Leaflet draw not working with Django - shape never finishes

My Django app just started having a weird problem where when I try to draw a shape on a map with Leaflet and Leaflet draw, the shape never finishes. That is, when I click and drag to draw a shape, the shape draws, then when I release the mouse, the…
Evan
  • 1,960
  • 4
  • 26
  • 54
0
votes
0 answers

Leaflet Draw - save GeoJSON to server

Inspired by this often cited question: https://gis.stackexchange.com/questions/211496/leaflet-draw-add-attributes-and-save-to-file I wanted to do something similar myself, but instead of creating a file for download, I'd like to save it on the…
Merion
  • 195
  • 2
  • 10
0
votes
1 answer

How to check leaflet map has any polygon?

I am using leaflet map, which can contain polygon(s). I want to check that map has any polygon and if it has then i want to find coordinates of that polygon?
Hunzla Ali
  • 383
  • 2
  • 5
  • 22
0
votes
2 answers

Leaflet Draw and Leaflet Snap with geojson polygon layers

I'm trying to enable snapping (using Leaflet Snap)in a Leaflet application I'm creating. I'm using Leaflet Draw. Existing layers are read in from a database in geojson. I add these to the guideLayers and I add newly created features there too. It's…
Dan
  • 13
  • 1
  • 5
0
votes
4 answers

Leaflet click event unable to listen to only the map layer

My leaflet project has a few user drawn shapes on it. When clicking on the shape, another element such as a sidebar will print out the stats. If I click on the map layer, the element is supposed to reset. I tried using the map.on('click') event,…
disguisedtoast
  • 149
  • 1
  • 4
  • 15
0
votes
1 answer

Which Leaflet library or workaround to control toolbar size

I need to change the styling of the toolbar like the size of the button to have a bigger touch area for mobile (draw toolbar and other controls). I already tried to change the size to 48px for width and height of toolbar button using css. Current…
0
votes
1 answer

Remove multiple layers on leaflet draw

I use leaflet draw for drawing polygons on a map. At the moment, I'm only able to delete the clicked polygons. This is an example of what I have right now: http://leaflet.github.io/Leaflet.draw/docs/examples-0.7.x/full.html Let's say that you draw 3…
Savandy
  • 363
  • 1
  • 3
  • 14
-1
votes
1 answer

Leaflet.draw emit event to stop drawing

Using leaflet-draw, when i draw with a polyne i need to end the drawing when the second point of the rect is fixed. Listening on 'drawvertex' event two times, in the mymap.on(L.Draw.Event.DRAWVERTEX, function(e){ console.log("draw 1st…
khalD
  • 317
  • 5
  • 15
1 2
3