【问题标题】:Google maps text for circles谷歌地图文字的圈子
【发布时间】:2016-04-17 18:10:52
【问题描述】:

在地图上画一个圆圈很容易:

https://developers.google.com/maps/documentation/javascript/examples/circle-simple

但是,如果我在一个点周围画一个圆,我还想向用户表明半径有多大,有没有办法在圆上(例如在周长上)添加指示半径的文本?

【问题讨论】:

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


【解决方案1】:

为谷歌地图添加一个好的时尚文本的简单方法是使用谷歌地图实用程序,在你的情况下是 yh js-map-label

https://github.com/googlemaps/js-map-label

查看此示例页面查看源:https://googlemaps.github.io/js-map-label/examples/maplabel.html

    var mapLabel = new MapLabel({
      text: 'Test',
      position: new google.maps.LatLng(34.03, -118.235),
      map: map,
      fontSize: 35,
      align: 'right'
    });
    mapLabel.set('position', new google.maps.LatLng(34.03, -118.235));

    var marker = new google.maps.Marker();
    marker.bindTo('map', mapLabel);
    marker.bindTo('position', mapLabel);
    marker.setDraggable(true);

【讨论】:

    猜你喜欢
    • 2017-10-01
    • 1970-01-01
    • 2012-12-13
    • 2012-12-05
    • 2017-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多