All Questions
39
questions
0
votes
1
answer
128
views
React Leaflet map resizing issues
While using react-leaflet to create a map, I would like the map component to take over all the available space after header and footer. The code seems to work. However, when the resize handler is ...
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
93
views
How to properly change a loaded KML in react-leaflet-kml
I am using react-leaflet-kml and the functionality I am trying to make is a list of buttons corresponding to a KML file, which will make the map load/render that KML.
Currently, the buttons simply ...
0
votes
0
answers
70
views
How can I make a programmatic click in react-leaflet?
I am working on a map webapp, that should react on navigation from another route in the following ways:
fly to coordinates
click on them programatically
// fly
const map = useMap();
...
0
votes
0
answers
124
views
State not changing in leaflet map.on("click") function in React
I'm using Leaflet with React (not react-leaflet because there seems to be a lot more documentation for standard leaflet), and I want to add functionality in which a user can place Markers on the map.
...
1
vote
1
answer
295
views
React Leaflet update position
I've got a question about React Leaflet. I am now trying to build a PWA with the react framework and I need to use a map, hence React Leaflet.
So here's the situation :
I need to load the Map when I ...
0
votes
2
answers
585
views
Leaflet map is not displayed in ReactJS
I have included both the css and js Leaflet map CDN links.
Also given height and width to div container inside which Map component is present, but still the map is not getting displayed. The space of ...
0
votes
0
answers
654
views
React Leaflet Waypoints route in Sea
By using react-leaflet and leaflet npm, I have been implementing ship live location tracker. I have implemented the UI and functionality. But, I need waypoints in sea. But It always showing tracker ...
2
votes
0
answers
87
views
Leaflet map not rendering full image properly on mobile devices
I'm currently working in a react web-app. We are using leaflet to render some buildings maps. The app is working good in desktop. But we found the maps images are not loaded properly when using mobile ...
0
votes
0
answers
317
views
Why am I getting invalid hook errors here in my React app?
Trying to bring in Leaflet to display a map using code from their website. Saw a tutorial with a guy bringing in the same code with no errors - it's React typescript template btw
My code:
import React ...
0
votes
1
answer
800
views
Parameters of my function in React child component are not being passed to the parent component's function. Why is this happening?
In the parent:
const [newPinPosition, setNewPinPosition] = React.useState({ lat: 0 , lng: 0 });
const updateNewPinPos = (pos) => {
console.log(pos);
setNewPinPosition({ lat: pos.lat, lng: ...
0
votes
1
answer
128
views
Dynamically add circles to react leaflet with blockchain
I have read this post which partly answers my question, but my problem is the infinite loop that the provider.on method creates with setData(_data). I simply want to update the circle information to ...
0
votes
0
answers
1k
views
useEffect hook isn't triggered inside ReactDOMServer.renderToString()
I'm using leaflet and react-leaflet libraries to create a map inside a React Js app as well as Material UI library for the core UI components.
I'm creating a custom cluster and marker components (...
0
votes
1
answer
131
views
The states is updating but not rendering
When I wanna click recover or deaths I want to change circle color. When I was consoled state value updated but circles color didn't change. Here are codes and pictures. I tried everything I know but ...
0
votes
1
answer
97
views
How to pass state down to child component's handler?
The GeoJson component has a function onEachFeature that calls a handler, in this case it is createPopup.
<GeoJSON data={covidGeoJSON} onEachFeature={createPopup}></GeoJSON>
Within the ...