转换和分割 Latlong Google Map flutter 列表
我有像这样的 Latlong Google Maps Flutter 响应:
I/flutter (21690): [LatLng(-6.435887849941857, 106.85601130127908), LatLng(-6.4333171563046, 106.85805916786194), LatLng(-6.434791741881702, 106.8591035529971), LatLng(-6.436753407158089, 106.85817148536444)]
我想像这样转换和分割:
[ [ -6.435887849941857, 106.85601130127908 ],[ -6.4333171563046, 106.85805916786194 ],[ -6.434791741881702, 106.8591035529971 ],[ -6.436753407158089, 106.85817148536444 ] ]
感谢您的所有评论。
I have Latlong Google Maps Flutter response like this:
I/flutter (21690): [LatLng(-6.435887849941857, 106.85601130127908), LatLng(-6.4333171563046, 106.85805916786194), LatLng(-6.434791741881702, 106.8591035529971), LatLng(-6.436753407158089, 106.85817148536444)]
I want to convert and split like this:
[ [ -6.435887849941857, 106.85601130127908 ],[ -6.4333171563046, 106.85805916786194 ],[ -6.434791741881702, 106.8591035529971 ],[ -6.436753407158089, 106.85817148536444 ] ]
Thanks for all comments.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢 pskink 的最简单方法是映射:
其他解决方案:
您可以在列表中循环并添加到新列表:
或改为
forEach
:The easiest way thank to pskink is mapping:
the other solutions:
You can loop in your list and add to new list:
or
forEach
instead: