Google maps 谷歌地图上的简单圆圈不';行不通
很抱歉问了这个愚蠢的问题,但我不明白为什么代码不起作用Google maps 谷歌地图上的简单圆圈不';行不通,google-maps,google-maps-api-3,Google Maps,Google Maps Api 3,很抱歉问了这个愚蠢的问题,但我不明白为什么代码不起作用 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,
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.
你能帮我吗
谢谢 看看这是否有助于你
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');
你已经把你的圆的中心对准了(0,0),也就是说,在赤道上,非洲以西一点。该点在地图中的当前位置和缩放位置是否可见
此外,“半径”参数以米为单位。如果你放大的足够远,你的1000米半径的圆圈将太小而看不见。我看得很清楚。对不起,你说得对。。。我忘了半径不是以公里为单位的,所以我没有看到圆:D谢谢!