【问题标题】:Differentiate two markers at same place in android区分android中同一位置的两个标记
【发布时间】:2015-05-29 06:41:22
【问题描述】:

在代码中显示标记,但如果许多标记具有相同的纬度和经度,则生成的图标必须具有不同的颜色,或者必须稍微移动一点,以便我们必须能够找到它在那个位置。有可能吗?

private void drawMarker(LatLng point, TextView icTag) {
    Bitmap icBitmap = null;
    icGen.setStyle(IconGenerator.STYLE_ORANGE);
    icGen.setContentRotation(0);
    icGen.setContentPadding(10,10,10,10);
    tvImage.setTypeface(imageFont);
    icGen.setContentView(tvImage);
    icBitmap = icGen.makeIcon();

    MarkerOptions markerOptions = new MarkerOptions()
            .position(latlng)
            .snippet("" + snip).position(point)
            .icon(BitmapDescriptorFactory
                    .fromBitmap(icBitmap));
    marker = googleMap.addMarker(markerOptions);

}

【问题讨论】:

  • 使用谷歌地图聚类..
  • 为什么要在同一个坐标处设置多个标记?这很奇怪。
  • @NachoRamosSánchez 请参阅我列出了一个组中的所有可用用户 w.r.t 他们的位置。如果它们在同一位置,则只有数组中的最近标记可见,其他标记可用,但视觉上我们无法区分

标签: android google-maps android-mapview android-maps-utils


【解决方案1】:

您可以在代码中设置一些逻辑,以便旧项目更大或具有不同的颜色或具有不同的锚点。 当然,您需要在执行此操作之前检查点的距离,我建议使用适合此类任务的聚类

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-05
    • 1970-01-01
    相关资源
    最近更新 更多