Questions tagged [react-leaflet-search]

12 questions
4
votes
1 answer

How to use maps as location input in react?

I am trying to make a form that a user can search their location or pin his location. I am using react-leaflet for loading a map and react-leaflet-search for adding the search functionality. The search functionality is working fine. Below you can…
Ritesh Jung Thapa
  • 1,177
  • 2
  • 13
  • 20
3
votes
4 answers

How to resolve "React Hook useEffect has a missing dependency: 'currentPosition'"

When I include currentPosition in the useEffect dependency array or when I delete it, the code turns into an infinite loop. Why? I have the same problem with map but when I place map in the dependency array it's ok. import { useState, useEffect }…
2
votes
1 answer

problem when i install react-leaflet-search

i have a problem when i try to install react-leaflet-search i had this error npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: map-leaflet@0.1.0 npm ERR! Found: react@17.0.2 npm ERR!…
2
votes
1 answer

Leaflet and Leaflet-search: resetStyle does not work to clear highlights on a map, and appears to be "not a function"

I am creating a map for scientific data found in certain locations. I have created independent geoJSON files (polygons) and variables for each location and loaded them into my leaflet map, as I would like to independently attach graphs into the…
meister
  • 37
  • 3
1
vote
1 answer

How to implement autocomplet place search box with Leaflet API

I would like to ask you how to implement just search box function from leaflet-search plugin and just for two countries. I want to make input field for location inserting with function of autocomplete. I tried to implement search box with map first,…
Dump
  • 237
  • 1
  • 12
1
vote
0 answers

How to add a button to the left of the geo search in react-leaflet React JS?

I want to ask how to make UI button on left of geosearch, what are you using in ReactJS? and I use the reactjs map flyer and on the button later you can select all, Menu1 or Menu2 on the menu button. And I'll attach an example of the UI and coding…
0
votes
0 answers

regarding react-leaflet,GeoSearchControl, OpenStreetMapProvider, flytomap

React Leflet flyto.map fumction is not working in react-leaflet version 4.1.0. it is only working version upto 3.2.5. is there a new function for new react-leaflet version 4.1.0? function FlyToButton() { const onClick = () => { …
0
votes
1 answer

react-leaflet, how I can search exact marker by marker id in react-leaflet?

I want to search exact marker using marker key or id in react-leaflet? is it posible? can someone help me. i am new for react-leaflet I added some markers on my map. now i want to add search bar and i need to find exact marker using marker…
0
votes
0 answers

How to create BasemapGallery in React-Leaflet - ReactJS?

I'd like to ask if I'm using the map from React Leaflet (https://react-leaflet.js.org/) but how do I add the Base Map Gallery button to the map? like this example Basemap Gallery button on the image that I marked with red arrow and do I need to…
0
votes
2 answers

Markkers are displayed twice with Leaflet search

I've made a map, based on a geojson file and with clustered markers. Then I tried to add the leaflet-search plugin. The search feature works : when I search somtehing, it opens the good popup (informations are generated by "complex" routines). But…
OldPoorDev
  • 13
  • 1
  • 5
0
votes
1 answer

Leaflet-search custom result marker

I use leaflet search control and i hide all the points in geojson layer(i set them to transparent and i reduce marker size). Then in leaflet-search.js i add custom marker to put on the map when location is found : Line 89(…
0
votes
2 answers

react-leaflet-search component not rendering

When I am trying to render react-leaflet-search, I get an error. When I am trying to use the solution for that error, react is compiling but component does not seem to be rendering. I tried their example simple search. Getting the same error…