完整的新手問題,但我不能工作了如何做到這一點:谷歌地圖跳轉到
http://www.warrensbakery.co.uk/plymouth.htm
我想創建一個鏈接的地圖跳轉到正確的PIN谷歌地圖上顯示地址。
預先感謝您
完整的新手問題,但我不能工作了如何做到這一點:谷歌地圖跳轉到
http://www.warrensbakery.co.uk/plymouth.htm
我想創建一個鏈接的地圖跳轉到正確的PIN谷歌地圖上顯示地址。
預先感謝您
我做了一個定製的谷歌地圖地圖的幾個地點,每次可以點擊針本身在地圖上和信息窗口會打開。我也想要我相信你在談論的東西 - 點擊地圖之外的鏈接,並在地圖上打開特定引腳的infowindow。實際上它非常簡單 - 只需將click事件設置爲引腳所具有的同一個開放infowindow事件即可。
相關的JavaScript
/* Used variables
map = the map itself
marker = the current pin
infowindow = the infowindow shown on the map
- my setup has only one infowindow and clicks just swap its content
label = the current infowindow content
*/
// Inside loop setting each pin to the map
// Click mevent for pins
google.maps.event.addListener(marker, 'click', function() {
infowindow.close;
infowindow.setContent(label);
infowindow.open(map,marker);
});
// Click event for link outside the map
$(relevantLink).click(function(){
$("html, body").animate({scrollTop:$("#yourMap").offset().top}, 500);
infowindow.close();
infowindow.setContent(label);
infowindow.open(map,marker);
return false;
});
您應詳細說明你的問題 – RAJ 2012-07-06 19:21:07
遺憾,更增添了幾分信息。希望這是有道理的 – Miles 2012-07-06 19:36:13