当前位置: 首页>>代码示例>>Java>>正文


Java MapStatusUpdateFactory类代码示例

本文整理汇总了Java中com.baidu.mapapi.map.MapStatusUpdateFactory的典型用法代码示例。如果您正苦于以下问题:Java MapStatusUpdateFactory类的具体用法?Java MapStatusUpdateFactory怎么用?Java MapStatusUpdateFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MapStatusUpdateFactory类属于com.baidu.mapapi.map包,在下文中一共展示了MapStatusUpdateFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: locationReceiveAddress

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
/**
 * 定位接收到的地址
 **/
private void locationReceiveAddress() {
    if (receiveAddress == null) {
        return;
    }
    LatLng p = new LatLng(receiveAddress.getLatitude(), receiveAddress.getLongitude());
    MarkerOptions markerOptions = new MarkerOptions();
    /* 设置覆盖物图标 */
    markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_openmap_focuse_mark))
            .position(p)
            .visible(true);
    baiduMap.setOnMarkerClickListener(new BaiduMap.OnMarkerClickListener() {
        @Override
        public boolean onMarkerClick(Marker marker) {
            setSinglePoiDetail();
            return true;
        }
    });
    if (NetUtil.getInstance(SetFavoriteMapActivity.this).getCurrentNetType().equals(NetUtil.NetType.NETWORK_TYPE_NONE)) {
        // Snackbar.make(mAmosfPoiList,mAppConfig.getResources().getString(R.string.no_network), Snackbar.LENGTH_SHORT).show();
        return;
    }
    /* 添加覆盖图层 */
    baiduMap.addOverlay(markerOptions);
    baiduMap.setMapStatus(MapStatusUpdateFactory.newLatLngZoom(p, 17F));
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:29,代码来源:SetFavoriteMapActivity.java

示例2: zoomToSpan

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
/**
 * 缩放地图,使所有Overlay都在合适的视野内
 * <p>
 * 注: 该方法只对Marker类型的overlay有效
 * </p>
 * 
 */
public void zoomToSpan() {
    if (mBaiduMap == null) {
        return;
    }
    if (mOverlayList.size() > 0) {
        LatLngBounds.Builder builder = new LatLngBounds.Builder();
        for (Overlay overlay : mOverlayList) {
            // polyline 中的点可能太多,只按marker 缩放
            if (overlay instanceof Marker) {
                builder.include(((Marker) overlay).getPosition());
            }
        }
        mBaiduMap.setMapStatus(MapStatusUpdateFactory
                .newLatLngBounds(builder.build()));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:OverlayManager.java

示例3: cancelBook

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
private void cancelBook() {
    countDownTimer.cancel();
    bike_layout.setVisibility(View.GONE);
    bike_info_layout.setVisibility(View.GONE);
    confirm_cancel_layout.setVisibility(View.GONE);
    prompt.setVisibility(View.GONE);
    bike_distance_layout.setVisibility(View.VISIBLE);
    bike_distance_layout.setVisibility(View.VISIBLE);
    book_bt.setVisibility(View.VISIBLE);
    if (routeOverlay != null)
        routeOverlay.removeFromMap();
    MapStatus.Builder builder = new MapStatus.Builder();
    //地图缩放比设置为18
    builder.target(currentLL).zoom(18.0f);
    mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(builder.build()));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:MainActivity.java

示例4: initView

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
private void initView() {
    mapView = (MapView) findViewById(R.id.see_location_mapview);
    toolBarView = (ToolBarView) findViewById(R.id.see_location_toolbar);

    toolBarView.setBackButtonImage(R.mipmap.icon_back);
    toolBarView.setBackButtonVisible(true);
    toolBarView.setBackButtonOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });
    toolBarView.setTitleText("查看接单人位置");

    baiduMap = mapView.getMap();

    MapStatusUpdate update = MapStatusUpdateFactory.zoomTo(19f);
    baiduMap.setMapStatus(update);

    handler = new MyHandler(this);


}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:24,代码来源:SeeLocationActivity.java

示例5: handleMessage

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
    final SeeLocationActivity activity = activityWeakReference.get();
    switch (msg.what) {
        case 0:
            final String response = (String) msg.obj;

            Scanner scanner = new Scanner(response);
            double latitude = Double.parseDouble(scanner.next());
            double longitude = Double.parseDouble(scanner.next());
            LatLng point = new LatLng(latitude, longitude);
            if (activity.centP == null) {
                activity.centP = point;
                activity.baiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(activity.centP));
            }
            activity.initHeadBitmap();
            OverlayOptions options = new MarkerOptions().position(point).icon(activity.bitmapDescriptor);
            activity.baiduMap.clear();
            activity.baiduMap.addOverlay(options);
            break;
    }
}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:23,代码来源:SeeLocationActivity.java

示例6: initBaiduMap

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
/**
 * 初始化百度地图
 */
