Results with undefined latlng and bounds returned by L.esri.Geocoding.geosearch when using searchBounds
See original GitHub issueDescribe the bug
When using L.esri.Geocoding.geosearch with searchBounds defined I’m getting a number of results outside of bounding box, returned without latlng/bounds, that when clicked do nothing.
Expected behavior
- I would expect these results not to appear as they are outside the bounding box.
Actual behavior
- There are no errors in the console.
To Reproduce
-
Search for “Park Bench Cafe” for example
-
Click on
-
Nothing happens.
-
Set
searchBounds
to false and “Park Bench Cafe” works as expected
Environment Information
- Version of Leaflet (
L.version
): 1.7.1 - Version of Esri Leaflet (
L.esri.VERSION
): 3.0.2 - Your OS: macOS 11.4
- Browser and Version: Version 91.0.4472.114 (Official Build) (x86_64)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Geocoding fails when searchBounds are already in L ... - GitHub
Hi I am building a React app that uses React-leaflet, esri-leaflet-geocoder. Zooming into the map to 12+ and then typing the ESRI ......
Read more >L.esri.Geocoding.Geosearch | Esri Leaflet - ArcGIS Developers
Determines if and when the geocoder should use the bounds of the map to filter search results. If true the geocoder will always...
Read more >Esri-leaflet-geocoder: Component not rendering
This is working for me: import * as ELG from "esri-leaflet-geocoder"; var searchControl = ELG.geosearch({ useMapBounds: false, ...
Read more >Esri Leaflet Geocoder Crash Course - LinkedIn
The search bounds are a L. latLngBounds object that allows you to limit the searching within latitude/longitude bounds.
Read more >Download Patch File - maps - Greater London Authority
L.esri)); -}(this, function (exports,L,esriLeaflet) { 'use strict'; - - L ... bounds, - score: candidate.score, - latlng: L.latLng(candidate.location.y, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, upon looking into this a bit more, there is something going on with the source code here in esri-leaflet-geocoder with how the search extent is managed in the /suggest call versus the /findAddressCandidates call.
Here, only for the /suggest, there is a
0.5
padding being applied to the search extent: https://github.com/Esri/esri-leaflet-geocoder/blob/master/src/Tasks/Suggest.js#L31.We can see that in the separate network requests the /suggest call has a larger
searchExtent
than originally defined in your code example, which incorrectly includes “park bench cafe”. We’ll continue to investigate.This was released in v3.1.0 https://github.com/Esri/esri-leaflet-geocoder/releases/tag/v3.1.0