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.

Geocoding fails when searchBounds are already in L.latLngBounds format

See original GitHub issue

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 geocoder results in the following error with stack trace: image

The bounds come in formatted as L.latLngBounds but are transformed with the expectation that they’re latLngs, which results in an empty L.latLngBounds object. A class check for latLngBounds before transforming it/or not would probably do it.

Assuming you don’t want search bounds on the geocode search, this error can be avoided by setting the geocoder option { searchBounds: false } https://github.com/Esri/esri-leaflet-geocoder/pull/115

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fungjj92commented, Nov 27, 2018

I’m fine with closing this issue since it looks like it is not easily reproduced and we came to a good workaround. Thanks again for your attention!

1reaction
jgravoiscommented, Nov 22, 2018

I wonder if it makes a difference that I am using react-leaflet.

it doesn’t appear to. i can’t see the problem you reported in the app below and its virtually identical to what you shared in your snippet.

https://github.com/kboul/react-esri-leaflet-geosearch

i’m happy to investigate further, but only with a repro case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

L.esri.Geocoding.Geosearch | Esri Leaflet - ArcGIS Developers
If an integer (like 11 ) is passed, the geocoder will use the bounds of the map for searching only if the map...
Read more >
google geocoding api - R error - subscript out of bounds
I am trying to run this code which takes a list of addresses and runs each one through Google's Geocode API (using function...
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 >
Testing Nominatim Geocoder with Leaflet.js
I recently wrote a post about the Esri Geocoding plugin for the Leaflet.js web ... var searchBounds = L.latLngBounds([36.548091,-82.576010] ...
Read more >
L.LatLngBounds - WRLD3D
All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above...
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