zoukankan      html  css  js  c++  java
  • Android GIS开发系列-- 入门季(9) 定位当前的位置

    利用MapView定位当前的位置

    这里要用到Arcgis中的LocationDisplayManager这个类,由于比较简单。直接上代码:

    LocationDisplayManager locationDisplayManager =  mMapView.getLocationDisplayManager();//获取定位类
    locationDisplayManager.setShowLocation(true);
    locationDisplayManager.setAutoPanMode(LocationDisplayManager.AutoPanMode.LOCATION);//设置模式
    locationDisplayManager.setShowPings(true);
    locationDisplayManager.start();//开始定位


    由于是定位,在AndroidManifest文件中,要添加以下权限:
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    另外如果我们想获取定位点的位置,调用代码:Point point = locationDisplayManager.getPoint();即可获取。
    定位当前位置




  • 相关阅读:
    申请奖励加分
    寒假学习01
    加分项及建议
    12月30日总结
    12月17日 期末总结
    12月31日总结
    12月15日总结
    12月28日总结
    01月03日总结
    01月05日总结
  • 原文地址:https://www.cnblogs.com/arxive/p/7751967.html
Copyright © 2011-2022 走看看