gpt4 book ai didi

android - 如何在 Android 中将 LatLng 添加到 List 中?

转载 作者:太空狗 更新时间:2023-10-29 15:52:13 24 4
gpt4 key购买 nike

我有 2 个列表。

double pointY[]={105.45526,105.57364,105.53505,105.45523,105.51962,105.77320}
double pointX[]={9.99222,9.88347,9.84184,9.77197,9.55501,9.67768,9}

我想做一个List<LatLng>LatLng[i] = (pointX[i], pointY[i])

我有以下代码,但它不起作用:

List<LatLng> points;
for (int i = 0 ; i < pointX.length - 1; i++){
points[i].add(LatLng(pointX[i],pointY[i]));
};

我该怎么做?

最佳答案

List<LatLng> points=new ArrayList<LatLng>();
for (int i = 0 ; i < pointX.length; i++){
points.add(new LatLng(pointX[i],pointY[i]));
};

关于android - 如何在 Android 中将 LatLng 添加到 List<LatLng> 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30482305/

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