All Questions
408
questions with no upvoted or accepted answers
9
votes
1
answer
5k
views
componentDidUpdate prevProps gives me current / new props
I'm trying to integrate a leaflet map but I think that is not the problem here. Anyway to re-render my map I want to use componentDidUpdate to see if the props changed I pass down to my map component ...
7
votes
0
answers
3k
views
React Leaflet.draw: How to create draw functions with standard buttons without using the react-leaflet toolbar, however, have it written in "React"
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 ...
6
votes
0
answers
2k
views
Leaflet map with react-leaflet-markercluster cluster spiderfy's or closes onClick
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 ...
5
votes
1
answer
442
views
How to make marker appear on the surface of image overlay onclicked in react-leaflet?
I am using React leaflet together with custom CRS, Leaflet CRS docs
What I want to do is:
A custom image is display at the map container as ImageOverlay
When user clicked on a position on the Image, ...
5
votes
0
answers
3k
views
Testing mapbox-gl map fails in test because theres no WebGL
I use mapbox-gl, specifically mapbox-gl-leaflet, in React to create a map:
import Leaflet from 'leaflet'
import 'mapbox-gl/dist/mapbox-gl.css'
import {} from 'mapbox-gl-leaflet'
import 'leaflet/dist/...
5
votes
0
answers
387
views
Rendering Component as Leaflet Marker using renderToString loses theme
We have a react project that uses styled components, with a ThemeProvider providing a theme object that all of the components should be able to reference. In this project, we have a leaflet map, and ...
4
votes
0
answers
3k
views
leaflet map shows grey areas
I'm trying to use leaflet map inside my react js project with https://leafletjs.com/examples/quick-start/.
everything works great except for the map which shows grey areas:
PlaceCard.js:
import { Map,...
4
votes
0
answers
1k
views
React leaflet WMSTileLayer with custom request headers
I am trying to send authentication header with my wms tile requests.
When I used pure leaflet library it was very simple using leaflet-wms-header
But, I have switched to react-leaflet and it has its ...
3
votes
0
answers
230
views
Use GeoJson data with Leaflet.PixiOverlay
I am using Leaflet.PixiOverlay(this package) in my App in order to render a big number of data(suck as markers, shapes, geoJson data, etc) without performance issues.
But the documentation of this ...
3
votes
1
answer
389
views
Assigning a type to the leaflet-search plugin in React and Typescript
I have the following problem: In my project, I installed the leaflet lib to present maps with images (floor plans of buildings) and each map has a Point, which is a GeoJson Point that symbolizes the ...
3
votes
0
answers
254
views
leafletjs @react-leaflet/core/esm/path.js
Hi im trying to use leaflet in a project. But when i executed the result is:
./node_modules/@react-leaflet/core/esm/path.js 10:41
Module parse failed: Unexpected token (10:41)
File was processed with ...
3
votes
0
answers
1k
views
Is there a way to center text inside a polygon in Leaflet?
I have GeoJSON that has names and polygons for every country in the world. I have successfully rendered polygons (which is basically world map) but I don't know how to show names of countries inside ...
3
votes
1
answer
6k
views
Importing GeoJSON file to React-Leaflet
I'm trying to import a GeoJSON file to react-leaflet like below:
import * as bar from "./data/bar.geojson";
...
function Foo() {
return (
<Map center={[...]} zoom={...}>
<...
3
votes
1
answer
1k
views
OnClick not working when rendering React button on a custom dialog
I am a little bit lost hope someone with JS knowledge could help.
I am using this dialog: https://github.com/NBTSolutions/Leaflet.Dialog, on a leaflet map.
It is nothing much just opens a dialog on ...
3
votes
1
answer
1k
views
How to use react-leaflet on Nextjs?
Ok guys I'm trying to use Leaflet map on Nextjs but I get a window is not defined error
I saw a few posts about this issue on stackoverflow but none of them solved my problem.
Map component
import { ...