Skip to main content

All Questions

0 votes
1 answer
50 views

Leaftlet divIcon with clickable button

I'm working on leaflet and I wanted to add click event for a icon in the custom divIcon as below, If user clicks on the edit(pencile) icon then click event should trigger, Here is the code I'm ...
Kishor's user avatar
  • 200
0 votes
1 answer
435 views

How to add Markes to a Leaflet-map with coordinates from database in Next.js?

I have to display markers for all the places in my database. At the moment I can display just one marker. I maped over the array from database but I do not know how to connecte these two. I would ...
Ida's user avatar
  • 1
0 votes
0 answers
324 views

Remove marker is disabled after one marker remove from map

I am using the react-leaflet/core library together with the plugin Leaflet-Geoman which using the removalMode to delete the marker from map Below is my code import { useLeafletContext } from "@...
Developer007's user avatar
0 votes
0 answers
2k views

React-Leaflet custom markers with condition

Hej! I'm very new to leaflet and react and have an issue changing the icon of the marker based on a condition. I want different colored markers based on the project and set the opacity based on the ...
piah's user avatar
  • 158
0 votes
1 answer
1k views

Is it possible to display react leafletjs markers on specific zoom levels?

I'm using react Leaflet js map, and I'm displaying markers of fetched data from my database on the map, but the issue is that I have kind of 5000 markers and it's a lot to display on zoom level 9, so ...
Firas SCMP's user avatar
3 votes
1 answer
830 views

leaflet marker popup opening and immediately closing

In my leaflet map, clicking on a marker opens its popup and immediately closes it. Logging of map events reveals that instead of firing just a popupopen event, the click on the marker triggers 2 ...
orange77's user avatar
  • 1,043
0 votes
1 answer
728 views

React-leaflet problem to create <Marker> <Popup> instance dynamic

I would like to create a react-leaflet object dynamically. Normal leaflet objects work, but react-leaflet do not. Code example on: https://codesandbox.io/s/show-problem-react-leaflet-marker-popup-...
Martin's user avatar
  • 25
0 votes
0 answers
867 views

How to rewrite from react-leaflet v2 to v3?

There is a library that runs on react-leaflet v2. https://github.com/somarmeteorologia/react-leaflet-markers But my project uses react-leaflet v3. Therefore, this library needs to be rewritten for the ...
Aliaksei Valadzko's user avatar
1 vote
2 answers
8k views

how to add styles for custom leaflet popup

I am trying to add styling of marker popup but styles are not reflecting on popup. Also not able to add priming button. import { Map, marker} from "leaflet"; const popupOptions = { className: "...
vinita jain's user avatar
3 votes
1 answer
5k views

React leaflet How to have all markers with a specific icons but the one active with a different icon

So I am trying to have an active marker that is different from the rest of the non active marker. So basically I want something like this. To display all of the icon I am using the following. that is ...
user avatar
2 votes
1 answer
3k views

ReactJs Leaflet Marker Location Position Problem

I am trying to add a map in my reactjs project with leaflet and want to show the location's of vehicles on the map. I made a sample usage for this. But When i used marker on the map i see that (as you ...
ORCAs's user avatar
  • 151
1 vote
1 answer
2k views

How to display markers from array in reactjs using leaflet charts

I have one array with three indexes - ID , LAT, LNG. I want to get LAT & LNG from my array and set the values on my marker. For the first index I want to display a PopUp. I use leaflet charts for ...
Pizhev Racing's user avatar
2 votes
1 answer
11k views

React-Leaflet draw circle markers on map

I'm new to Leaflet/React-Leaflet and I am trying to plot a circle marker on a map and I'm having trouble. React-Leaflet's documentation is not very good. I have figured out how to add a popup that ...
Nick Kinlen's user avatar
  • 1,396
1 vote
1 answer
3k views

Path to icon in react-leaflet Marker component

I am using react-leaflet lib. And after rendering marker, I get an error that there is no file. I had tried to put manually file in root folder of component which creates Marker but then I get fatal ...
Stevan Tosic's user avatar
  • 7,029
45 votes
8 answers
87k views

custom marker icon with react-leaflet

I tried everything I found on the web, Stackoverflow and Github, and I still can't make it. I want to make a custom marker with a custom icon, but with my code below I always got an error : '...
arnaudambro's user avatar
  • 2,583