0

我能够实现SKAnnotation在其中设置单个注释skmaps 现在我只想在skmaps地图 android中添加多个注释
所以这里是代码片段.. 任何帮助将不胜感激....

SKAnnotation annotation1 = new SKAnnotation(10);
// set annotation location
annotation1.setLocation(new SKCoordinate(-122.4200, 37.7765));
// set minimum zoom level at which the annotation should be visible
annotation1.setMininumZoomLevel(5);
// set the annotation's type
annotation1.setAnnotationType(SKAnnotation.SK_ANNOTATION_TYPE_RED);
// render annotation on map
mapView.addAnnotation(annotation1, SKAnimationSettings.ANIMATION_NONE);

我到处看了看,没有得到任何有用的信息来实现这个.....

4

1 回答 1

5

创建一个包含多个坐标数据的数组。使用 for 循环为数组中的每个对象创建注释。像这样:

for(int i=0;i<coordinatesArray.count;i++) {
SKAnnotation annotation1 = new SKAnnotation(10);
// set annotation location
annotation1.setLocation(new SKCoordinate(latitude, longitude));
// set minimum zoom level at which the annotation should be visible
annotation1.setMininumZoomLevel(5);
// set the annotation's type
annotation1.setAnnotationType(SKAnnotation.SK_ANNOTATION_TYPE_RED);
// render annotation on map
mapView.addAnnotation(annotation1, SKAnimationSettings.ANIMATION_NONE);
}

从您的坐标数组对象 i 中获取纬度和经度

于 2015-07-05T19:14:25.790 回答