question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Results with undefined latlng and bounds returned by L.esri.Geocoding.geosearch when using searchBounds

See original GitHub issue

Describe 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

  1. Go to https://jsfiddle.net/andywalz/s9pqkh16/5/

  2. Search for “Park Bench Cafe” for example

  3. Click on image

  4. Nothing happens.

  5. 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:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jwasilgeocommented, Jul 14, 2021

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.

0reactions
gavinrcommented, Jul 20, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found