All Questions
1,096
questions
0
votes
1
answer
79
views
React-Leaflet: updating a marker's position every second fetching the coordinates from an .env file
I'm running a simple react-lefleat map on small http server running on an Arduino board and I would like to update a marker's position (my position) according to the coordinates extraced by the ...
0
votes
1
answer
57
views
Leaflet mosaic TileLayer
I want to use leaflet reactjs and i want to do it on an image.
the prblm is that the image is shown as mosaic.
<div className="bg-white w-auto m-2 h-[calc(635px-10rem)] border-2 border-gray-...
0
votes
1
answer
106
views
React Leaflet Material UI divIcon not styled
In React Leaflet, I am trying to use divIcon to render a custom Material UI marker that takes in a background color prop. However, when the marker is used in leaflet, the background style is not ...
0
votes
0
answers
123
views
How to create satellite layer with labels using react-leaflet-google-layer
Trying to implement satellite view with labels on my react project using react-leaflet and react-leaflet-google-layer packages.
I can create satellite view but not able to add labels on map (city ...
0
votes
0
answers
120
views
Working example for Leaflet Geosearch in react
Excuse my ignorance, but being new to react and JS, I am getting irate trying to follow the docs for https://smeijer.github.io/leaflet-geosearch/ &
https://github.com/smeijer/leaflet-geosearch
I ...
0
votes
1
answer
222
views
React Leaflet divIcon with clickable button
In react-leaflet, I am trying to add a draggable button to the map as shown in the image below. I also want the rest of the div to be non-clickable.
However, when I click the button, nothing happens.
...
1
vote
1
answer
82
views
How to Get GeoJSON Feature on Map.Locate in React Leaflet
I am creating a map with imported GeoJSON data. I am trying to create a Find Me button that will zoom to the user's location and get a property associated with the enclosing region (as defined by the ...
0
votes
2
answers
279
views
Type Error Importing GeoJSON file in a Typescript React App
I am trying to import a GeoJSON file to map region in a Leaflet map using React-Leaflet. I started the project using create-react-app. However, when I try to use the data in the GeoJSON component, I ...
0
votes
0
answers
13
views
How to dynamically resize Leaflet CRS.Simple map based on viewport while maintaining standardized coordinates? [duplicate]
I'm using Leaflet to render a static image as a map. For the sake of example, let's say the image is 700px x 700px.
To create the map, I do the following:
map.current = L.map("map", {
...
0
votes
0
answers
109
views
Issue using MapContainer from react-leaflet: TypeError: Cannot read properties of null (reading 'useState')
I'm trying to use React Leaflet to add a map from OpenStreetMap on my website. Everything seems to go well syntax wise, however when I try to use I encounter this error:
Uncaught TypeError: Cannot ...
1
vote
1
answer
120
views
How to stop a click propagation for custom react components that are child to MapContainer
I`ve created a custom control react component for map like that:
export const MapZoom = () => {
const map = useMap()
const handleButtonClick = () => {
map.zoomIn()
}
...
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&...
0
votes
1
answer
93
views
Dynamically change the background color of the TileLayer attribution
I have created a component that contains the map and changes the map for dark or light mode.
How can I dynamically change the color of the attribution? There's any props or style key that i can use ?
...
0
votes
0
answers
113
views
Problem creating an L.Map instance with React-leaflet
There is a map state defined as
const [map, setMap] = useState(null);
Here is the snippet which is supposed to initialize the map:
<MapContainer
center={
areaOfInterest.latitude ? [...
0
votes
0
answers
126
views
Leaflet Map open popup in markercluster from outside with react-leaflet and react-leaflet-markercluster
I encountered an issue with combining two functionalities: placing Markers in a group using the MarkerCluster plugin (https://tomickigrzegorz.github.io/react-leaflet-examples/#/marker-grouping-...