-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Marker doesn't show up when result has bbox property #129
Comments
I think it's a backward compatibility thing, but all search results have a geometry of Once Mapzen Search started returning |
hi @louh! is there a way to force markers to display for all locations, including large areas / locations w/ bbox attribute? i am finding that certain locations are erroneously given the bbox property (i.e. a bagel shop in my neighborhood) — when some restaurants show up with markers and others don't, the performance feels inconsistent — i'd rather have everything show up with a marker (even if the marker might feel a bit arbitrary for larger areas). |
Hi @hjmccain, we haven't revisited this issue, so there's currently no option to force markers to display for all locations regardless of bbox. But here's one strategy to manually add a marker with some additional code: // Assign your geocoder instance to a variable
var geocoder = new L.Control.Geocoder('<your-api-key>');
// Listen for selections
geocoder.on('select', function (event) {
// If the feature has a bbox, it probably only got the bbox, so add a marker
if (event.feature.bbox) {
geocoder.showMarker(event.feature.properties.label, event.latlng);
}
}); I haven't tested this, but I believe this should work. The one caveat I can think of is that this doesn't automatically drop markers if you use the up/down arrow keys through the result list, but only activates when a result is selected by clicking on it or pressing Enter on it. |
New things to try:
Acceptance test cases:
|
We're implementing this as of f5de53b.
This will be released in 1.8.0. |
Point
example one : https://search.mapzen.com/v1/autocomplete?text=tisch%20school%20of%20the&focus.point.lat=40.721502075213955&focus.point.lon=-74.00527954101564&api_key=search-MKZrG6M
(this doesn't show a marker)
The text was updated successfully, but these errors were encountered: