Search code examples
androidandroid-mapviewitemizedoverlay

Android Map Balloon Rotation


I am using the BalloonItemizedOverlay provided here: https://github.com/jgilfelt/android-mapviewballoons

It's been working great. But my map is set up so that "up" is the user's bearing, i.e. if the user's bearing is East, then the map would be rotated so that East is pointing up. The problem is that when the map rotates, so do the balloons, causing them to become unreadable. Basically, the "BalloonView" is a custom class defines a small balloon shape with a couple of TextViews, and the BalloonItemizedOverlay extends ItemizedOverlay but uses this new BalloonView to display info. I've tried a couple of things, like getting the LinearLayout that defines the BalloonView and rotating it. I even tried putting the entire balloon into my custom RotateView, a container that will rotate, but none of these worked. Does anyone have any ideas?


Solution

  • You could try overriding draw() in BalloonView and rotate the Canvas accordingly before calling super.draw().