Search in sources :

Example 1 with CoordinateConverter

use of com.baidu.mapapi.utils.CoordinateConverter in project SmartCampus by Vegen.

the class EaseBaiduMapActivity method showMap.

private void showMap(double latitude, double longtitude, String address) {
    sendButton.setVisibility(View.GONE);
    LatLng llA = new LatLng(latitude, longtitude);
    CoordinateConverter converter = new CoordinateConverter();
    converter.coord(llA);
    converter.from(CoordinateConverter.CoordType.COMMON);
    LatLng convertLatLng = converter.convert();
    OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.ease_icon_marka)).zIndex(4).draggable(true);
    mBaiduMap.addOverlay(ooA);
    MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
    mBaiduMap.animateMapStatus(u);
}
Also used : MapStatusUpdate(com.baidu.mapapi.map.MapStatusUpdate) MarkerOptions(com.baidu.mapapi.map.MarkerOptions) OverlayOptions(com.baidu.mapapi.map.OverlayOptions) CoordinateConverter(com.baidu.mapapi.utils.CoordinateConverter) LatLng(com.baidu.mapapi.model.LatLng)

Example 2 with CoordinateConverter

use of com.baidu.mapapi.utils.CoordinateConverter in project wechat by motianhuo.

the class BaiduMapActivity method showMap.

private void showMap(double latitude, double longtitude, String address) {
    txt_right.setVisibility(View.GONE);
    LatLng llA = new LatLng(latitude, longtitude);
    CoordinateConverter converter = new CoordinateConverter();
    converter.coord(llA);
    converter.from(CoordinateConverter.CoordType.COMMON);
    LatLng convertLatLng = converter.convert();
    OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_marka)).zIndex(4).draggable(true);
    mBaiduMap.addOverlay(ooA);
    MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
    mBaiduMap.animateMapStatus(u);
}
Also used : MapStatusUpdate(com.baidu.mapapi.map.MapStatusUpdate) MarkerOptions(com.baidu.mapapi.map.MarkerOptions) OverlayOptions(com.baidu.mapapi.map.OverlayOptions) CoordinateConverter(com.baidu.mapapi.utils.CoordinateConverter) LatLng(com.baidu.mapapi.model.LatLng)

Aggregations

MapStatusUpdate (com.baidu.mapapi.map.MapStatusUpdate)2 MarkerOptions (com.baidu.mapapi.map.MarkerOptions)2 OverlayOptions (com.baidu.mapapi.map.OverlayOptions)2 LatLng (com.baidu.mapapi.model.LatLng)2 CoordinateConverter (com.baidu.mapapi.utils.CoordinateConverter)2