iOS 高德地图怎么在屏幕内显示所有的Marker
1个回答
展开全部
list是一个List,遍历List然后调用AMap对象的addMarker()方法就好。
for (int i = 0; i < list.size(); i++) {
MarkerOptions marker = list.get(i);
aMap.addMarker(marker);
}
关于MarkerOptions的创建:
MarkerOptions option = new MarkerOptions();
//设置坐标点
option.position(new LatLng(lat, lng));
移除marker
List saveMarkerList = aMap.getMapScreenMarkers();
if (saveMarkerList == null || saveMarkerList.size() <= 0)
return;
for (Marker marker : saveMarkerList) {
marker.remove();
}
希望能帮到你...
for (int i = 0; i < list.size(); i++) {
MarkerOptions marker = list.get(i);
aMap.addMarker(marker);
}
关于MarkerOptions的创建:
MarkerOptions option = new MarkerOptions();
//设置坐标点
option.position(new LatLng(lat, lng));
移除marker
List saveMarkerList = aMap.getMapScreenMarkers();
if (saveMarkerList == null || saveMarkerList.size() <= 0)
return;
for (Marker marker : saveMarkerList) {
marker.remove();
}
希望能帮到你...
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询