Skip to main content

All Questions

1 vote
1 answer
287 views

How can I access the map object since the whenCreated prop was removed in react-leaflet v4.x?

I have been struggling with an issue which comes down to me not being able to properly reference the map object. After researching it for a few days, I've come to the conclusion that the "old&...
EngineeringCheetah's user avatar
0 votes
1 answer
388 views

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 ...
user avatar
0 votes
0 answers
146 views

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 ...
user avatar
1 vote
0 answers
54 views

React-leaflet LeafletTrackingMarker does not work when it's under MarkerCLusterGroup

how to move smooth markers from old coordinate to new coordinate in MarkerCLusterGroup i have a code in reactjs that works perfectly for LeafletTrackingMarker lets assume that i have 10 position , ...
MR Int's user avatar
  • 43
0 votes
1 answer
587 views

React Leaflet 4.2.0 - how to change zoom on button click?

**I would like to add a button next to the map, after clicking which I will be able to change the zoom of the map. ** Is this feasible in the new version of react-leaflet? Example scenario: I display ...
Bartek Giepard's user avatar
0 votes
2 answers
304 views

React-Leaflet LocateControl component - keeps duplicating on each refresh

I'm using Locate Control in React Leaflet, but the Locate Control buttons are always duplicated, and sometimes I get 3 or 4 of them (see image below). I'm running the function through a useEffect with ...
andy spears's user avatar
0 votes
1 answer
390 views

React-Learflet - Change circle opacity when clicked

I'm trying to change my circle Opacity when I click on it to act as an active state I declared my state const [active, setActive] = useState(false) My function const sidebarTrigger = () => { ...
Phakamani Xulu's user avatar
0 votes
1 answer
1k views

How to Add Layer in React Leaflet & Routing Machine and Filter by Vehicle Code

You can see the component I created in the picture. Here are the different vehicles and their latitude and longitude values. I am routing according to these values. What I want to add at this stage is ...
Yunus's user avatar
  • 143
0 votes
1 answer
651 views

React Leaflet Marker offset change

The tip of my markers does not come out exactly where it should. You will see it more clearly in the screen output I will add below. I wrote some properties for icon in L.Icon.Default.mergeOptions but ...
Yunus's user avatar
  • 143
0 votes
2 answers
2k views

How to make React Leaflet Marker popup in right side always?

I want to show a React Leaflet Marker popup on the right side of the map screen, but it always sticks to the left side of the screen. Therefore, I would appreciate any help in getting this done. Below ...
Rahul Raj's user avatar
  • 516
1 vote
1 answer
75 views

React function returns the last item in the JSON instead of mapping all of them

const ZoomToLocation = ({latitude, longitude}) => { const map = useMapEvents({ click() { map.setView([latitude, longitude], 15) } }) return null } function MyMap() { return( &...
Gatnik's user avatar
  • 59
1 vote
1 answer
924 views

Built in types of marker icons in react leaflet

I wanted to know if there is any other type of marker that comes with react leaflet apart from the default blue one. Also without uploading any icon image, how can I customize the existing marker icon?...
c0mp1eX's user avatar
  • 15
2 votes
1 answer
2k views

TypeError: Cannot read properties of null (reading '_leaflet_disable_click')

I am using react-leaflet with nextjs and I have markers, inside the popups of these markers there is a button that open another page when clicking, but I am getting this error when opening the another ...
Kiki's user avatar
  • 23
0 votes
1 answer
300 views

Geo Locate component in Leaflet React v3 - unwanted duplication on each refresh

I'm currently using Leaflet in React (v3) where you need to add components in order to render them on the map. This is the unwanted result output I am getting (green circles are duplicates and don't ...
FlyingVespa's user avatar
0 votes
1 answer
1k views

Pass function to divIcon in React-Leaflet

I'm new to React-Leaflet (using v3), so if I'm missing something obvious that's why. For my current app I need to be able to have rotated markers on the map, which open up popups that should also be ...
anna's user avatar
  • 3

15 30 50 per page