ZoomControls zoomCtl = (ZoomControls) findViewById(R.id.zoomControls1); zoomCtl.setOnZoomInClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ mMapView.zoomin(); } }); zoomCtl.setOnZoomOutClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mMapView.zoomout(); } });
Solved! Go to Solution.
public void onClick(View v){ mMapView.zoomin(); }
public void onClick(View v){ v.zoomin(); }
map.setOnZoomListener(new OnZoomListener() { /** * */ private static final long serialVersionUID = 1L; @Override public void preAction(float pivotX, float pivotY, double factor) { // TODO Auto-generated method stub } @Override public void postAction(float pivotX, float pivotY, double factor) { Log.d("test","test of the OnZoomListener"); } });
callout = map.getCallout(); callout.setStyle(R.xml.calloutstyle); testButton = (ImageButton)findViewById(R.id.testbutton); testButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if(callout != null){ callout.hide(); callout = null; //callout gets re-created when user clicks on Graphic } } });
ZoomControls zoomCtl = (ZoomControls) findViewById(R.id.zoomControls1); zoomCtl.setOnZoomInClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ if (callout.isShowing()){ mMapView.setOnZoomListener(null); mMapView.zoomin(); }else{ ZoomListenerOn(mMapView); mMapView.zoomin(); } } }); zoomCtl.setOnZoomOutClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (callout.isShowing()){ mMapView.setOnZoomListener(null); mMapView.zoomout(); }else{ ZoomListenerOn(mMapView); mMapView.zoomout(); } } }); public void ZoomListenerOn(MapView m){ m.setOnZoomListener(new OnZoomListener() { private static final long serialVersionUID = 1L; @Override public void preAction(float pivotX, float pivotY, double factor) { // TODO Auto-generated method stub } @Override public void postAction(float pivotX, float pivotY, double factor) { Log.d("test","test of the OnZoomListener"); } }); }