我想:
这应该是可能的,但我还没有看到有人实现这一点。
发布于 2011-07-15 05:08:28
应该是可能的。根据此位置,HTML5 article对象返回以米为单位的精度属性。
google map api能够在给定中心点(lat,lng)和半径(以米为单位)的情况下绘制圆。
我是这样想的:
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var accuracy = position.coords.accuracy;
var centerPosition = new google.maps.LatLng(latitude, longitude);
var marker = new google.maps.Marker({
position: centerPosition,
map: //your map,
icon: //the dot icon
});
var circle = new google.maps.Circle({
center: centerPosition,
radius: accuracy,
map: //your map,
fillColor: //color,
fillOpacity: //opacity from 0.0 to 1.0,
strokeColor: //stroke color,
strokeOpacity: //opacity from 0.0 to 1.0
});
//set the zoom level to the circle's size
map.fitBounds(circle.getBounds());
https://stackoverflow.com/questions/6669037
复制相似问题