更新时间:2022-11-01 23:41:36
使用这样的:
for (int i = 0; i < yourArrayList.size(); i++) {
double lati=Double.parseDouble(pins.get(i).latitude);
double longLat=Double.parseDouble(pins.get(i).longitude);
MAP.addMarker(new MarkerOptions().position(new LatLng(lati,longLat)).title(pins.get(i).pinname).snippet(pins.get(i).address));
}
或者你也可以使用这样的:
Or you can also use this:
for(int pin=0; pin<pins.size(); pin++)
{
LatLng pinLocation = new LatLng(Float.parseFloat(pins.get(pin).latitude), Float.parseFloat(pins.get(pin).longitude));
Marker storeMarker = map.addMarker(new MarkerOptions()
.position(pinLocation)
.title(pins.get(pin).pinname)
.snippet(pins.get(pin).address)
);
}
其中纬度和经度是您具有存储在你的ArrayList不同名称的字符串.....
where latitude and longitude is the String to which you have store in your arraylist with different name.....