Skip to main content

Questions tagged [leaflet.draw]

Vector drawing and editing plugin for Leaflet

134 questions with no upvoted or accepted answers
7 votes
0 answers
3k views

React Leaflet.draw: How to create draw functions with standard buttons without using the react-leaflet toolbar, however, have it written in "React"

how can I create custom buttons that reside on a leaflet map in a separate control box to create "Polylines", "Polygons" or a "Marker" which will all be on separate ...
robert's user avatar
  • 71
3 votes
0 answers
358 views

Leaflet Draw - Editing Polygon: changing Polygon points does not reset Polygon edit points

i am currently working on a functionality, where a user can create and edit zones (polygons). Therefore I am using a class Zone which extends L.Polygon. To edit a specific instance of Zone I am using ...
Luca's user avatar
  • 57
3 votes
0 answers
1k views

Django RF: POST geometry from Leaflet Draw to PostGIS

I'm trying to store some geometry in a PostGIS DB which is created using Leaflet Draw. The following answer only covers the first part: how to transform the drawn shape into GeoJSON, i.e.: map.on(...
sc28's user avatar
  • 1,193
3 votes
0 answers
2k views

Getting the Altitude in leaflet

I was wondering if there is a way to get the altitude for my current location in leaflet like getting the latitude and longitude this.marker = leaflet.marker([e.latitude, e.longitude]).addTo(this.map)...
Nouf's user avatar
  • 763
3 votes
0 answers
2k views

change default icon toolbar (Leaflet)

how can i change default toolbar icon to something else on leaflet.. picture above show the default view of icon.. i want to customize and change the icon to something else for example the first ...
paan's user avatar
  • 355
3 votes
2 answers
2k views

Assign multiple feature group in edit control in leaflet draw

How can i assign multiple the feature groups in edit control, Assume we have two feature groups(It can be multiple),and we want to assign edit control to both groups. This is groups, var ...
Pavan's user avatar
  • 310
2 votes
1 answer
177 views

Leaflet.Path.Transform - is there a way to add edge markers in the middle of each border?

I want to add circles in the middle of each border (only visually). Is there a way to do it? There are handlerOptions but I couldn't find something like that there.
erez chen's user avatar
2 votes
0 answers
231 views

Leaflet draw does not show the area of the Polygon

I've seen that in some examples using leaflet draw, after drawing the third point, a popup shows the area of the drawn item on the map. I'm unable to replicate this function even setting the polygon: {...
Dastial's user avatar
  • 31
2 votes
1 answer
945 views

How to get polyline coordinates React-Leaft-Draw plugin?

I use this plugin to draw lines on Leaflet map in my project: https://github.com/alex3165/react-leaflet-draw I want to get coordinates (lat,long) of drawn polyline, when _onCreate or later. How could ...
TranceAddict's user avatar
2 votes
1 answer
588 views

How to place custom leaflet.draw shape programmatically?

I'd like to restore a custom L.Draw.Marker (L.Draw.Waypoint) from database, but when i try to initialize it, the result is not a proper layer, but simply the handler. How can i do this without using ...
Janphr's user avatar
  • 31
2 votes
2 answers
800 views

How to get in a variable the geometry type from leaflet draw tool bar

I am using Leaflet draw plugin in my Angular app which already has leaflet installed. I´d like to get in a variable if the selected geometry in the toolbar is a point, a line, a polygon etc. In the ...
Carlos FTG's user avatar
2 votes
0 answers
231 views

How to make adjacent polygons align with the edited polygon in leaflet?

Is there any way in Leaflet to edit a shape file (from database) consisting of adjacent polygons in the same manner as in QGIS using the "Reshape feature"-tool in the Advanced Edit toolbar? At the ...
agh's user avatar
  • 107
2 votes
3 answers
2k views

Why do multiple react-renders break leaflet-draw editing, and how do I fix it?

Workaround: The best workaround that I could find so far - I'll leave this open in case someone comes up with something better. Two parts: Assign a 'cache-busting' key as in the update below (use ...
andrew's user avatar
  • 218
2 votes
0 answers
550 views

Style layer.editing in leaflet

I'm working on getting the events of deletion and edition outside the box of leaflet, meaning using buttons binded to events instead of the drawtoolbar. The editing button calls layer.editing.enable()...
Allain's user avatar
  • 115
2 votes
2 answers
861 views

Leaflet.minichart using R in jupyter notebook

Background I'm no familiar with Javascript language, then I have tried the package leaflet.minicart using R inside the Jupyter notebook. Writting the example code as follows: library(leaflet) m ...
Han Zhengzu's user avatar
  • 3,792

15 30 50 per page
1
2 3 4 5
9