user1134602
user1134602

Reputation: 597

How to set center of GoogleMap?

I have following task: I have been making Android application, and I need to set drawable marker into center of Map that if I move map or zoom map this marker will continue point to center of Map, won't move with Map. How can I do it?

Upvotes: 0

Views: 271

Answers (2)

Fab Castel
Fab Castel

Reputation: 562

Why would you even want to use a marker for that? It sounds like the obvious solution is to have another ImageView or ImageButton or what have you layered on top of your map with layout_gravity="center". It'll stay centred and you won't need to constantly move a marker around.

Upvotes: 0

deepak Sharma
deepak Sharma

Reputation: 1641

You can set the center of map by getting the controller of map view and set its center.

mapView.getController().setCenter(GeoPoint);

Upvotes: 6

Related Questions