Skip to main content

All Questions

Tagged with
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 ...
GentleCynic's user avatar
1 vote
1 answer
82 views

How to Get GeoJSON Feature on Map.Locate in React Leaflet

I am creating a map with imported GeoJSON data. I am trying to create a Find Me button that will zoom to the user's location and get a property associated with the enclosing region (as defined by the ...
isaa's user avatar
  • 11
0 votes
2 answers
279 views

Type Error Importing GeoJSON file in a Typescript React App

I am trying to import a GeoJSON file to map region in a Leaflet map using React-Leaflet. I started the project using create-react-app. However, when I try to use the data in the GeoJSON component, I ...
isaa's user avatar
  • 11
1 vote
0 answers
506 views

Draw polygon from API Data using React-leaflet and click event

I'm using react-leaflet and Geoman, to draw polygons on the map, I have an API that provides me with a GeoJSON. I can draw the shapes easily using const polygon = L.polygon(props.coordinates).addTo(...
talison Brendon's user avatar
0 votes
0 answers
152 views

GeoJson data is not being rendered over the react-leaflet map, when another shapefile is clicked

import React, { useState, useEffect, useRef } from "react"; import { MapContainer, TileLayer, GeoJSON } from "react-leaflet"; import "leaflet/dist/leaflet.css"; import ...
MUHAMMAD ARSLAN's user avatar
1 vote
3 answers
968 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
1 answer
1k views

How to refactor React Leaflet GeoJSON component to use the useMap function with Next.js?

I'm working on a React-Leaflet application using Next.js and I'm struggling to refactor my GeoJSON component to be able to implement a 'zoom to feature' event using the useMap function. The React-...
nizz0k's user avatar
  • 511
0 votes
1 answer
301 views

Use client side data fetching or getStaticProps for Leaflet layer component for SSG map with Next.js?

So, I'm trying to build a Next.js app to make a static site with a Leaflet map on it and I'm struggling conceptually with how to pull my location data into the components that will make up the Map. I'...
nizz0k's user avatar
  • 511
0 votes
2 answers
487 views

react-leaflet <GeoJSON /> pointToLayer option to change

I am learning react leaflet and trying to add circle marker on each point of geojson. Makers are not showing on map. import React from 'react'; import Tiles from "./Tiles"; import L from '...
hamza ahmed's user avatar
2 votes
0 answers
269 views

how to change color on Mouse over leaflet-react?

i'm facing a problem of mouseover event in leaflet the thing is , when i hover ,the weight of the city changes for 2s and it doesn't stay highlighted even though the mouse is over the city here is my ...
sarah Chettouh's user avatar
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 ...
alirezafarin's user avatar
0 votes
0 answers
318 views

Can't display only one country with GeoJSON - React.js Leaflet

I use React-Leaflet and want to show only country one country . I got geoJSON of country and gave style to it but other countries keep showing. How may I hide or delete other countries ? function ...
Fatih Can's user avatar
  • 439
0 votes
2 answers
1k views

React-leaflet performance issue, prevent GeoJSON re-render

I have the following issue: I would like to create a simple choropleth map using react-leaflet's GeoJSON component. I also want to have a tooltip that shows a value on hover over a GeoJSON feature. ...
Imre Tömösvári's user avatar
0 votes
1 answer
2k views

Leaflet: Change color onClick

I am trying to change the color of my GeoJSON-Layer on every click in my Ionic React App, but I only managed to change it once for the first click... My idea was to change the color between blue and ...
jonsken's user avatar
  • 115
1 vote
1 answer
5k views

How to render geojson polygon in React leaflet MapContainer?

Stack : Reactjs, Leafletjs, EsriLeafletjs I am trying to display one Polygon in GeoJson on a leaflet map container. My main issue is when I use Leaflet.geoJson(data) it return invalid JSON object. ...
Umair Asghar's user avatar

15 30 50 per page