文件名称:Android 上应用Googlemap
文件大小:8KB
文件格式:RAR
更新时间:2012-10-18 04:26:13
Android 上应用Googlemap
package com.MangoMap;
//import android.app.Activity;
import com.google.android.maps.MapActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
//MapView Com
import com.google.android.maps.MapView;
import com.google.android.maps.MapController;
import com.google.android.maps.GeoPoint;
//import com.google.android.maps.
public class MangoMap extends MapActivity {
/** Called when the activity is first created. */
private MapView mpv;
private MapController mpc;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//地图
mpv = (MapView) findViewById(R.id.map);
mpv.setTraffic(true);
mpv.setClickable(true);
mpv.setScrollContainer(true);
mpc = mpv.getController();
GeoPoint gp = new GeoPoint((int) (23.05320 * 1000000), (int) (113.155550 * 1000000)); //地理坐标
mpc.animateTo(gp);
mpc.setZoom(15);
//mpc.
//
}
@Override
protected boolean isRouteDisplayed() { return false; }
}
//-----------------
【文件预览】:
MangoMap.apk