Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

MarkerViewOptions.icon() Should Be Optional #5276

Closed

Description

@cammace

Position should be the only thing that needs to be passed to MarkerViewOptions(). Currently .icon is also required instead of just using the default red marker icon MarkerOptions() uses. In other words, setting up a simple marker view currently looks like this:

 mapboxMap.addMarker(new MarkerViewOptions()
                        .position(new LatLng(-33.85699436, 151.21510684))
                        .icon(icon)); // This line shouldn't be required

cc: @bleege @tobrun @zugaldia @ivovandongen

Activity

  1. added
    Android
    on Jun 7, 2016
  2. cammace commented on Jun 7, 2016

    @cammace
    ContributorAuthor

    BTW the default marker image has a bunch of bottom padding right now and can either be cropped out or .anchor(0.5f,0.5f) needs to be used

  3. tobrun commented on Jun 8, 2016

    @tobrun
    Member

    @cammace great catch on Icon. Couple of remarks on the subject. Yes we should provide a default icon when none is provided but note that we can't reuse the default one:

    screen shot 2016-06-08 at 10 53 16

    The default for gl markers contained extra space at the bottom because at that time we didn't have any setup for anchoring. We will need to crop that image and use that as the default for ViewMarkers. FWIW the default anchoring (conform to Google is at the bottom-middle = .anchor(0.5f,1.0f).

  4. Schumi09 commented on Jun 8, 2016

    @Schumi09

    I really liked the explanations in #5079 by the way. When you are going to release 4.1.0 you should make users aware of this in the tutorials, especially because the anchoring differs for both types. I was pretty surprised at first some days ago ;)

  5. bleege commented on Jun 9, 2016

    @bleege
    Contributor

    Just noting that @Schumi09 has documented a good workaround for the current state of the SDK as well as inspiration for fixing this when we pick this issue back up in #3276 (comment). Thanks again @Schumi09!

  6. changed the title [-]marker view icon should be optional[/-] [+]MarkerViewOptions.icon() Should Be Optional[/+] on Jun 9, 2016
  7. added 4 commits that reference this issue on Jun 13, 2016
  8. tobrun commented on Jun 21, 2016

    @tobrun
    Member

    This landed in #5348 and was merged in release-android-v4.1.0. Closing

  9. added this to the android-v4.1.0 milestone on Jun 21, 2016
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

    Androidfeature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions