Skip to main content

Questions tagged [react-leaflet-draw]

The tag has no usage guidance.

react-leaflet-draw
0 votes
0 answers
19 views

how to do autosave on editvertex ? because i dont want user to save all the time when he/she edits

Just want to save the polygons even after not saving it , and i have hided the save and cancel button. Im already rendering the polygons using my own state and im changing it on every vertex change ...
Anzil Az's user avatar
1 vote
0 answers
216 views

Error While Trying to draw a rectangle using react-leaflet-draw with Vite "Uncaught ReferenceError: assignment to undeclared variable type"

Im getting an error while trying to draw a rectangle "Uncaught ReferenceError: assignment to undeclared variable type", All other shapes are working fine, but the rectangle is not working, ...
Markos Bahgat's user avatar
1 vote
0 answers
728 views

Unhandled Runtime Error: No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>

I would like to let users create area polygons on Leaflet maps. I have seen some nice examples of people creating this in React and JS (like this one: https://codesandbox.io/s/react-leaflet-draw-...
peternovak's user avatar
0 votes
0 answers
118 views

Can't use react setState in EditStart, EditStop, DeleteStart and DeleteStop event from react-leaflet-draw

I am using React.js, react-leaflet, and react-leaflet-draw. The problem I am facing is that I cannot update a React state in the EditStart, EditStop, DeleteStart, and DeleteStop events. If I call ...
Shwe's user avatar
  • 155
1 vote
0 answers
243 views

React-leaflet: How to pass dynamic HTML/jsx/react component inside bindPopup?

I want to pass a react component or jsx code to the bindPopup function but it accepts string as input. I tried using ReactDOMServer.renderToString as shown below but the popup is not dynamic. I want ...
Premshankar Tiwari's user avatar
1 vote
0 answers
146 views

React leaflet draw causes no context provider error

I'm running into some major compatibility issues it seems. I am getting this error when I am directed to a page with a map that is meant for the user to draw a radius using react-leaflet-draw. Here is ...
lawliet1035's user avatar
1 vote
1 answer
1k views

React Leaflet Polygon drawing does not work properly

I want to design a component where I can draw a polygon using Leaflet and want to keep these coordinates. But the component I wrote doesn't work as I want in local. The necessary edit buttons screen ...
Yunus's user avatar
  • 143
1 vote
0 answers
402 views

react-leaflet-draw edit control simulate onCreated using testing library

I am trying to unit test onCreated event handler of the React-leaflet-draw's Edit control component using react testing library/jest. I tried the following without any luck: test('Polygon draw ...
Premshankar Tiwari's user avatar
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.
nOybek's user avatar
  • 405
1 vote
1 answer
1k views

problem when i npm install react-leaflet-draw react-leaflet --save

i have a problem when i try to install react-leaflet-draw react-leaflet --save i had this error npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While ...
FizMe's user avatar
  • 63
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
1 vote
1 answer
737 views

Get Input coordinates to show markers on map in react-leaflet

Can anybody write some code to get input(coordinates) from user to show as marker on map and continue adding markers with new lat,long and option to delete marker too. Please. I have written this code ...
Muhammad Hamza Khan's user avatar
0 votes
1 answer
489 views

React typescript leaflet draw: unable to toggle button

In a React + Typescript web application, I'd like to be able to show/hide the leaflet-draw "Draw polyline" button programmatically. To perform this task, I acted on the EditControl's draw ...
Starnuto di topo's user avatar
0 votes
1 answer
538 views

How do I dynamically add a circle in my map from a query in react-leaflet-draw?

I tried to create a circle from a query using the polygon component from react-leaflet. But it does not benefit from the toolbar that is provided by react-leaflet-draw. How do I make the said ...
makf134's user avatar
1 vote
1 answer
1k views

React-leaflet-draw / Cannot access EditControl component programmatically

I'm trying to access EditControl functionality with editRef ( const editRef = useRef(); ) in order to access its handlers progammatically. Unfortunately, following warning appears in web dev tools : &...
STaigertw's user avatar

15 30 50 per page