我正在使用以下代码显示 MAP(Google API)我希望它在用户 DOUBLE 单击地图上的任何位置时进行缩放。我怎样才能实现它?
public class TourMapActivity extends MapActivity {
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
setContentView(R.layout.tour_map);
mMapView = (MapView)findViewById(R.id.MapView);
mMapView.setBuiltInZoomControls(true);
mMapView.getZoomButtonsController().setVisible(true);
}
@Override
protected boolean isRouteDisplayed() {
return true;
}
class CustomOverlay extends ItemizedOverlay<CustomItem> {
protected ArrayList<CustomItem> mOverlays = new ArrayList<CustomItem>();
public OnTapListenerIndex mOnTapListenerIndex = null;
private Context mContext;
public CustomOverlay(Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker));
}
public CustomOverlay(Drawable defaultMarker, Context context)
{
super(boundCenterBottom(defaultMarker));
mContext = context;
}
@Override
protected CustomItem createItem(int i) {
return mOverlays.get(i);
}
@Override
public int size() {
return mOverlays.size();
}
public void addOverlay(CustomItem overlay) {
mOverlays.add(overlay);
populate();
}
public void addOverlay(CustomItem overlay, Drawable marker) {
overlay.setMarker(boundCenterBottom(marker));
addOverlay(overlay);
}
@Override
public void draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow) {
super.draw(canvas, mapView, false);
}
}
public interface OnTapListenerIndex {
public void onTapEvent(int index, OverlayItem overlayItem);
}
}
当用户双击地图上的任何位置时,我希望它可以缩放。我怎样才能实现它?