如何在谷歌地图Android上显示多重标记?

如何在谷歌地图Android上显示多重标记?,android,mysql,google-maps,google-maps-markers,Android,Mysql,Google Maps,Google Maps Markers,我在我的项目中遇到了问题,我不知道如何用数据库mySql中的经纬度数据在google地图上显示多个标记 下面是使用数组列表的代码: private class SitesOverlay extends ItemizedOverlay<OverlayItem> { private List<OverlayItem> items=new ArrayList<OverlayItem>(); public SitesOverlay(Drawable

我在我的项目中遇到了问题,我不知道如何用数据库mySql中的经纬度数据在google地图上显示多个标记

下面是使用数组列表的代码:

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();
    }
private class SitesOverlay扩展了ItemizedOverlay{
私有列表项=新的ArrayList();
公共场地航道(可牵引标记){
超级(标记);
边界中心底部(标记);
//我想改变这个,自动从mysql调用数据
添加(新的覆盖项)(getPoint(40.748963847316034,
-73.96807193756104),
“联合国”、“联合国”);
添加(新的覆盖项)(getPoint(40.76866299974387,
-73.98268461227417),
“林肯中心”,
“林肯中心爵士乐之家”);
添加(新的覆盖项)(getPoint(40.7651364353316755,
-73.97989511489868),
“卡内基音乐厅”,
“你去哪里练习,练习,练习”);
添加(新的覆盖项)(getPoint(40.70686417491799,
-74.01572942733765),
“市中心俱乐部”,
“海斯曼奖杯的发源地”);
填充();
}

我认为您可以创建一个类作为位置来获取属性

对于Position类,调用该方法来检索地理位置点,方法是使用关键字来实现搜索位置并返回地理位置的功能

使用该类我喜欢它:它有示例

SimpleItemizedOverlay itemizedoverlay = new MyItemizedOverlay(drawable, this);
GeoPoint point = new GeoPoint((int)(37.878901f * 1e6),(int)(-4.779396 * 1e6));
OverlayItem overlayitem = new OverlayItem(point, "Hello, World!", "I'm in Spain!");
.
.
.
GeoPoint point = new GeoPoint((int)(37.878901f * 1e6),(int)(-4.779396 * 1e6));
OverlayItem overlayitem = new OverlayItem(point, "Hello, World!", "I'm in Spain!");

itemizedoverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedoverlay);