Questions tagged [react-leaflet-v3]

React components for leaflet maps. Use this tag for questions related to version 3 of react-leaflet only.

86 questions
1
vote
1 answer

How to open a specific popup on map load?

Using React-Leaflet V3.1.0 with an Express server. My users have requested the ability to use a link in the following format: https://www.mymap.com/id/:category/:id/:zoom This sends a request to the server to get the lat/lon coordinates of the…
Derick M.
  • 23
  • 1
  • 4
1
vote
2 answers

react-leaflet: Clear marker cluster before rendering new markers

TLDR; Is there a way to clear all markers from a marker cluster using react-leaflet and react-leaflet-markercluster? EDIT: Yes, there is! I just added a key prop to the MarkerClusterGroup, as @SethLutske recommended. Now, every time there is a…
1
vote
1 answer

updating props when using createControlComponent in react-leaflet 3

Following the offical reference for Higher Level Component Factory to update props for a Control Component The core APIs export other high-level component factories that can be used in a similar way. I've mimicked the example - but I get a syntax…
lys
  • 949
  • 2
  • 9
  • 33
1
vote
1 answer

Events on react-leaflet v3

I just want to catch the click event on the map. I'm either finding examples for v2 which won't work on v3, or very clear examples that work on plain leaflet but not quite in REACT-leaflet. The documentation on react-leaflet does not explain the…
Daniel Tkach
  • 576
  • 2
  • 9
  • 18
1
vote
1 answer

When I load the map React leaflet will some open popups be initialized?

I was able to get the map reference using const map = useRef (null) but now I need to have some popup open when I start the map; const map = useRef (null);
1
vote
1 answer

Search Box implementation in React-leaflet v3.1.0 give an error "TypeError: Object(...) is not a function"

I used the kboul code to add a search box in React-leaflet v3.1.0, but I get this error "TypeError: Object(...) is not a function", maybe beacause I already set an instance of map in my MapContainer option "whenCreated". I can I use the same…
emarubi
  • 59
  • 5
1
vote
0 answers

'MapControl' is not exported from 'react-leaflet' in react-leaflet V3.0.0

Trying to implement react-lealfet-draw with react-leaflet version 3.0.0. it throws an error /node_modules/react-leaflet-draw/dist/esm/EditControl.js Attempted import error: 'MapControl' is not exported from 'react-leaflet'. import…
Emad Baqeri
  • 2,333
  • 2
  • 14
  • 29
1
vote
1 answer

Uncaught TypeError: Cannot read property 'appendChild' of undefined

I have a following return from my component
{this.renderRouteSectionsList()}
0
votes
1 answer

Using bringToFront() / bringToBack() in React-Leaflet to set Layer order

I want to set the layer order of my react leaflet map by calling bringToBack() on my selected layer after the component has rendered. I tried getting the layer with useRef() and then calling bringToBack() in my useEffect Call. const LayerSupplies =…
0
votes
0 answers

Rendering Layers Selectively as Canvas / SVG in React-Leaflet

I have a map component with 1000+ overlapping polygons and want to show the Polygons from the Overlay layer always on top of the Polygons from the baselayer with the use of Panes. I found that using panes only works if the Polygons are rendered as…
0
votes
0 answers

Imagery Hybrid in ReactLeaflet

I have been using the library react-leaflet@npm:3.1.0 with the Esri WorldImagery layer provided in leaflet extras in Github. Over there I can get the url for tileLayer: var Esri_WorldImagery =…
John Barton
  • 1,581
  • 4
  • 25
  • 51
0
votes
0 answers

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 setState in EditStart/DeleteStart, react-leaflet-draw…
0
votes
0 answers

React leaflet V3 - render markers in canvas with custom icons

I am trying to render markers in canvas in React leaflet V3 using leaflet-canvas-marker library. Since this library doesn't support version 3 of React-leaflet I am using the below approaches: The approach mentioned here is successfully rendering…
Premshankar Tiwari
  • 3,006
  • 3
  • 24
  • 30
0
votes
0 answers

React leaflet draw - deleting layer doesn't work if overlapped with another layer of higher z-index

I am using React leaflet draw and facing an issue while deleting drawn layer when it is overlapped with another layer of a higher z-index. Is it possible to control the z-index of react-leaflet-draw's FeatureGroup/EditControl to render the drawn…
Premshankar Tiwari
  • 3,006
  • 3
  • 24
  • 30
0
votes
0 answers

React leaflet - GeoJSON gets hidden on drag

I understand that react-leaflet implements lazyloading/virtualization to render the data in the viewport and that is working fine for me as well. However, I am facing a strange issue when I drag. I am using GeoJSON along with Polygon component of…
Premshankar Tiwari
  • 3,006
  • 3
  • 24
  • 30