views:

84

answers:

1

I'v encountered a problem with Google Maps on Android. In my app I have a location-chooser where the user navigates to his desired location to save the exact street location. In order for the user to actually see what street he is no (and not just the general area) I need to mark the middle of the map clearly.

The problem is that the reticle (the little circle marking the center) from Google Maps usually won't show. It appears at the most 1 out of 10 times I open the map, probably less. This happens regardless if I add other overlays or if I just show the map as is. I am aware of ReticleDrawMode and have tried setting it to DRAW_RETICLE_OVER, but this does not seem to work (and it should be the default already).

Have I missed something here? I have searched for the problem and from what I have see the problem seems to be common, but I havn't seen a solution for actually forcing it to always show, only for hiding it.

If the reticle is broken, does anyone have a good suggestion for how to create a custom one? As I said the the user will navigate the map, so I can't just do a normal overlay on a fixed point of the map, and the map also does not take up the full screen so drawing something over it is a bit ugly (although I guess that will be my last resort).

+1  A: 

And of course I found the answer just after I asked the question, or at least part of the answer.

I haven't found out how to get the reticle to work, but the easy workaround for this is to use the fact that different widgets can overlap each other in a RelativeLayout, whichever is declared last will simply lay above the other. So I ended up putting the MapView in a RelativeLayout and then simply placing a TextView in the center of the same layout. The TextView is now over the center of the map and can be used to mark the middle.

(Going to replace the TextView with something more appropriate later, but the concept stays the same).

Erik Honn
Good solution! I adapted you idea, but made it a button: with <Buttonandroid:text='\u25ce'android:id="@+id/Button01"android:background="@android:color/transparent" - this gives a bullseye bang on the centre of the map
NickT