gpt4 book ai didi

android - 将纬度和经度转换为 esri arcGIS MapPoint

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:21:03 24 4
gpt4 key购买 nike

我在将纬度和经度值转换为 android esri arcGIS map 点时遇到问题。这是我从 GPS 坐标获取纬度和经度值的代码:

LocationManager lm;
String towers;
double lat;
double longi;
TextView txt;

lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria crit = new Criteria();
towers = lm.getBestProvider(crit, false);
Location location = lm.getLastKnownLocation(towers);

if(location != null)
{
lat = location.getLatitude();
longi = location.getLongitude();
}

现在我有了纬度和经度值。现在我只需要将这些值转换为有效的 esri arcGIS MapPoint。谁能帮帮我?

提前致谢。

最佳答案

假设您使用的是 ESRI Android API?如果是这样,请在您的 map 上创建一个图形层。然后创建点对象

com.esri.core.geometry.Point
Point myPoint = new Point();

然后设置 x/y 值:

myPoint.setX(longi);
myPoint.setY(lat);

然后将 myPoint 添加到图形对象。

http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/index.html

关于android - 将纬度和经度转换为 esri arcGIS MapPoint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8803726/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com