Skip to main content

Questions tagged [leaflet.draw]

Vector drawing and editing plugin for Leaflet

leaflet.draw
1 vote
0 answers
2k views

Get all polygon or layer details after polygon draw in leaflet draw

I am trying to get the layer details of the map which are already overlay on the map. When leaflet draw is created I want to get the layer details (Not the polygon coordinates created by leaflet draw ...
Saroj's user avatar
  • 1,373
0 votes
0 answers
362 views

How can I draw a polyline with leaflet-draw to only get the shown dashed line and then disable the plugin?

I am trying to use the Leaflet-draw plugin to draw a simple polyline. Right now I can enable the plugin where I need it when I start to draw the polyline and it works by adding the vertex to the start ...
bees's user avatar
  • 1
1 vote
1 answer
1k views

Limit maker points in Polyline (to be a Line) using leaflet-geoman

I want to enable the user to draw a Line (which is a Polyline with only 2 points). I enable drawing and the listen for vertexadded. When the _rings marker count equals 2, I disable drawing. This feels ...
Hoetmaaiers's user avatar
  • 3,483
1 vote
1 answer
128 views

How to create a button in shinyR which event is the same as the polygon drawing toolbar in leaflet map

I want to create a button in shinyR which event is the same as the polygon drawing toolbar in leaflet map. I'm trying to figure out how to manually trigger events from R to Leaflet polygons. Basically,...
Dawine's user avatar
  • 43
0 votes
0 answers
136 views

Layers in Leaflet.Draw is different every time

What I want: To click delete, choose drawn layers, and delete them from the UI and firestore when clicking save How I have it now: Every time i am creating a new leaflet.Draw layer (ex. a rectangle), ...
Brage Fridriksson's user avatar
0 votes
1 answer
469 views

How to reference the deleted layers in Leaflet.draw?

I am trying to delete a Leaflet.draw layer from my database in firestore. I can easily delete it from the database side, but i struggle with connecting the document name with the layer name. More ...
Brage Fridriksson's user avatar
0 votes
2 answers
2k views

Leaflet JS - Draw rectangle and filter circle markers in the rectangle and update HTML table with only those markers

I have a leaflet map which has circleMarkers plotted by longitude and latitude using the markers array coming from an AJAX REQUEST. This all works fine. I am trying to work on drawing a rectangle ...
roa765's user avatar
  • 295
1 vote
1 answer
2k views

Cannot read property 'error' of undefined in map.addControl in leaflet.js

First I write a code to create a toolbar with leaflet.draw var drawPluginOptions = { position: 'topright', draw: { polyline: false, circle: false, // Turns off this drawing ...
Fereshteh Mirjalili's user avatar
0 votes
2 answers
3k views

Get the coordinates of a rectangle on Leaflet

I will want to get the coordinates of each corner of a rectangle that the user will draw on a map (leaflet). The goal is to extract the max/min latitude and the max/min longitude. Here is the code ...
A-d-r-i's user avatar
  • 127
0 votes
1 answer
804 views

Leaflet convert meters to pixels

I am creating an app using leaflet I have the leaflet map up and running and have a Geoserver service that return points that are shown on the map. I have one additional field that is distance between ...
Loki's user avatar
  • 1,163
0 votes
1 answer
2k views

How to change the map center position to top place using Leaflet open street map in angular

In my angular application I have created the leaflet map and over the leaflet map I have created two more panels data in overlapping manner And I have created the circle of 5 km radius on the map. But ...
Haritha's user avatar
  • 87
0 votes
0 answers
276 views

popup.openOn(map) only works in firefox, not in chrome or edge

tl;dr popup.openOn(map) only works in firefox, not in chrome or edge. Popups on markers work flawlessly. Lengthy version: I'm kind of abusing leaflet.draw to let users insert an image overlay. I do ...
DM_Resources's user avatar
0 votes
1 answer
1k views

Using leaflet.FreeDraw with leaflet.path.drag

I am wondering if it's possible to use Leaflet.FreeDraw with leaflet.path.drag to be able to drag the polygon created by FreeDraw plugin. jsfiddle I tried to enable dragging plugin like this, but it ...
Matt's user avatar
  • 8,753
-1 votes
1 answer
655 views

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, ...
khalD's user avatar
  • 324
0 votes
2 answers
1k views

The markers drawn on leaflet.draw are not deleted after removing layer

I created a simple app to add points using leaflet draw. If the user cancel de dialog the drawn layer is removed. However, when the next marker is drawn, the previous cancelled ones appear again. Here ...
Josep Pueyo's user avatar

15 30 50 per page
1
3 4
5
6 7
23