Biff MaGriff
Biff MaGriff

Reputation: 8241

Adding items to Android Maps Overlay does not immediately show on map. How do I fix?

I can't figure out how to tell my Map to redraw its overlays once I've updated them. Can someone enlighten me?

Currently the user has to touch the screen before the map is redrawn.

Thanks!

Upvotes: 1

Views: 1263

Answers (3)

Prerna
Prerna

Reputation: 363

Recently I have been facing the same issue.But it was just because of some misconception about Location Listener. In my case I registered the a separate Broadcast Receiver which in turn calls a MapActivity that possess my LocationListener. Although LocationListener itself is a Broadcast Receiver which does not need any of the External Broadcast Receiver to be called. After removing the extra Broadcast receiver and directly implementing Location Listener I fixed my bug.

Upvotes: 1

Flo
Flo

Reputation: 27445

I think you must call invalidate() from an UI thread or postInvalidate() from an non-UI thread on the MapView object you are using.

Upvotes: 4

Chris Thompson
Chris Thompson

Reputation: 35598

Try calling populate() on the overlay that contains the pins.

Upvotes: 0

Related Questions