Skip to content

Markers color lost in version 0.3.2 #126

@MarionaDSR

Description

@MarionaDSR

If I force version 0.3.2 from my build.gradle file, my markers losts his color on the map.

Markers that used to be red, are now white a with very light gray text.

BEFORE:
compile 'com.google.maps.android:android-maps-utils:0.3.+' // for markers on maps
screenshot_2014-10-22-18-14-20

AFTER:
compile 'com.google.maps.android:android-maps-utils:0.3.2' // for markers on maps
screenshot_2014-10-22-18-13-04

The change of version number on build.gradle file is the only difference between the two images.

The code I use to set the color is:

    protected void onBeforeClusterItemRendered(T item, MarkerOptions markerOptions) {
        MyMarker myMarker = (MyMarker) item;
        IconGenerator iconFactory = new IconGenerator(getActivity());
        String title = myMarker.getBubbleTitle(getResources());
        String snippet = myMarker.getBubbleSnippet(getResources(), user);
        int color = myMarker.getBubbleColor(user);
        iconFactory.setStyle(color);
        markerOptions.title(title).snippet(snippet)
                .icon(BitmapDescriptorFactory.fromBitmap(iconFactory.makeIcon(myMarker.getBubbleLabel(getResources()))));
        super.onBeforeClusterItemRendered(item, markerOptions);
    }

    where

    public int getBubbleColor(MyUser user) {
        int color;
        if (user.firstCase) {
            color = IconGenerator.STYLE_RED;
        } else if (user.secondCase) {
            if (user.case2b) {
                color = IconGenerator.STYLE_BLUE;
            } else {
                color = IconGenerator.STYLE_PURPLE;
            }
        } else {
            color = IconGenerator.STYLE_WHITE;
        }
        return color;
    }

Thank you
Mariona

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions