我試圖調用谷歌地圖api與獲取腳本,然後通過調用bmap腳本也與getscript,然後添加到相同的腳本bmap函數。這是我試圖調用谷歌地圖API和bmapsc調用谷歌地圖和bmap腳本並添加功能
$.getScript("http://maps.google.co.uk/maps?
file=api&v=2&async=2&callback=placeMap&key=my_API_key");
$.getScript("http://www.klossal.com/js/bmap/jQuery.bMap.1.3.js");
$("#map").bMap({
mapZoom: 11,
mapCenter:[51.501690392607,-0.1263427734375],
mapSidebar:"sideBar", //id of the div to use as the sidebar
markers:{"data":[
{
"lat":51.49757618329838,"lng":-0.1746654510498047,"title":"Science
Museum","body":"Exhibition Road, London SW7"
},{
"lat":51.47769451182406,"lng":-0.0009441375732421875,"title":"Royal Observatory
Greenwich","body":"Blackheath Ave, Greenwich, London SE10"
},{
"lat":51.49624032118747,"lng":-0.10857582092285156,"title":"Imperial War
Museum","body":"Lambeth, London, SE1"
},{
"lat":51.51792987720294,"lng":-0.1272869110107422,"title":"British Museum"
},{
"lat":51.495625811469374,"lng":-0.17642498016357422,"title":"Natural History
Museum","body":"Cromwell Road, London, SW7"
},{
"lat":51.50177053585362,"lng":-0.12908935546875,"title":"Churchill Museum"
}
]}
});
});
我不知道這是爲什麼不工作,有這方面的幫助將是巨大的。
控制檯上的任何錯誤我們應該注意到? –
當我用jquery加載腳本時,頁面顯示正常,我用jquery做了一些事情來打破它。 – loriensleafs
http://www.klossal.com/media/map.html在此處運行良好,但在我使用的其他站點中,我無法以此方式運行。 – loriensleafs