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.

myLocationViewSettings.setBackgroundTintColor cannot be #00000000 #7116

Closed

Description

@ghengeveld

Platform: Android 5.0
Mapbox SDK version: 4.2.0.beta.3

Steps to trigger behavior

  1. Use MyLocationViewSettings.setForegroundDrawable to show a custom drawable at the user's location
  2. Use MyLocationViewSettings.setBackgroundTintColor with #00000000 (fully transparent black)

In OnMapReadyCallback.onMapReady:

Drawable walkingUserMarker = ContextCompat.getDrawable(context, R.drawable.marker_user_walk);
MyLocationViewSettings myLocationViewSettings = mapboxMap.getMyLocationViewSettings();
myLocationViewSettings.setAccuracyAlpha(0);
myLocationViewSettings.setForegroundDrawable(walkingUserMarker, null);
myLocationViewSettings.setBackgroundTintColor(ContextCompat.getColor(context, R.color.transparent));

In colors.xml:

<color name="transparent">#00000000</color>

Setting the color to #00ffffff avoids this issue and yields the expected result.

Expected behavior

Only the marker drawable should be rendered at the user's location, nothing else.

Actual behavior

The drawable appears with a light gray dot below it. This appears to be the default background tint.

It would be nice to be able to use setBackgroundTintColor(null) to disable the background altogether.

Activity

  1. added
    Android
    on Nov 18, 2016
  2. cammace commented on Nov 28, 2016

    @cammace
    Contributor

    This is due to use checking if it is transparent or not. We should rethink this check or expose a setVisibility method for the foreground/background images. @tobrun what do you think?

  3. added this to the android-v5.0.0 milestone on Nov 28, 2016
  4. tobrun commented on Nov 29, 2016

    @tobrun
    Member

    Makes sense @cammace, feel free to run with 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

    Android

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions