[代码] [Java]代码
package com.android.antking.map;
import com.google.android.maps.MapActivity;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class MyMain extends MapActivity {
//放大倍数
static final int INITIAL_ZOOM_LEVEL=12;
//中心点
static final int INITIAL_LATITUDE=123465465;
static final int INITIAL_LONGITUDR=15634646;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mapView);
//enable to change the size of the map
mapView.setBuiltInZoomControls(true);
//设置Zoom 大小和地图的中心点
MapController mc = mapView.getController();
mc.setZoom(INITIAL_ZOOM_LEVEL);
mc.setCenter(new GeoPoint(INITIAL_LATITUDE,INITIAL_LONGITUDR));