高德地图LBS
1.定位
- MapView aMap;
- aMap.setMapType(AMap.MAP_TYPE_NORMAL);
- //AMap.MAP_TYPE_SATELLITE AMap.MAP_TYPE_NIGHT
- // 交通图
- aMap.setTrafficEnabled(true);
- LocationManagerProxy proxy = …getIns();
- 实现 AMapLocationListener接口
- //注册定位 这里是网络定位 -1表示单次定位
- proxy.requestLocationData(LocationProviderProxy.AMapNetwork,60*1000,15);
2.地理围栏
- Intent intent = new Intent(GEOFENCE_BROADCAST_ACTION);//广播
- PendingIntent mIntent = PendingIntent.getBroadcaset( getAppplicationContext(),0,intent);
- proxy.addGeoFenceAlert(lat,lng,1000,1000*60,mIntent);//注册地理围栏监听
3.天气
- 接口 AMapLocalWeatherListener
proxy.requestWeatherUpdates(LocationManagerProxy.WEATHER_TYPE_LIVE,
this);
4.add marker
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(new LatLng(39.90503, 116.107535));
markerOptions.icon(BitmapDescriptorFactory
.fromResource(R.drawable.ic_launcher));
Marker marker = aMap.addMarker(markerOptions);
marker.setRotateAngle(45);
5.draw line
PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.add(new LatLng(39.90503, 116.107535), new LatLng(
35.90503, 114.107535));
polylineOptions.color(Color.RED);
polylineOptions.setDottedLine(true);
polylineOptions.width(10);
aMap.addPolyline(polylineOptions);
6.drawCirCle
CircleOptions circleOptions = new CircleOptions();
circleOptions.center(new LatLng(39.90503, 116.107535));
circleOptions.radius(100);
circleOptions.fillColor(Color.BLACK);
aMap.addCircle(circleOptions);