Skip to content

Numbered markers #106

Closed
Closed

Description

@easbar

When there are multiple via-points it would be useful to display numbered markers like on graphhopper.com/maps:

image

Another problem is that react-map-gl does not include the default marker we are using currently, so we need to add some kind of markers for #87 anyway. Currently we use a solution based on *.png files, but is this the right way to go or should we use svgs? https://github.com/graphhopper/graphhopper/blob/master/web-bundle/src/main/resources/com/graphhopper/maps/js/lib/leaflet_numbered_markers.js

For our route editor we use different markers as well:

image

But I think the requirements are kind of the same: We need different colors and it should be possible to display a number. Right, @karussell?

@Janekdererste any thoughts about this?

Activity

  1. added this to the 0.3 milestone on Jun 14, 2021
  2. easbar commented on Jun 14, 2021

    @easbar
    MemberAuthor
  3. Janekdererste commented on Jun 15, 2021

    @Janekdererste
    Collaborator

    I think we should use SVGs. We are using those markers in several other places. (The turn instructions have marker icons and it would be nice to replace the colored dots next to the addressInputs with markers as well) Using SVGs makes sure those icons appear sharp everywhere.

    Also, the color of SVGs can be set dynamically. We would therefore only need a single SVG asset and then color it with css or from js-code. This makes it easy to introduce another color if this need ever arises.

    Probably it would make sense to have a MarkerComponent somehow which manages the number and the coloring.

  4. Janekdererste commented on Jun 15, 2021

    @Janekdererste
    Collaborator

    Btw the mapbox gl js default marker we are currently using is somewhat 'buried' here:

    I do like the appearance of the mapbox marker a lot, by the way

  5. easbar commented on Jun 15, 2021

    @easbar
    MemberAuthor

    Ok I agree :)

    There is an example SVG based marker component here:

    https://github.com/visgl/react-map-gl/blob/4.0-release/examples/controls/src/city-pin.js

    and it is used here: https://visgl.github.io/react-map-gl/examples/controls

    I just think its kind of ugly :)

    image

    I do like the appearance of the mapbox marker a lot, by the way

    Yes, me too :)

  6. easbar commented on Jun 15, 2021

    @easbar
    MemberAuthor

    And while we are at it: What do you think about the height graph marker:

    image

    I think in its current form we cannot use it with the react mapbox wrapper either, and neither do I think it is particularly pretty. Should we just use the default Mapbox popup for this? Or any other ideas?

    Hm, without further styling the default popup is also a bit ugly:
    image

  7. Janekdererste commented on Jun 16, 2021

    @Janekdererste
    Collaborator

    Hm, without further styling the default popup is also a bit ugly:

    I think so too. On the other hand we can use the default pop up and find a better solution later, if you want to solve things with the react wrapper first

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