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 に答える