【问题标题】:Can a markerwithlabel be used with a google.maps.circle?可以将markerwithlabel 与google.maps.circle 一起使用吗?
【发布时间】:2016-05-10 22:52:03
【问题描述】:

对于不同的场景,我有不同类型的标记,即表示一个项目的普通标记,将多个项目表示为一个区域的自定义标记以及当太多项目位于同一区域而无法整齐显示时的圆形标记。

我最初使用infobox 作为自定义标记的标签,但是当标记重叠时标签难以辨认,因此在帮助下我将其更改为 markerwithlabel 以解决问题。

我还使用信息框作为圆形标记的标签 - 但我只想使用一种类型的标签,所以我想知道 markerwithlabel 是否可以用于 google.maps.circle 而不是信息框?

circleOpts: {
   strokeColor: '#FF0000',
   strokeOpacity: 0.8,
   strokeWeight: 2,
   fillColor: '#FF0000',
   center: someCenterPosition,
   radius: someRegionRadius
};

var circle = new google.maps.Circle(circleOpts);
circle.position = circleOpts.center;

【问题讨论】:

    标签: javascript google-maps google-maps-api-3 marker infobox


    【解决方案1】:

    很遗憾,当前的 google-maps-api-3 不允许将标签放置在圆形和多边形等形状上。现在你可以使用额外的库MapLabel for Google Maps V3

    【讨论】:

      猜你喜欢
      • 2014-11-12
      • 2012-06-22
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 2020-08-04
      • 2018-10-23
      • 2011-02-22
      • 2021-03-16
      相关资源
      最近更新 更多