coderslay
coderslay

Reputation: 14370

How to rotate the zoom control on a mapview to vertical in android

I have a map, in that map i have placed a zoomcontrol like this

    View zoomView = mapView.getZoomControls(); 
    zoomLayout.addView(zoomView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); 
    mapView.displayZoomControls(true);

In xml it is used like this

<LinearLayout 
    android:id="@+id/layout_zoom"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_centerHorizontal="true"
    android:layout_gravity="center_horizontal"/> 
</LinearLayout>

Now i need to rotate this zoom in vertical format... how to do it?

Upvotes: 0

Views: 1376

Answers (2)

Alberto M
Alberto M

Reputation: 1760

With the new API you can zoom controlling the camera:

googleMap.animateCamera(
    CameraUpdateFactory.newLatLngZoom(
    cluster.getPosition(), 
    (float) Math.floor(googleMap.getCameraPosition().zoom + 1)), 
    300, 
   null);

Upvotes: 0

molleman
molleman

Reputation: 2946

Best thing to do is create a vertical linear layout with 2 image button elements(one for zoom in and one for zoom out), you will have to create your own images if you want them to look like the android ones, then just call mapView.getController().zoomIn() or zoomOut().

Upvotes: 1

Related Questions