All Questions
1,096
questions
0
votes
1
answer
17
views
React-Leaflet how to make circle change size relative to zoom
In React-Leaflet I put a L.circleMarker in some coordinate and and gave it some radius. when I zoom in the radius size shrinks, but I want it to grow bigger. for example if I drew a circle around New-...
0
votes
0
answers
24
views
Refused to load the image because it violates the following Content Security Policy directive: "default-src 'self' 'unsafe-inline' data:"
I'm building an application that uses Electron Forge, React and Leaflet to display maps. However, when adding a map to my page, the following error is displayed in the console:
Refused to load the ...
0
votes
0
answers
47
views
How can I improve React Leaflet performance when rapidly updating a marker position?
I'm working on a page which reads GPX files (a series of lat/lon GPS points) and plots the route using React Leaflet as well as showing an elevation profile using react-chartjs-2.
When hovering over ...
0
votes
0
answers
32
views
How to get rid of React Leaftlet map gray area while scrolling vertically
Hey guys I have use React Leafnet in my web app, everything seems working fine when I scroll map horizontally it loads new map images nicely but when I scroll map vertically, than after some position ...
0
votes
0
answers
30
views
How to dynamically use fallback tiles from the previous zoom level of the same server in Leaflet?
I'm working on a mapping application using React with Leaflet for tile rendering. When tiles fail to load (due to network issues, server downtime, tiles not available), I want to dynamically use ...
0
votes
0
answers
21
views
React Leaflet Marker Change Rerenders Every Other Marker Causing Performance Issues
I'm trying to build a quick leaflet map akin to Apartments.com. It's a map with a bunch of markers (up to 2000 in my case) and it will have a sidebar with more in-depth details about the markers that ...
0
votes
1
answer
50
views
Leaftlet divIcon with clickable button
I'm working on leaflet and I wanted to add click event for a icon in the custom divIcon as below,
If user clicks on the edit(pencile) icon then click event should trigger,
Here is the code I'm ...
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
34
views
GeoJSON component not updating with state
I am having the following problem: although the filteredData is being updated, the Map doesnt reflect it.
This is the relevant code for my HOC (which contians the Map component):
const ...
0
votes
0
answers
16
views
Deployment error for Importing/exporting DomUtil
Failed to compile
⨯ ./node_modules/@react-leaflet/core/lib/dom.js
Attempted import error: 'DomUtil' is not exported from 'leaflet' (imported as 'DomUtil').
This error occurred during the build process ...
1
vote
2
answers
192
views
React Leaflet markers not rendering with location data fetched from an API using useEffect
I am trying to render leaflet markers using React Leaflet with data fetched from an API using useEffect. The markers are not showing up despite the location data being non-null at the time of ...
0
votes
1
answer
73
views
Hide rest of map around country with leaflet.js in next js
I need help please. I would like to hide the other maps and only show the one of Cameroon. I'm using Leaflet and I'm on Next.js to be able to display the map. I saw this page React-Leaflet 4 with ...
1
vote
0
answers
391
views
React leaflet. map is not showing
I have been trying to create a map section in my website for at least an hour now, but the react-leaflet or leaflet just won't work at all. I do every step that the doc says, I have watched a lot of ...
0
votes
1
answer
67
views
Next.js React-Leaflet bouncing marker using Leaflet.SmoothMarkerBouncing
I am new to the front-end development, I am trying to get bouncing marker in React-leaflet using
https://www.npmjs.com/package/leaflet.smooth_marker_bouncing/v/1.3.0?activeTab=explore
But I don't have ...
0
votes
0
answers
61
views
Leaflet Map Rendering Issue with Large Non-Geographical Map
I’m currently developing a non-geographical map for my website using React, tailwindCSS and react-leaflet. The map is square-shaped and quite large, with each side measuring 10 million pixels. The ...
0
votes
1
answer
87
views
react-leaflet-heatmap-layer-v3 src directory not found
Trying to use the npm library react-leaflet-heatmap-layer-v3 and after I install it successfully and then yarn start my react typescript app, I get the following warning messages:
WARNING in ./...
0
votes
0
answers
21
views
React with Leaflet: issue color coding map based on country specific data
Essentially, I would like to be able to click a country and see it's trade partners highlighted on the map. I know that I am reading the data corrrectly from the ISO3, and I am able to print it, I ...
0
votes
1
answer
59
views
Window not defined on build NextJS
I am getting a window not defined error? I do not call window or document anywhere in the code and it works fine in development just errors on build.
ReferenceError: window is not defined
at C:\...
-1
votes
1
answer
35
views
React re-renders everything
I have an array of markers on a map using leaflet. I want to be able to remove one of the markers, however when I update the array of markers, it re-renders ALL of the markers in the array as you ...
0
votes
1
answer
106
views
Getting the clicked marker in react leaflet
So I have my leaflet map in my react project, I have markers on this map and I want to get the marker clicked. I want to show this markers popUp info on a side panel. How would I get the marker ...
0
votes
0
answers
80
views
How to manage rendering 30000 polygons on map using react-leaflet?
Im using react-leaflet to render heatmap using big amount of polygons that I get from database. Polygons are preconfigured and I don't perform any actions on them. My issue is that when user wants to ...
0
votes
0
answers
18
views
how to do autosave on editvertex ? because i dont want user to save all the time when he/she edits
Just want to save the polygons even after not saving it , and i have hided the save and cancel button.
Im already rendering the polygons using my own state and im changing it on every vertex change ...
0
votes
1
answer
72
views
changing cluster's styles not working with lazy loading leaflet in SSR react application
I'm encountering some challenges with lazy loading a Leaflet map in a React application deployed on a server-side rendering (SSR) environment. The application involves loading a list of products in a ...
0
votes
1
answer
59
views
how to do it in openlayer like leaflet draw style editor
I have researched and searched many times and can't find examples of style editors on openlayers. Available only on leaflets. Please share your experience, how should I write it?
It's fine if you ...
0
votes
1
answer
100
views
React-leaflet flyto new position
I have a rather large application based on react and leaflet.
The problem is that I can't get the main map of the code to move to a new location, provided by the user in an input menu, when the menu ...
2
votes
1
answer
308
views
How to add react-leaflet map to remixjs app
I'm trying to add a react-leaflet map to a remix app. I created a simple app using the npx create-remix@latest command. I then added react-leaflet using the installation instructions. Now I have ...
1
vote
0
answers
28
views
How do I create a "double" line feature from GeoJSON data with React-Leaflet
I am using React Leaflet to plot a GeoJSON file with several LineString features. I can plot and style them using
<GeoJSON data={lines} style={onEachLineFeatureStyle}/>
where the ...
0
votes
0
answers
61
views
flyTo of react leaftlet working while setView is not react leaflet
I'm building this "Contacts" page that gets some locations from supabase displays them on the map and at the same time displays their information in a ul.
Now everytime the user clicks on a ...
0
votes
3
answers
141
views
Smooth scroll with react-leaflet
I'm trying to create a smooth zoom in my react-leaflet project.
I know that this is doable with vanilla leaflet as said in this post, with smoothWheelZoom, but knowing that vanilla leaflet does not ...
0
votes
0
answers
38
views
react-leaflet manage close popup on Child Component
I'm trying to make a react-leaflet popup everytime I click a link that changes the marker position in the child component, but it never closes de popup, here's what it looks like on the map component
...
0
votes
0
answers
12
views
how to push React Leaflet's attribution and map controls to the back [duplicate]
what i'm trying to do
the user sees a map, built in React Leaflet / Leaflet.JS. The user can then click a CTA button that pops up a modal. The modal should be the "top layer" of the screen, ...
0
votes
1
answer
64
views
React-leaflet ImageOverlay is not visible in exported PDF using jspdf
I'm using react-leaflet v4.2.1. I'm using it to display not a map but custom image like that
<MapContainer
center={[height / 2, width / 2]}
crs={crs}
bounds={bounds}
minZoom={-5}
...
0
votes
0
answers
72
views
Implement Map Tiler Temperature weather layer with leaflet and reactjs
I'm trying to make a temperature overlay on the map but getting an error:
object is not a layer
The desired outcome is as follows:
My Code:
import { useEffect, useContext } from 'react';
import L ...
0
votes
1
answer
116
views
want to show pin on leaflet map using react js
I am trying to create a map using React JS and a leaflet
but the problem is I am not able to map position on the map
here is my code
import React, { useState } from 'react';
import {
MapContainer,
...
0
votes
0
answers
109
views
React Leaflet map not Re-rendering
I'm encountering an issue with my React application where the Leaflet map component is not re-rendering even though the data it depends on has changed. Here's the structure of my code:
App.js
let [...
0
votes
0
answers
46
views
Error Adding Marker Clusters & County Boundaries to Leaflet Map
I am able to add all state boundaries to my leaflet map.
But if I try to add clusters I am getting the below error.
Error in /~/components/MapBoundaries.tsx (138:34)
map is not defined
Can you let me ...
0
votes
0
answers
58
views
How to Insert React Component Inside `leaflet-overlay-pane` using react-leaflet (core)?
I'm working on a project where I'm using react and react-leaflet to create a map application. I have a requirement to insert a custom React component, wrapped in a <div>, inside the leaflet-...
0
votes
0
answers
35
views
How to wrap the VideoOverlay component in react-leaflet with a div?
I'm currently working on integrating a video overlay onto a map using the react-leaflet library. I'm using the VideoOverlay component provided by react-leaflet to render the video onto the map ...
0
votes
0
answers
75
views
How to Implement Tile Caching for Leaflet in React?
I'm currently working on a project using React with Leaflet for mapping functionality. I've been exploring options to optimize performance, and one area I'm interested in is caching Leaflet tiles to ...
0
votes
1
answer
97
views
Why whenever i call MapContainer I always get "React-leaflet Error: Dispatcher is null"?
I am at my first experiments with React-Leaflet, so after installing everything i treid to add a simple map in my React App, but whenever i call MapContainer the only thing I obtain is this error log:
...
0
votes
0
answers
113
views
Create A Polar Coordinates Grid using react-leaflet
I am currently working on a react component that could potentially create a Polar coordinates grid.
In my React Project, i have to display on top of OSM (Open Street Map) two types of Grids (...
0
votes
1
answer
58
views
React Leaflet: Resize point marker not being dragged
A resizeable rectangle in place automatically on the map with some bounds.
when I drag the rectangle, it drags but the resizeable points is still on the same place.
Is there something i am missing ...
0
votes
0
answers
18
views
How to add the toolbar in leaflet [duplicate]
I want to add the leaflet toolbar like below in the MapContainer, would you please help ?
<MapContainer
id='mymap'
center={[65, 300]}
zoom={1}
zoomControl={true}
doubleClickZoom={false}
...
0
votes
0
answers
17
views
React Leaflet NextJS - interactive bug map (unsynchronized images) [duplicate]
I have a small problem, I use leaflet react, but I have this kind of rendering
The first zoom is perfect in itself (complete image, but weird contour), but as soon as I switch to Zoom 1, 2, 3..., I ...
0
votes
1
answer
106
views
Auto pan and update map position when data inside Popup changes
I have some dynamic data inside <Popup> that will change the Popup box size after opening. When you first click on the <Marker> it will update the content, position and adjust the pan of ...
0
votes
1
answer
79
views
React-Leaflet: updating a marker's position every second fetching the coordinates from an .env file
I'm running a simple react-lefleat map on small http server running on an Arduino board and I would like to update a marker's position (my position) according to the coordinates extraced by the ...
0
votes
1
answer
57
views
Leaflet mosaic TileLayer
I want to use leaflet reactjs and i want to do it on an image.
the prblm is that the image is shown as mosaic.
<div className="bg-white w-auto m-2 h-[calc(635px-10rem)] border-2 border-gray-...
0
votes
1
answer
106
views
React Leaflet Material UI divIcon not styled
In React Leaflet, I am trying to use divIcon to render a custom Material UI marker that takes in a background color prop. However, when the marker is used in leaflet, the background style is not ...
0
votes
0
answers
123
views
How to create satellite layer with labels using react-leaflet-google-layer
Trying to implement satellite view with labels on my react project using react-leaflet and react-leaflet-google-layer packages.
I can create satellite view but not able to add labels on map (city ...
0
votes
0
answers
120
views
Working example for Leaflet Geosearch in react
Excuse my ignorance, but being new to react and JS, I am getting irate trying to follow the docs for https://smeijer.github.io/leaflet-geosearch/ &
https://github.com/smeijer/leaflet-geosearch
I ...