1

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

4

2 回答 2

6
// 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');

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

资源

于 2013-02-26T22:11:08.403 回答
0

给你

google.maps.CircleOptions
于 2013-02-26T22:10:34.980 回答