1
我想插入這個圈子一個谷歌地圖,地圖上顯示通過在標題下面的js文件的罰款;圈覆蓋谷歌地圖API V3 JS
/**
* Called on the intiial page load.
*/
function initialize() {
var latLng = new google.maps.LatLng(50.272213,-5.054973);
var options = {
'zoom': 9,
'center': latLng,
'mapTypeId': google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map'),
options);
}
// Register an event listener to fire when the page finishes loading.
google.maps.event.addDomListener(window, 'load', initialize);
但是,當我添加以下內容來包含它打破並且不加載的圓;
/**
* Called on the intiial page load.
*/
function initialize() {
var latLng = new google.maps.LatLng(50.272213,-5.054973);
var options = {
'zoom': 9,
'center': latLng,
'mapTypeId': google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map'),
options);
// Add a Circle overlay to the map.
var circle = new google.maps.Circle({
map: map,
center: new google.maps.LatLng(50.272213,-5.054973),
fillColor: #00FF00,
fillOpacity: 0.2,
strokeColor: #00FF00,
strokeOpacity: 0.4,
strokeWeight: 2
});
circle.setRadius(18362.55489862987);
}
// Register an event listener to fire when the page finishes loading.
google.maps.event.addDomListener(window, 'load', initialize);
如果有人能指出哪裏我去錯了,請...
感謝,這顯然不過的作品在我使用相同的代碼的wordpress網站仍然不會加載,也許有一個js衝突? – user987668
我想這可能是一個矛盾。我一直沒有用過Wordpress。你可能想問一個單獨的問題與相關的代碼。 –
所有分類感謝,需要在body標籤 – user987668