Question

I have a map based Android program, that is working nicely, I have it opening an alert dialog when an overlay is clicked...

I start the app, and see my overlays, and all is fine, until I select an overlay. When I select an overlay, my alert dialog appears as expected, but when I close it, suddenly all the annotations suddenly shift down and right a little bit, and then stay shifted from that point on.

It almost seems like the bounds of the overlay suddenly got resent from being set on the middle of the image I am using for the overlay, the top right corner of the image. Is this a KNOWN android issue? I don't have anything in my code explicitely playing with the bounds of the image after I initially set it to the be configured to the center yet this seems to be happening... any ideas?

Was it helpful?

Solution

I figured it out, I was passing the drawable that was my overlay to the AlertDialog to be used as its ICON... apparently the AlertDialog code reset the bounds on my Drawable from being Center Bottom as I had it set up, to top left, and so when I dismissed the dialog and the map redrew all the overlays shifted so that there location was upper right of the Overlay Image and not the center of it from that point forward.

It would have been nice if the API documentation mentioned this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top