Questions tagged [leaflet.draw]
Vector drawing and editing plugin for Leaflet
leaflet.draw
343
questions
1
vote
0
answers
824
views
Cannot read properties of null (reading 'offsetWidth') when loading react-leaflet map
I have a reusable leaflet map component in my react project and every time I search for a specific key word, the markers and the shapes(fences) will get updated. When I reload the parent component (...
1
vote
0
answers
36
views
i am working on someone project that use a version of react-leaflet that import Map instead MapContainer [duplicate]
I wanna do a task that needs react-leaflet-draw but this error occurred
Does anyone know what should I do except updating the react-leaflet because the project is too big?
1
vote
0
answers
782
views
How to get a canvas element in leaflet map?
I need to fill the polygon with texture using canvas. How can I get a polygon element to do this?
let latlngs = [
[1714, 2549],
[1776, 3336],
[934, 3121],
[836, 2382]
];
let ...
0
votes
0
answers
560
views
Leaflet Draw: Unable to to Drawing
Leaflet version I'm using: 1.7.1
Leaflet Draw version I'm using: 1.0.4
Browser (with version) I'm using: Firefox 92.0b2 (64-bit)
OS/Platform (with version) I'm using: macOS 11.5
I have a custom ...
0
votes
0
answers
227
views
Leaflet: Edit button not enabled when drawing over an ImageLayer
All:
Perhaps I am not doing this the correct way. The way Leaflet draw works is that as soon as you draw something on a map using the draw control (circle, square, polygon, whatever) the delete/edit ...
0
votes
0
answers
961
views
How to use Leaflet.Draw to add and save polylines and reuse in code?
how can i use Leaflet.Draw just for add Polylines and save them in in js code.
I just want to use Leaflet.Draw cause i dont know my coordinates on my map. And i would add over 100 Polylines.
I want to ...
0
votes
0
answers
825
views
leaflet-draw in VUE3 throws error as wrong leaflet version
I am creating a page in VUE3 where I am including leaflet and leaflet-draw libraries. I am using leaflet version "^1.7.1" and leaflet-draw version "^1.0.4" which are latest as of ...
0
votes
1
answer
779
views
Leaflet.draw multi-coloured polyline segments
I am using leaflet.draw to draw a polyline, with the user doing all the point and clicking (i.e. the points do not come from a database). I want the lines between the individual vertices to be ...
0
votes
1
answer
177
views
Using the same Plug-in for multiple purposes in leaflet
I am trying to use the leaflet-draw tool for two different things:
as a "regular" tool to create new geometries
if I draw a line, I perform some calculations with turf.js, giving me points ...
0
votes
1
answer
583
views
Leaflet draw delete features with property
Is it possible to delete multiple features from geojson at once by checking property value?
Using for example code below or using Leaflet draw?
function deleteArea() {
var layers = featureGroup....
5
votes
1
answer
5k
views
ngx-leaflet-draw: Importing module which does not have a ɵmod property
Importing LeafletDrawModule which does not have a ɵmod property
I am seeing this error during my unit testing(jest).
The code works fine when I run the ng application. Leaflet draw function works ...
1
vote
0
answers
500
views
Leaflet.draw how to draw circle with two mouse clicks
I'm using leaflet.draw
By default, to draw a circle :
You should click on map(this will be the center of the circle)
Then drag the mouse to draw the radius of a circle.
https://leaflet.github.io/...
1
vote
1
answer
153
views
How can I remove last shape layer when creating new one in lefalet
According to this codesandbox I'm using to to generate a map on react and I have implemented the drawer plugin. here I want to delete the last shape I have added to the map and create and show the new ...
2
votes
1
answer
2k
views
how to draw shapes in react-leaflet v3
Do you have any idea about implementing the draw functionality to react-leafletV3?
I have added an event listener but it is not working and reacting to anything.
useEffect(() => {
if (!map) ...
1
vote
0
answers
1k
views
Allow point delete in mapbox draw mod
I am trying to rewrite a MapboxDraw.modes.draw_line_string.clickAnywhere function to allow deletion of a previous point with the SHIFT key in draw_line_string mode.
It works, but when it removes the ...