Skip to content

Commit

Permalink
fixed app crashing on android on custom marker and fixed marker not u…
Browse files Browse the repository at this point in the history
…pdating on image change
  • Loading branch information
Geor23 committed May 2, 2017
1 parent e8bc08f commit a83c04a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.drawable.Animatable;
import android.net.Uri;
Expand Down Expand Up @@ -236,6 +237,9 @@ public void setImage(String uri) {
logoHolder.setController(controller);
} else {
iconBitmapDescriptor = getBitmapDescriptorByName(uri);
if (iconBitmapDescriptor != null) {
iconBitmap = BitmapFactory.decodeResource(getResources(), getDrawableResourceByName(uri));
}
update();
}
}
Expand Down

5 comments on commit a83c04a

@kevinnguy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thank you so much!

@TolgaCagin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, That is life saver...

@amitpdev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey cool girl, care to open a PR for this?

@amitpdev
Copy link

@amitpdev amitpdev commented on a83c04a Jun 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this fixes the crash but introduces another bug with marker sizing.
(only) on the first load of the map, where markers are close to each other - I get this kind of mis-sized markers: http://imgur.com/a/2RJlw

@Geor23
Copy link
Owner Author

@Geor23 Geor23 commented on a83c04a Jun 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scotbond haven't made a PR as this doesn't fix the underlying issue of why iconBitmap is null in the first place, it just sets that variable at a later time as well, before the variable is used.

Please sign in to comment.