Skip to content

Add marker to map showing result #213

Closed

Description

@scottsfarley93

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.

\cc @katydecorah

Activity

  1. andrewharvey commented on Mar 19, 2019

    @andrewharvey
    Collaborator

    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 👍

  2. andrewharvey commented on Mar 20, 2019

    @andrewharvey
    Collaborator

    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

  3. added this to the v4.0.0 milestone on Mar 21, 2019
  4. scottsfarley93 commented on Mar 27, 2019

    @scottsfarley93
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions