Skip to main content

All Questions

Tagged with
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() { ...
Stevan Tosic's user avatar
  • 7,029
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 ...
Javier Muñoz's user avatar
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: ...
Emmy's user avatar
  • 3,693
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 ...
Alexey Menog's user avatar
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'; ...
Antonio682's user avatar
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 '...
securecurve's user avatar
  • 5,749
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'; ...
Pedro Brost's user avatar
  • 1,442
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="/...
Timothy Dalton's user avatar
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 ...
user avatar
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 ...
manjurul Islam's user avatar
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: ...
PauCasademont's user avatar
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={...
injecteer's user avatar
  • 20.5k
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, ...
Ax0n's user avatar
  • 524
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 ...
MarcoLe's user avatar
  • 2,469
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 ...
geeberry's user avatar
  • 655

15 30 50 per page
1
3 4
5
6 7
74