react-leaflet Questions

2

I am trying to extend the TileLayer component in 'react-leaflet' v3. It is necessary to override this function to provide custom tile URL naming scheme. An example of what I need, written in basic ...
Vanadous asked 11/1, 2021 at 8:55

1

Solved

The old way of doing things in react-leaflet 2.8.0 was to use MapLayer and withLeaflet. But now in react-leaflet: MapLayer and withLeaflet are deprecated as of version 3. I'm trying to grasp the ...

3

Solved

I have been using the react-leaflet library, so far it worked well. Now I wanted the site to pre-load as much of the tiles as possible so that the web-app(also a PWA) could be used w/o internet. ...
Stacistacia asked 15/10, 2018 at 5:47

1

Solved

My code is here: https://github.com/AlonaVa/NewRestaurants Function UpdateBounds doesn't work properly: const [bbox, setBbox] = useState(null); function UpdateBounds () { const map = useMapEvent (...
Technology asked 10/3, 2021 at 9:44

1

Solved

My code is here: import React, { useState, useEffect, useRef } from 'react'; import restaurantsInfo from "./RestaurantsList.json"; import "./App.css"; import { MapContainer, Mar...
Waltman asked 6/3, 2021 at 18:23

1

Solved

I need to locate react-leaflet map to user's current position and get the borders for this map. I tried to apply the following code, but faced the error: TypeError: Cannot read property 'locate' o...
Limnology asked 5/3, 2021 at 22:1

3

I want to make an ellipse in react-leaflet. And I have checked the question How can one make an ellipse in react-leaflet? When I make a file like "ellipse.js" and paste the code in the file, it s...
Proceed asked 12/3, 2019 at 17:41

2

Solved

I tried everything I found on google and I can't figure out how to trigger the popup. <Marker position={this.props.position} onMouseOver={() => { openPopup() }} onMouseOut={() => { cl...
Nordic asked 2/8, 2018 at 21:3

3

Solved

There's a new react-leaflet version coming which can be found here: npm install react-leaflet/next docs: https://react-leaflet-v3.now.sh/docs/start-introduction which is a complete re write using h...
Comforter asked 17/7, 2020 at 4:31

1

I am new in react-leaflet. So in this below code, I didn't find where the problem is. why the color and fillColor property is not updating in <Circle /> Component from react-leaflet.But when ...
Lunt asked 2/12, 2020 at 19:59

1

Solved

I am using react leaflet to interact with leaflet map. Now I want to use a leaflet plugin called leaflet-area-select to select an area on the map and get current long lat of the rectangle selected....
Mcnamara asked 11/12, 2020 at 12:50

0

Code: import { withLeaflet} from "react-leaflet"; I just want to import the withLeaflet but it gives me this error Error: Attempted import error: 'withLeaflet' is not exported from 'rea...
Dendroid asked 23/11, 2020 at 16:5

3

Solved

I would like to add the module "React-leaflet-locate-control" on Map. Unfortunately, I have this error "TypeError: Cannot read property 'addLayer' of undefined" and I don't know how to correct this...
Philpot asked 8/1, 2019 at 21:21

1

I am trying to test something with react leaflet. I am displaying 2 different machines on map and when i click a specific list button(distinguished by machine id), it moves the center of the map to...
Asper asked 15/6, 2020 at 6:53

1

I have a fairly simple application that renders around 3000 points using leaflet.js. It renders fairly quickly but pan and zoom are terribly slow. Looking at the performance tools in chrome, it lo...
Dissonancy asked 5/5, 2020 at 17:33

3

I have a dataset of 4360 geomarkers that I want to display on the Leaflet map. CircleMarker works just fine and the performance of the constructed map is ok. However, constructing the map takes too...
Ochre asked 3/10, 2018 at 5:36

3

Solved

I'm writing a custom component for react-leaflet. It is an editable popup, with a few other features. Here is a codesandbox for an example.. The source code for the component is here. This example ...
Immixture asked 8/1, 2020 at 7:56

1

Solved

I am trying to render custom react component in react-leaflet GeoJSON onEachFeature popup, e.g. to fire modal with all corresponding feature.properties. In a popup react-leaflet component it works ...
Kipkipling asked 14/3, 2020 at 13:34

0

I have a Leaflet map in React using react-leaflet and react-leaflet-markercluster Clustering seems to work beautifully, but if I click on one of the cluster CircleMarker or Tooltip it opens a new ...
Sphygmomanometer asked 8/3, 2020 at 18:36

1

I am using React v.16.12.0 and @MaterialUI/core v4.8.1. I am trying to create custom icon for React Leaflet Marker. The icon is a Fab component from Material-UI. To do that, I need to pass a HTML ...
Flabbergast asked 25/12, 2019 at 16:53

2

Solved

I'm trying to get a basic map working using react-leaflet.js. Here's my code: import React from 'react'; import { Map } from 'leaflet'; const mapStyle = { height: '400px' }; const mapCenter = ...
Bobbinet asked 22/11, 2018 at 14:7

2

Solved

I'm trying to get a reference to the leaflet object using the hook, so I can query the new map boundaries on different events (like Map.getBoundaries()). I'm pretty new to reac-leaflet, and this ap...
Glacialist asked 28/7, 2019 at 10:55

2

Solved

I have a list, and through clicking on the list Elements, I want to open the pop up on the marker. Currently, the pop up only opens when the marker is clicked. This is how I create the marker and ...
Harvison asked 17/6, 2019 at 14:20

0

how can I create custom buttons that reside on a leaflet map in a separate control box to create "Polylines", "Polygons" or a "Marker" which will all be on separate bu...

2

I'm using the following code to create a rectangle in the leaflet map. const rectangles = [[51.49, -0.08], [51.5, -0.06]] <Rectangle key={key} bounds={rectangle} color="green"> </Rect...
Soave asked 14/6, 2018 at 11:11

© 2022 - 2024 — McMap. All rights reserved.