0

I'd like to draw something (for instance a polygon) at fixed screen location (for instance x=20, y=20), no geo-location, on a map. This is similar to the small "google" we see at bottom-left of the map. It seems that map v2 doesn't allow it... the api designer forgot about it.

The code suggestion here: Google Map API V2 - How do I keep a marker in the center of the screen while user is scrolling the map? would work but user might see it when moving... The map v2 doesn't look like well designed.

Community
  • 1
  • 1
USML
  • 91
  • 2
  • 6

2 Answers2

1

It seems that map v2 doesn't allow it... the api designer forgot about it.

Probably not, simply because what you want has nothing to do with maps.

To layer widgets on top of each other, use RelativeLayout or FrameLayout. Later children will be higher on the Z axis, meaning that they will appear to float over top of earlier children.

So, you wind up with this layout pseudo-code:

<RelativeLayout>
    <MapView> <!-- or perhaps <fragment> -->
    <ImageView>
</RelativeLayout>

where you use margins and RelativeLayout rules like android:alignParentBottom="true" to position your image where needed.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

When working with Google Maps Android API v2 don't forget about Android APIs. Just add an ImageView to your layout with an image you would like to display.

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94