我的问题是,当我第一次加载页面时它没有出错,但是当我切换回此地图或从另一个选项卡切换回来时,它给了我以下错误消息:无效参数。行:26 字符:56 代码:0 URI:http ://maps.gstatic.com/intl/en_us/mapfiles/api-3/9/9/main.js
请帮助我的代码在这里... :(
$start1=$makers['lat'];
$start2=$makers['lng'];
$name1=$makers['name'];
$end1=$makere['lat'];
$end2=$makere['lng'];
$name2=$makere['name'];
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
var cenLatlng = new google.maps.LatLng(<?php echo $start1;?>, <?php echo $start2;?>);
var myOptions = {
zoom: 15,
center: cenLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_det-<?php echo $trip_id;?>"),myOptions);
var myLatlng = new google.maps.LatLng(<?php echo $start1;?>, <?php echo $start2;?>);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"<?php echo $name1;?>"
});
var contentString = '<?php echo $name1;?>';
var infowindow = new google.maps.InfoWindow({
content: contentString,
width:100,
height:50
});
// Start of newly added code block
google.maps.event.addListener(marker, 'click', function() {
<?
$sql2=mysql_fetch_array(mysql_query("select pickpoint from trip_tbl where trip_id='$trip_id'"));
$pickpoint=$sql2['pickpoint'];
$makers1=mysql_fetch_array(mysql_query("select * from markers where id='$pickpoint'"));
$name1=$makers1['name'];
?>
alert("<?=$name1;?>");
});
});
//]]>
</script><div id="map_det-<?php echo $trip_id;?>" style="width:300px; height:200px; border:solid; border-color:#666; "></div>