很抱歉这个愚蠢的问题,但我不明白为什么代码不起作用......
var centro= new google.maps.LatLng(0,0);
var circle = new google.maps.Circle({
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35,
map: map,
center: centro,
radius: 1000
});
// Add the circle for this city to the map.
你能帮帮我吗?
谢谢!
答案 0 :(得分:0)
看看这对你有帮助......
var circleOptions = {
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35,
map: map,
center: new google.maps.LatLng(surveyors[i][5], surveyors[i][6]),
radius: ddlRadius_value * 1609.345 // convert miles to kilometers
};
// Add the circle to the map.
var circle = new google.maps.Circle(circleOptions);
// Bind the center of the circle to the marker
circle.bindTo('center', marker, 'position');
答案 1 :(得分:0)
你的圈子位于(0,0),即非洲西部的赤道上。该地点是否可见,在地图中当前位置和缩放?
此外,radius参数以米为单位。如果你缩小得足够多,你的1000米半径的圆圈就会太小而无法看到。