【发布时间】:2013-02-12 13:28:28
【问题描述】:
如果用户有纬度、经度和半径,如何在谷歌地图的某个位置(中心除外)画一个圆?
【问题讨论】:
标签: javascript jquery google-maps google-maps-api-3
如果用户有纬度、经度和半径,如何在谷歌地图的某个位置(中心除外)画一个圆?
【问题讨论】:
标签: javascript jquery google-maps google-maps-api-3
// 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');
听起来如果你有你想要的纬度/经度和半径,那么你可以在地图上的某个地方定义一个点,然后将一个圆绑定到那个点。
【讨论】:
google.maps.CircleOptions
【讨论】: