Closed johntyree closed 4 years ago
This seems to have something to do with the provider. Can you check if the search query that doesn't work, even returns a geometry?
It looks like it?
$ curl -sL 'https://nominatim.openstreetmap.org/search?format=json&q=1600%20amphitheatre%20parkway' | python -m json.tool
[
{
"boundingbox": [
"37.4217136",
"37.4218136",
"-122.084664",
"-122.084564"
],
"class": "office",
"display_name": "Google Headquarters, 1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA",
"importance": 0.31100000000000005,
"lat": "37.4217636",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"lon": "-122.084614",
"osm_id": 2192620021,
"osm_type": "node",
"place_id": 22513380,
"type": "commercial"
},
{
"boundingbox": [
"37.4221124",
"37.4228508",
"-122.0859868",
"-122.0851511"
],
"class": "building",
"display_name": "Google Building 41, 1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA",
"importance": 0.31100000000000005,
"lat": "37.42248575",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
"lon": "-122.085584566136",
"osm_id": 23733659,
"osm_type": "way",
"place_id": 80280201,
"type": "yes"
}
]
Thanks. I got it.
Steps to reproduce:
1. Search for: 1600 amphitheatre parkway
-> Provider runs first query for
1600 amphitheatre parkway
-> API returns suggestions:
1. Google Headquarters, 1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA
2. Google Building 41, 1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA
2. Select first suggestion:
-> Provider runs a second query for
1. Google Headquarters, 1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA
-> API returns empty result.
Labeled as enhancement and not as bug, as we might fix this by removing the second query. This however needs some thorough testing.
I don't see it as a bug for leaflet-geosearch
, as it's strange that openstreetmap provides us a result, but doesn't recognize it when we search for that exact phrase.
That is strange. Do you happen to know the right place to file a bug upstream? leaflet-geosearch
is not the right place to fix this.
Based on the discussion above, I'm closing this one in favor of #180.
E.g. type
1600 amphitheatre parkway
and it will (correctly) suggestGoogle Headquarters, 1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA
, but if you click it, it fails to move the map. If you remove theGoogle Headquarters
prefix, it works. So1600, Amphitheatre Parkway, Mountain View, Santa Clara County, California, 94043, USA
is fine.Same thing happens if you search for
noisebridge
and chooseNoisebridge, 2261, Mission Street, Mission District, San Francisco, San Francisco City and County, California, 94110, USA
from the results. Removing "Noisebridge" works, so2261, Mission Street, Mission District, San Francisco, San Francisco City and County, California, 94110, USA
is fine.The real problem is that it doesn't output any kind of error or give you any clue that you need to modify the address to get the search to work correctly.