Wednesday, March 14, 2012

Always show zoom controls on a MapView in Android

 Always show zoom controls on a MapView in android.
problem:
i want show zoom controls on a Mapview always.
Solution:
 below  the code for get zoom controls always in mapview 2 way.
         mapView = (MapView) findViewById(R.id.mapview);
          mapView.setBuiltInZoomControls(true);
          mapView.getZoomButtonsController().setAutoDismissed(false);
                            
or

<ZoomControls android:id="@+id/zoomcontrols" android:layout_width="wrap_content" android:layout_height="wrap_content" />    
 ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);      zoomControls.setOnZoomInClickListener(new View.OnClickListener() {             
 @Override                  
public void onClick(View v) {                         
 mapController.zoomIn();               
  }        
 });        
 zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {              
@Override               
  public void onClick(View v) {                        
 mapController.zoomOut();                
 }       
  });  

1 comment:

  1. You will need to ensure you have enough cash in your bank account
    on that date uk payday loans the bank for around few months didn't change rates for deposits and many types of changes are for duration beyond few months.

    ReplyDelete

Check out this may be help you

Related Posts Plugin for WordPress, Blogger...