【问题标题】:How to draw a circle in google-map [duplicate]如何在谷歌地图中画一个圆圈[重复]
【发布时间】:2013-02-12 13:28:28
【问题描述】:

如果用户有纬度、经度和半径,如何在谷歌地图的某个位置(中心除外)画一个圆?

【问题讨论】:

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


【解决方案1】:
// Create marker 
var marker = new google.maps.Marker({
  map: map,
  position: new google.maps.LatLng(53, -2.5),
  title: 'Some location'
});

// Add circle overlay and bind to marker
var circle = new google.maps.Circle({
  map: map,
  radius: 16093,    // 10 miles in metres
  fillColor: '#AA0000'
});

circle.bindTo('center', marker, 'position');

听起来如果你有你想要的纬度/经度和半径,那么你可以在地图上的某个地方定义一个点,然后将一个圆绑定到那个点。

Source

【讨论】:

    【解决方案2】:

    Here you go!

    google.maps.CircleOptions
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-11
      • 2016-07-30
      • 1970-01-01
      • 1970-01-01
      • 2018-11-17
      • 1970-01-01
      • 1970-01-01
      • 2015-01-04
      相关资源
      最近更新 更多