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

MarkerViewOptions.icon() Should Be Optional #5276

Closed
cammace opened this issue Jun 7, 2016 · 5 comments
Closed

MarkerViewOptions.icon() Should Be Optional #5276

cammace opened this issue Jun 7, 2016 · 5 comments
Labels
Android Mapbox Maps SDK for Android feature

Comments

@cammace
Copy link
Contributor

cammace commented Jun 7, 2016

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

@cammace cammace added feature Android Mapbox Maps SDK for Android labels Jun 7, 2016
@cammace
Copy link
Contributor Author

cammace commented Jun 7, 2016

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

@tobrun
Copy link
Member

tobrun commented Jun 8, 2016

@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).

@Schumi09
Copy link

Schumi09 commented Jun 8, 2016

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 ;)

@bleege
Copy link
Contributor

bleege commented Jun 9, 2016

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!

@tobrun
Copy link
Member

tobrun commented Jun 21, 2016

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

@tobrun tobrun closed this as completed Jun 21, 2016
@tobrun tobrun added this to the android-v4.1.0 milestone Jun 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android feature
Projects
None yet
Development

No branches or pull requests

4 participants