I’m using MapView.addView() to display a pop-up bubble on top of an OverlayItem marker when it is tapped. Sometimes the pop-up view extends beyond the edge of the display screen because of the amount of information it contains or because the marker that was tapped is close to the map’s edge. How can I determine when the pop-up view won’t fit and then adjust the map’s position so the entire pop-up view is displayed?
I’m using MapView.addView() to display a pop-up bubble on top of an OverlayItem marker
Share
It’s been three months since I asked this question so I thought I would post the solution I came up with just in case anyone comes across this posting. This method is part of a class that extends
MapView.One thing that tripped me up was how to make sure the view passed in had its measurements available. I solved that by registering a listener to determine when the view had been laid out by the system like so:
And here’s the listener:
I hope this helps somebody else out there.