Search in sources :

Example 6 with MapStatusUpdate

use of com.baidu.mapapi.map.MapStatusUpdate 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)

Example 7 with MapStatusUpdate

use of com.baidu.mapapi.map.MapStatusUpdate in project PhotoNoter by yydcdut.

the class MapPresenterImpl method initBaiduMap.

private void initBaiduMap() {
    mBaiduMap = mIMapView.getBaiduMap();
    // 获取地图对象控制器
    // 设置显示楼体
    mBaiduMap.setBuildingsEnabled(true);
    // 设置地图状态
    mBaiduMap.setMapStatus(MapStatusUpdateFactory.zoomTo(19f));
    mUiSettings = mBaiduMap.getUiSettings();
    mUiSettings.setZoomGesturesEnabled(true);
    mUiSettings.setScrollGesturesEnabled(true);
    mUiSettings.setRotateGesturesEnabled(true);
    mUiSettings.setOverlookingGesturesEnabled(true);
    mUiSettings.setCompassEnabled(true);
    MapStatus ms = new MapStatus.Builder().overlook(30).build();
    MapStatusUpdate u = MapStatusUpdateFactory.newMapStatus(ms);
    mBaiduMap.animateMapStatus(u, 1000);
    // 初始化搜索模块
    mSearch = GeoCoder.newInstance();
    mSearch.setOnGetGeoCodeResultListener(this);
}
Also used : MapStatusUpdate(com.baidu.mapapi.map.MapStatusUpdate) MapStatus(com.baidu.mapapi.map.MapStatus)

Aggregations

MapStatusUpdate (com.baidu.mapapi.map.MapStatusUpdate)7 LatLng (com.baidu.mapapi.model.LatLng)5 MapStatus (com.baidu.mapapi.map.MapStatus)4 Intent (android.content.Intent)2 IntentFilter (android.content.IntentFilter)2 BaiduMapOptions (com.baidu.mapapi.map.BaiduMapOptions)2 MapView (com.baidu.mapapi.map.MapView)2 MarkerOptions (com.baidu.mapapi.map.MarkerOptions)2 MyLocationConfiguration (com.baidu.mapapi.map.MyLocationConfiguration)2 OverlayOptions (com.baidu.mapapi.map.OverlayOptions)2 CoordinateConverter (com.baidu.mapapi.utils.CoordinateConverter)2 LocationMode (com.baidu.mapapi.map.MyLocationConfiguration.LocationMode)1 MyLocationData (com.baidu.mapapi.map.MyLocationData)1