我正在嘗試使用Google Maps API,但是我發現文檔令人難以置信地混淆。有誰知道如何找到地面覆蓋圖像的座標?如何查找谷歌地圖地面覆蓋圖的座標?
我在這裏複製了代碼(https://developers.google.com/maps/documentation/javascript/overlays#GroundOverlays)並使用我的圖像在我的網站上工作。但是,當我嘗試將紐瓦克的座標更改爲我的位置時,圖像完全不顯示。我剛剛猜測了imageBounds的座標,我猜這就是導致它不起作用的原因。非常感激任何的幫助。
這是我的代碼(經緯度座標從例如複製):
function initialize() {
var newark = new google.maps.LatLng(40.740, -74.18);
var imageBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(40.712216,-74.22655),
new google.maps.LatLng(40.773941,-74.12544));
var myOptions = {
zoom: 13,
center: newark,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var oldmap = new google.maps.GroundOverlay(
"http://www.mcography.com/beta/Accessibility_Map.png",
imageBounds);
oldmap.setMap(map);
}
你把座標改成了什麼?你能粘貼你所嘗試的嗎? –
var newark = new google.maps.LatLng(41.265437,-95.947405); \t VAR imageBounds =新google.maps.LatLngBounds( \t新google.maps.LatLng(41.270969,-95.958889), \t新google.maps.LatLng(41.270872,-95.938718)); – mcography