1
我想实现谷歌地图的功能,需要揣摩出在我的代码下面的脚本应该位于:
google.maps.event.addDomListener(window, 'load', initialize);
function initialize() {
var myLatLng = new google.maps.LatLng(<?php echo $latitude; ?>, <?php echo $longitude; ?>);
var myOptions = {
zoom: 15,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map-canvas-1"),myOptions);
var myOptions2 = {
zoom: 15,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.HYBRID
}
map2 = new google.maps.Map(document.getElementById("map-canvas-2"),myOptions2);
var myOptions3 = {
zoom: 15,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.SATELLITE
}
map3 = new google.maps.Map(document.getElementById("map-canvas-3"),myOptions3);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title:"Map1" });
var marker = new google.maps.Marker({
position: myLatLng,
map: map2,
title:"Map2" });
var marker = new google.maps.Marker({
position: myLatLng,
map: map3,
title:"Map3" });
map3.getStreetView().setPosition(myLatLng);
map3.getStreetView().setVisible(true);
}
目前,该代码是$内(文件{。就绪(函数(),它似乎做工精细,但它会导致下面的jQuery/AJAX功能停止工作:
jQuery.ajax({
url: sURL + 'billingEventDetail/ajaxGetTaxClasses/',
dataType: 'json',
success: function(data) {
taxClassData = data;
jQuery.each(taxClassData.description , function(key, value){
jQuery('#sel_tax_class').append(new Option(value, key));
});
}
});
jQuery.ajax({
url: sURL + 'billingEventDetail/ajaxGetBillingEventDetails/',
dataType: 'json',
success: function(data) {
taxQualifierData = data;
jQuery.each(taxQualifierData.description , function(key, value){
jQuery('#sel_tax_qualifier').append(new Option(value, key));
});
}
});
W如果我暂时禁用谷歌地图代码,那么JQuery/Ajax将再次开始工作。为什么我有问题让这两个代码一起工作?也许谷歌地图代码不NEET是$内(文件{。就绪(函数()??
没有人有任何想法我吗?
谷歌地图部分不需要在$(文档{.ready(函数(),跳过其余的jquery也 –