【问题标题】:Mutiliple Annotations in Skobbler(skmaps) map , how to show multiple markers in skobbler maps in androidSkobbler(skmaps) 地图中的多个注释,如何在 android 的 skobbler 地图中显示多个标记
【发布时间】:2015-06-29 09:37:31
【问题描述】:

我能够实现SKAnnotationskmaps 中设置单个注释 现在我只想在skmaps map android中添加多个注释
所以这里是代码 sn-p .. 任何帮助将不胜感激 ....

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);

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

【问题讨论】:

    标签: android google-maps marker skmaps skobbler-maps


    【解决方案1】:

    制作一个包含多个坐标数据的数组。使用 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 中获取纬度和经度

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-03
      • 1970-01-01
      • 1970-01-01
      • 2017-05-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多