迷茫2017-04-17 15:29:07
你可以看下高德地图的快速开发指南,参考这儿http://lbs.amap.com/api/android-sdk/guide/overlay/
//定义类成员变量
private MapView mapView;
private AMap aMap;
//在onCreat方法中给aMap对象赋值
mapView = (MapView) findViewById(R.id.map);
mapView.onCreate(savedInstanceState);// 必须要写
aMap = mapView.getMap();
LatLng x = new LatLng(34.341568,104.064855);//第一个参数是:latitude,第二个参数是longitude
//添加标记
MarkerOptions mark = new MarkerOptions();
markerOption.position(Constants.XIAN);
markerOption.title("西安市");
markerOption.snippet("气泡的文字");
markerOption.perspective(true);
markerOption.draggable(true);
markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.arrow));//设置图标
aMap.addMarker(markerOption);