OpenCageData / leaflet-opencage-geocoding

A Leaflet geocoding control that uses the OpenCage geocoding API
BSD 2-Clause "Simplified" License
22 stars 11 forks source link

Broken due to results without 'bounds' #2

Closed harry-wood closed 9 years ago

harry-wood commented 9 years ago

The demo here is broken: http://geocoder.opencagedata.com/code/leaflet-demo.html ...for the majority of searches I'm testing with. e.g. just searching for "Oxford"

I dug into the reason. It's because some search results in the API response array do not have 'bounds' e.g. "Oxford, Roger Dudon Way" is coming through without this field.

I don't know if that is a new bug in your main API, or maybe this javascript should tolerate missing bounds. If it's the latter, then I have the fix

mtmail commented 9 years ago

You're absolutely right. "out of the box" the plugin often didn't work :( The new released version 1.1.0 fixed it http://opencagedata.github.io/leaflet-opencage-search/