You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a little jarring right now to select a search result, have the map fly to those coordinates, and not see anything on the map. It could be a good idea to add a marker to the map indicating the location of the feature that has been returned. We could enable this as an optional feature so those users who manage a custom display of the result could continue to do so.
I agree with making this optional, since some developers would be implementing this already and may like to continue to do so. However I see this as providing better defaults out of the box, so 👍
This was implemented in #219 and will the be default behavior once version 4 is released.
A key note about this change is that mapboxgl is now a peer dependency of this package. New mapbox-gl-geocoder instances should set mapboxgl in the constructor options.
If mapboxgl is not found in the constructor options, markers will not be added to the map and an error will be generated in the console, but the plugin will otherwise function as usual.
Activity
andrewharvey commentedon Mar 19, 2019
I agree with making this optional, since some developers would be implementing this already and may like to continue to do so. However I see this as providing better defaults out of the box, so 👍
andrewharvey commentedon Mar 20, 2019
We'll need to decide what to do with https://docs.mapbox.com/mapbox-gl-js/example/point-from-geocoder-result/ in light of this PR.
Update: ...just saw Updating the Set a point after geocode result to use the new built-in marker functionality in the gl-geocoder
scottsfarley93 commentedon Mar 27, 2019
This was implemented in #219 and will the be default behavior once version 4 is released.
A key note about this change is that
mapboxglis now a peer dependency of this package. New mapbox-gl-geocoder instances should setmapboxglin the constructor options.If
mapboxglis not found in the constructor options, markers will not be added to the map and an error will be generated in the console, but the plugin will otherwise function as usual.