All Questions
1,098
questions
4
votes
2
answers
6k
views
Auto open markers popup on react-leaflet map
I use some markers on react-leaflet map to show various text.
But I can not find a flag for the autoOpen tooltip.
I get (position, children, onOpen, onClose) as available attributes.
render() {
...
4
votes
1
answer
1k
views
TileLayer displays in different order (Using React-Leaflet library)
I'm trying to do a simple Web App using the library react-leaflet.
I have the following code:
import React from 'react';
import { Map, Marker, Popup, TileLayer } from 'react-leaflet';
class ...
4
votes
1
answer
4k
views
How to use leaflet-polylinedecorator in react 16.4.1
I'm trying to use the leaflet plugin polylinedecorator in react 16.4.1 (so without hooks). However, the only example I have been able to find on how to use this plugin in react is using hooks (see: ...
4
votes
1
answer
7k
views
How to retrieve a place's address when I know latitude & longitude in React-Leaflet using leaflet-control-geocoder?
I know LatLng, but I would like to retrieve the address similar to the library following link: https://github.com/perliedman/leaflet-control-geocoder, but I don't know how to use this library for ...
4
votes
2
answers
2k
views
Leaflet ReactJS Map does not show tile completely
I'm trying to create a map that is inside of a modal. But the map is only showed partially. I've tried invalidatingSize() after node is created but it doesn't seem to work.
import React from 'react';
...
4
votes
1
answer
4k
views
I can't get esri-leaflet to work with ReactJS --> basemapLayer of undefined
After npm installing esri-leaflet, and leaflet packages, I get the following error
This is my maps component:
import React from 'react'
import ReactDOM , {render} from 'react-don'
import L from '...
4
votes
2
answers
7k
views
React-leaflet: how to update marker positions?
I can't understand how to update my markers correctly using react-leaflet. Using this example:
import React from 'react';
import { render } from 'react-dom';
import { connect } from 'react-redux';
...
4
votes
1
answer
736
views
Adding a Link as a child of a Router with ReactDOM.render yields "You should not use <Link> outside a <Router>"
I am looking for a way to use ReactDOM.render to create a Link within a react router. The setup more or less looks like this:
const router = (
<div>
<Router>
<Route path="/...
4
votes
1
answer
2k
views
Use leaflet plugins in react leaflet
Leaflet library has many plugins:
https://leafletjs.com/plugins.html
Now I looked at react leaflet library: https://react-leaflet.js.org/
But I can't find in its documentation explanation how to use ...
4
votes
1
answer
5k
views
How to dynamically move and rotate marker in react-leaflet?
I have wrote a React project with react-leaflet and hook. My goal is to move and rotate marker every second. However, moving part is working fine. But the rotation of marker is not working. I am ...
4
votes
2
answers
5k
views
React Leaflet display legend using MapContainer
I'm using React leaflet 3.1.0 and I want to display a legend in the map.
I built a component for the legend and pass map instance that I get from MapContainer whenCreated({setMap}).
Map Component:
...
4
votes
2
answers
2k
views
Obtain a segment of Polyline which was clicked
In my app I have:
<MapContainer {...opts} scrollWheelZoom>
<>..</>
<Polyline eventHandlers={{ click: e => { console.log('line clicked', e.sourceTarget) }, }} positions={...
4
votes
1
answer
8k
views
React, Leaflet - Hooks, setView, and useRef
Can someone help me sort out the correct method for using hooks to update the view parameter?
Currently, using React and Leaflet, I am creating a simple map:
import React, { useState, useEffect, ...
4
votes
3
answers
5k
views
React Leaflet - Align Popup on the center of the map
If I click on a marker I want to pan the map view to the center of the marker. So far this works on my project. Furthermore I want the opened popup to be aligned on the center of the map view.
I ...
4
votes
3
answers
12k
views
Creating a custom Leaflet layer control in React
I'm attempting to completely recreate or reorganize the functionality of the LayersControl component in its own separate panel using react-leaflet.
I have several filtered into their own and it ...