gpt4 book ai didi

android - 如何在谷歌地图 Android 上显示多个标记?

转载 作者:行者123 更新时间:2023-11-29 03:41:14 24 4
gpt4 key购买 nike

我的项目有问题,我不知道如何使用数据库 mySql 中的经纬度数据在谷歌地图上显示多个标记..

这里是使用数组列表的代码:

private class SitesOverlay extends ItemizedOverlay<OverlayItem> {
private List<OverlayItem> items=new ArrayList<OverlayItem>();

public SitesOverlay(Drawable marker) {
super(marker);

boundCenterBottom(marker);


//i want change this, calling the data from mysql automatically
items.add(new OverlayItem(getPoint(40.748963847316034,
-73.96807193756104),
"UN", "United Nations"));
items.add(new OverlayItem(getPoint(40.76866299974387,
-73.98268461227417),
"Lincoln Center",
"Home of Jazz at Lincoln Center"));
items.add(new OverlayItem(getPoint(40.765136435316755,
-73.97989511489868),
"Carnegie Hall",
"Where you go with practice, practice, practice"));
items.add(new OverlayItem(getPoint(40.70686417491799,
-74.01572942733765),
"The Downtown Club",
"Original home of the Heisman Trophy"));

populate();
}

最佳答案

我认为你可以创建一个类作为 Positions 来取回属性

对于Position类,通过实现使用Keywords搜索位置的函数调用获取地理位置点的方法,返回地理位置

关于android - 如何在谷歌地图 Android 上显示多个标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13580374/

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