Skip to content

The default marker is positioned incorrectly #8071

Closed

Description

@dmytro-gokun

I'm creating a default droplet-shaped marker (by omitting options.element as described here: https://docs.mapbox.com/mapbox-gl-js/api/#marker). As a result the marker is positioned slightly higher then it should be. You can see it here:

https://jsbin.com/ragudog/5/edit?html,output

The reason is that is an inline element and the size of the div is determined by the size of the svg + line-height setting (which is 20px for the map by default).

So, in order to fix this, we need to change that default droplet svg to be a "block" element. If everybody agrees, I will submit a PR to fix this issue.

Activity

  1. dmytro-gokun commented on Mar 23, 2019

    @dmytro-gokun
    ContributorAuthor

    After some thinking ... one could argue that when using the default marker, anchor & offset should be overridden as well, so that the droplet's sharp end points to exact location. Any thoughts?

  2. mourner commented on Mar 23, 2019

    @mourner
    Member

    Yes, we'll welcome a PR! The sharp end point definitely should point to exact location.

  3. dmytro-gokun commented on Mar 23, 2019

    @dmytro-gokun
    ContributorAuthor

    @mourner Deal. I'll work on this.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions