Questions tagged [leaflet.draw]
Vector drawing and editing plugin for Leaflet
leaflet.draw
301
questions
0
votes
0
answers
23
views
How can i pass in coords to draw the correct shape on an IMAGE?
can I pass actual x / y cords to Leaflet.js to draw a shape? - I have tried using actual cords and the shape is nothing like I expect - also SetView cords can I pass them here too ?
Code:
var map = L....
0
votes
1
answer
60
views
Trouble loading markers inside a polygon using Leaflet.js, FreeDraw, and Laravel
I use Leaflet.js, FreeDraw, and Laravel to create a real estate system. The functionality I am trying to set up is that when the user draws a polygon on the map, it should trigger an API call and only ...
1
vote
0
answers
75
views
Changing Colours of Leaflet Map
I wonder if and how it is possible to change the color of the map (individual countries, backgrounds and lines) in Leaflet?
I have simply created the basic code of a leaflet map as specified in the ...
0
votes
0
answers
20
views
leaflet (angular) dosn't show overlay-pane
I have the next map with leaflet:
private initializeMap(): void {
let ubicacion = this.obtenerUbicacionActual();
const center: LatLng = latLng(ubicacion[0], ubicacion[1]); // where i am
...
1
vote
0
answers
72
views
Leaflet draw polygon is rendering/drawn wrongly shifting bit away from selected position in Angular 17 with ssr enabled
We are using angular 17 and we have used leaflet and leaflet draw JavaScript plugin to plot the map and want to draw polygons, rectangle over it and get the boundary co-ordinates of the same. But when ...
0
votes
0
answers
136
views
how to enable leaflet edit & delete buttons in leaflet-draw-toolbar by default in vue2
I am using leaflet map library. I am facing issue with leaflet-draw-toolbar in which I have edit & delete buttons but these buttons are disabled by default. please provide me solution by which I ...
0
votes
0
answers
44
views
how to add new polygon layers to already drawn ones
how to add new polygons to an existing layer, so as not to completely redraw, but only add new ones?
the current code completely redraws the entire layer, but it is necessary for new zones to be added ...
0
votes
0
answers
135
views
Create a wider selection area to select the lines on react-leaflet map
Having difficulty in selecting the lines on react-leaflet map, so I have followed the below solutions,
https://gis.stackexchange.com/questions/466747/create-wider-selection-area-to-select-lines-on-...
0
votes
0
answers
164
views
Enable edit polygon on click in leaflet maps
I'm using below function to get geography data from backend as json and then draw polygon using leaflet:
function drawAreas() {
$.ajax({
type: "POST",
url: "...
0
votes
1
answer
104
views
Leaflet: Error while trying to get a GeoJSON from multipolygon Layer
The issue is this one:
I successfully could implmement a MultiPolygon Layer in Leaflet, but I'm getting an error while trying to convert it to a GeoJSON object.
My code is this one:
let ...
0
votes
1
answer
114
views
Calling cancel button while drawing in Leaflet-Draw
I am Creating Map with some areas drawn as polygons. Each area have property AreaNumber. AreaNumber is given in input under map.
Problem is: How to cancel drawing if AreaNumber is not written in input?...
1
vote
1
answer
353
views
Leaflet Draw: Attempting to erase a drawn shape, by clicking outside of it after drawing it
I'm developing a Laravel app with Leaflet, and trying to implement some funcionalities with the Leaflet Draw plugin.
What I'm trying to do is this: Drawing a polygon, rectangle or circle with Leaflet ...
0
votes
1
answer
324
views
Prevent draggable circle using Leaflet circle and leaflet-draw library
I have a circle that I add to the map when you click on a specific point (centroid of that circle will be where the point is) and you can edit the circle, meaning you can resize it using the gripper ...
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.
0
votes
0
answers
100
views
Leaflet Draw - Selecting 1 Draw Option then another causes Drawing to drag map instead of shape
When attempting to draw, if you first select Draw Circle then select Draw Rectangle then go to click on the map, instead of beginning the drawing and dragging the shape out, the shape gets an initial ...
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: {...
0
votes
0
answers
93
views
Leaflet. Does not put a dot exactly where you click
<div class="leaflet-marker-icon leaflet-div-icon leaflet-editing-icon leaflet-div-icon-wh leaflet-zoom-animated leaflet-interactive leaflet-marker-draggable" tabindex="0" style=&...
0
votes
3
answers
268
views
How to use L.canvas to draw a fluctuating circle
I am a back-end programmer who is using leaflet for the first time. I don’t know much about js animation steps. I want to use L.canvas to draw a dynamic circle, just like the picture below.
Specify ...
1
vote
0
answers
2k
views
react leaflet draw - editing a polygon and updating polygon state doesn't work as expected
I have an array of polygons set as state. I want to show them using Leaflet and edit the polygons. Polygon state must change, so I can store them in a database later on.
Problem is: if I edit an ...
0
votes
1
answer
232
views
Leaflet Draw - How to remove the default toolbar so I can implement a customized one
I'm very confused... If I pass draw: false. I get a toolbar. I need to customize this toolbar so I passed in the parameters to ensure only imperial units were being used at the time and well. Now I ...
1
vote
1
answer
963
views
Leaflet - allow user to draw a Polyline with only two points?
Leaflet draw allows users to draw lines on a map. There's an example at https://leaflet.github.io/Leaflet.draw/docs/examples/full.html
I want my users to be able to draw lines consisting of only two ...
0
votes
1
answer
634
views
Trying to integrate leaflet's movingmarker plugin to react-leaflet , i have no idea on how to do that .is there any other way to animate
These are my code
suggest me if there is an alternate way to animate my marker
https://ewoken.github.io/Leaflet.MovingMarker/
0
votes
0
answers
112
views
leaflet-draw error: TypeError: can't access property "falseFn", L.Util is undefined
Am getting the error TypeError: can't access property "falseFn", L.Util is undefined when using react-leaflet v3.2.0, NextJs v12.1.6, leaflet v1.7.1 and leaflet-draw v1.0.4. The issue is ...
0
votes
1
answer
229
views
How can I show the polygon coordinates by popup in Angular?
here is the function of drawing polygon in leaflet map.
onDrawCreated(e: any) {
const { layerType, layer } = e;
if (layerType === "polygon") {
const ...
0
votes
1
answer
159
views
Check if my coordinate points are inside a polygon drawn by a user
I want to check if my coordinate points are inside a polygon that is drawn by a user in leaflet.
For that, I have one file with my points: shp_geo_sirene
> shp_geo_sirene
Simple feature collection ...
0
votes
0
answers
483
views
Leaflet Draw - Editing Polygon: Editing does not behave right
i am currently working on a project where a user should be able to edit zones (= polygons). I have created a class Zone which extends L.Polygon so I can create zones and add them to the map. The ...
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 ...
0
votes
1
answer
1k
views
Leaflet click to edit layer
i have polyline featuregroup on map and i want to edit layers on click.
if (layer instanceof L.Polyline) {
const style = {
color: InvestmentConstants.colors[$ctrl....
0
votes
1
answer
312
views
how to use "leaflet-buffer" in react-leaflet?
I want to buffer the shapes
I drew on the react-leaflet.
But I can't find any npm library to react like "leaflet-buffer".
Please help me.
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 ...