Skip to main content

All Questions

0 votes
0 answers
369 views

Marker position on the map Leaflet

I have a custom map created using the Leaflet library. And also the Marker component. When I place a marker with a value of 100 on the Y-axis, the marker is at the top of the map, but when I place a ...
Dmitriy's user avatar
  • 35
2 votes
0 answers
51 views

how to clear state after select menu option changes

So I have the sandbox of code right now which is plotting polyline data based on the option selected the issue is right now from the code i have provided if you run the first one initially then ...
program.exe's user avatar
2 votes
2 answers
2k views

Fit the map view of an Image Overlay to the size of the container Leaflet

I am using React Leaflet to create a custom map. The card (Image Overlay) is currently being rendered, but it does not fill the container in which the card is placed. The size of the container is set ...
Dmitriy's user avatar
  • 35
0 votes
1 answer
296 views

Leaflet issue related to svg layer ordering

In my leaflet application I am using both canvas and svg renderers. Canvas renderer is used for markers and svg for polygon. But because of this i am unable to order the svg rendered polygon layers ...
Ravi's user avatar
  • 3
1 vote
2 answers
862 views

Triggering Geoman event with custom button

In my React app, I'm using Geoman on a Leaflet map with several Geoman tools. Currently, I have an event listener that verify which tool is used and chose the right function to fire when the user has ...
FE-P's user avatar
  • 89
1 vote
3 answers
978 views

React Leaflet Geojson Tooltip. How to disable black borders on click or dragging?

I have problems with the library Leaflet. I have big JSON data, which renders and shows the borders of different districts. I add a tooltip in my GeoJSon, it shows the name of this district. But when ...
Ilya Babikov's user avatar
0 votes
0 answers
52 views

Extract more objects from an array stored in a state

import "./App.css"; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet"; import { useEffect, useState } from "react"; import * as L from "leaflet&...
Brede's user avatar
  • 21
0 votes
0 answers
336 views

React-leaflet i cant use styled components in divicon

I need to use styled component for leaflet marker I try the code below but it returns [object Object] as marker icon. How can i solve this? I tried lots of things but i cant use components for react-...
Eren Talan's user avatar
2 votes
1 answer
630 views

Leaftlet react javascript. use state to zoom in on map

I'm completely new to programming and leaflet and now I'm stuck. my code: import "./App.css"; import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet"; import { ...
Brede's user avatar
  • 21
2 votes
1 answer
191 views

Adding array from async function into leaflet react not working

I currently have an asynchornous function that fetches from https://www.overpass-api.de/api/interpreter? and prints exactly what I need: async function callRelation(id) { const api = await fetch(&...
rodd7's user avatar
  • 53
2 votes
2 answers
400 views

How to add multiple Leaflet map on the same page?

I want to add multiple Leaflet map with different content on the same page but it gives me the error: Map container is already initialized. I'm initializing the map in a useEffect: useEffect(() =&...
user avatar
0 votes
2 answers
304 views

React-Leaflet LocateControl component - keeps duplicating on each refresh

I'm using Locate Control in React Leaflet, but the Locate Control buttons are always duplicated, and sometimes I get 3 or 4 of them (see image below). I'm running the function through a useEffect with ...
andy spears's user avatar
0 votes
0 answers
184 views

How to stop leaflet popup closing (x) button redirecting to (href= /#close),is there any way

my react app has leaflet map and it has popup as well at the top of the popup has x button clicking on it app redirect to the /#close i don't want this to happen, how to stop this, my leaflet v - 1.7....
Sammith Gowda's user avatar
0 votes
0 answers
234 views

Use Ordinance Survey Map Tiles in React Leaflet

I'm working on a project which requires detailed maps of rural areas. I'm currently using the default leaflet map as a placeholder but I'd really like to start using the Ordinance Survey (OS) map API....
React Beginner's user avatar
0 votes
1 answer
426 views

CRA & React Leaflet : Module parse failed: Unexpected token

I am attempting to use React Leaflet with a Create-React-App and I am getting the following error when I try to do: const center = [51.505, -0.09]; const polyline = [ [51.505, -0.09], ...
N P's user avatar
  • 2,519

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