private void initBaiduMap() {
    // 设置是否显示缩放控件
    mMapView.showZoomControls(false);
    mBaiduMap = mMapView.getMap();
    // 设定地图中心点坐标:宁波天翔货柜有限公司(云台山路)
    LatLng point = new LatLng(29.882673, 121.894326);
    // 以动画方式更新地图状态,动画耗时默认 300 ms ,地图支持的最大最小级别分别为[3-21]
    mBaiduMap.animateMapStatus(MapStatusUpdateFactory.newLatLngZoom(point, 18));
    // 定义Maker坐标点:宁波天翔货柜有限公司(云台山路)
    ArrayList<BitmapDescriptor> giflist = new ArrayList<>();
    giflist.add(BitmapDescriptorFactory.fromResource(R.mipmap.ic_marker));
    giflist.add(BitmapDescriptorFactory.fromResource(R.mipmap.ic_marker_light));
    // 通过marker的icons设置一组图片,再通过period设置多少帧刷新一次图片资源
    MarkerOptions mo = new MarkerOptions().position(point).icons(giflist).zIndex(0).period(20);
    // 设置生长动画/掉下动画
    // mo.animateType(MarkerOptions.MarkerAnimateType.drop);
    // 在地图上添加Marker,并显示
    mBaiduMap.addOverlay(mo);
}
 
开发者ID:jpaijh,项目名称:TYT,代码行数:23,代码来源:CB_BaiduMapActivity.java

示例7: initView

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
private void initView() {
    //设置模拟状态栏的高度
    ViewGroup.LayoutParams layoutParams = mStatusBar.getLayoutParams();
    layoutParams.height = ScreenUtil.getStatusBarHeight(this);
    mStatusBar.setLayoutParams(layoutParams);

    baiduMap = mapView.getMap();
    /* 是否显示比例尺控件 */
    mapView.showScaleControl(true);
    /* 是否显示缩放控件 */
    mapView.showZoomControls(false);
    baiduMap = mapView.getMap();
    /* 是否允许定位图层 */
    baiduMap.setMyLocationEnabled(true);
    /* 设置缩放级别,改变地图状态 */
    baiduMap.setMapStatus(MapStatusUpdateFactory.zoomTo(17f));
    mNaviDao = BaiduNaviDao.getInstance();
    /* 获取家和单位地址 */
    homeAddress = mNaviDao.getHomeOrCompanyAddress(getResources().getString(R.string.home));
    companyAddress = mNaviDao.getHomeOrCompanyAddress(getResources().getString(R.string.company));
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:22,代码来源:TrafficShowActivity.java

示例8: zoomToSpan

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
@Override
public void zoomToSpan() {
    if (mAmosfMap != null) {
        try {
            mAmosfMap.postDelayed(new Runnable() {
                @Override
                public void run() {
                    ConfirmCustomPoiOverlay.super.zoomToSpan();
                    if (mAmosfPoiBox.getVisibility() == View.VISIBLE) {
                        MapStatus ms = baiduMap.getMapStatus();
                        ms.targetScreen.set(ScreenUtil.getInstance().getWidthPixels() / 2, ScreenUtil.getInstance().getHeightPixels() / 4);
                        baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
                    }
                }
            }, 300);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:21,代码来源:SetFavoriteMapActivity.java

示例9: zoomToSpan

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
@Override
public void zoomToSpan() {
    if (mAncpMap != null) {
        try {
            mAncpMap.postDelayed(new Runnable() {
                @Override
                public void run() {
                    ConfirmCustomPoiOverlay.super.zoomToSpan();
                    if (mAncpPoiBox.getVisibility() == View.VISIBLE) {
                        MapStatus ms = baiduMap.getMapStatus();
                        ms.targetScreen.set(ScreenUtil.getInstance().getWidthPixels() / 2, ScreenUtil.getInstance().getHeightPixels() / 4);
                        baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
                    }
                }
            }, 500);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:21,代码来源:NaviConfirmPointActivity.java

示例10: zoomToSpan

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
@Override
public void zoomToSpan() {
    if (mapView != null) {
        try {
            mapView.postDelayed(new Runnable() {
                @Override
                public void run() {
                    ConfirmPoiOverlay.super.zoomToSpan();
                    if (mTrafficShowView.getPoiListBox().getVisibility() == View.VISIBLE) {
                        MapStatus ms = baiduMap.getMapStatus();
                        ms.targetScreen.set(ScreenUtil.getInstance().getWidthPixels() / 2, ScreenUtil.getInstance().getHeightPixels() / 4);
                        baiduMap.animateMapStatus(MapStatusUpdateFactory.newMapStatus(ms));
                    }
                }
            }, 300);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:21,代码来源:TrafficShowPresenter.java

示例11: stopRunning

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
private void stopRunning() {
    runningStatus = 2;
    timer.stop();
    client.stop();

    startButton.setIdleText("跑步结束");
    startButton.setProgress(0);

    if (!pointList.isEmpty()) {
        addMarker(pointList.get(pointList.size() - 1), R.drawable.ic_loc_end);
    }

    msUpdate = MapStatusUpdateFactory.newMapStatus(
            new MapStatus.Builder().zoom(17).build()
    );
    baiduMap.setMapStatus(msUpdate);

    locTimes = 0;//重置定位次数

    stepSensor.unregisterStep();
    saveRunData();

    // 计算平均速度
    float speed = Integer.parseInt(distanceNumber.getNumber()) / getSeconds();
    speedNumber.setText(Utility.formatDecimal(speed, 2));
}
 
开发者ID:SailFlorve,项目名称:RunHDU,代码行数:27,代码来源:RunningActivity.java

示例12: moveToMe

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
private void moveToMe(BDLocation location)
{
    MapStatusUpdate mapUpdate=MapStatusUpdateFactory.zoomTo(18);
    baiduMap.setMapStatus(mapUpdate);
    //开始移动
    MapStatusUpdate mapLatlng=MapStatusUpdateFactory.newLatLng(new LatLng(location.getLatitude(),location.getLongitude()));
    baiduMap.setMapStatus(mapLatlng);
    //显示我的位置
    MyLocationData.Builder locationBuilder=new MyLocationData.Builder();
    locationBuilder.latitude(location.getLatitude());
    locationBuilder.longitude(location.getLongitude());
    MyLocationData locationData=locationBuilder.build();
    baiduMap.setMyLocationData(locationData);
    //显示用户所在地附近
    Toast.makeText(this,"您当前在"+location.getAddrStr()+"附近",Toast.LENGTH_SHORT).show();
}
 
开发者ID:WindFromFarEast,项目名称:SmartButler,代码行数:17,代码来源:LocationActivity.java

示例13: initMapSetting

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
private void initMapSetting() {

        mMapView.showZoomControls(false);

        mBaiduMap = mMapView.getMap();
        // 开启定位图层
        mBaiduMap.setMyLocationEnabled(true);
        //设置指南针
//        UiSettings uiSettings = mBaiduMap.getUiSettings();
//        uiSettings.setCompassEnabled(true);

        mBaiduMap.setCompassPosition(new Point(660,60));

        //设置普通地图
        mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
        //设置定位图层配置信息,只有先允许定位图层后设置定位图层配置信息才会生效
        mBaiduMap.setMyLocationConfiguration(new MyLocationConfiguration(
                MyLocationConfiguration.LocationMode.NORMAL, false, null));
        mBaiduMap.setBuildingsEnabled(false);

        //设置缩放级别
        MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(16.0f);
        mBaiduMap.setMapStatus(msu);

    }
 
开发者ID:funnyzhaov,项目名称:Tribe,代码行数:26,代码来源:NearbyFragment.java

示例14: iniMap

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
/**
 * iniMap 初始化地图
 */
private void iniMap() {
    LocationClientOption option = new LocationClientOption();
    option.setOpenGps(true);// 打开gps
    option.setCoorType("bd09ll"); // 设置坐标类型
    option.setScanSpan(3000);
    mCurrentMode = MyLocationConfiguration.LocationMode.NORMAL;

    // 缩放
    MapStatusUpdate msu = MapStatusUpdateFactory.zoomTo(14.0f);
    mBaiduMap.setMapStatus(msu);

    mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(mCurrentMode, true, mCurrentMarker));
    mLocClient.setLocOption(option);
    mLocClient.start();
    initOverlay();

    // 开启线程,一直修改GPS坐标
    LocationUtil.startLocaton();
}
 
开发者ID:littleRich,项目名称:VirtualLocation,代码行数:23,代码来源:MainActivity.java

示例15: navigateTo

import com.baidu.mapapi.map.MapStatusUpdateFactory; //导入依赖的package包/类
public void navigateTo(BDLocation location){
    if(isFirstLocate){
        LatLng latLng=new LatLng(location.getLatitude(),location.getLongitude());
        showToast("定位到当前位置已执行");

        MapStatusUpdate    update=MapStatusUpdateFactory.zoomTo(8f);
        baiduMap.animateMapStatus(update);
        update= MapStatusUpdateFactory.newLatLng(latLng);
        baiduMap.animateMapStatus(update);

       isFirstLocate=false;
    }
    MyLocationData.Builder locationBuilder=new MyLocationData.Builder();
    locationBuilder.latitude(location.getLatitude());
    locationBuilder.longitude(location.getLongitude());
    baiduMap.setMyLocationData(locationBuilder.build());

}
 
开发者ID:MoonRiser,项目名称:MaterialLearning,代码行数:19,代码来源:BaiduMapActivity.java


注:本文中的com.baidu.mapapi.map.MapStatusUpdateFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。