localhost에 Google지도를 배포 할 수 있었지만 모든 좌표가 성공적으로로드되었습니다. 그러나 내 서버에 동일한 코드를 업로드 할 때로드가 완전히 실패합니다. 제가 할 수있는 모든 노력을 기울였습니다. 여기에서 분실했습니다.Google지도가 로컬 호스트에로드되지만 온라인 서버에로드되지 않습니다.
<html>
<head>
<script type='text/javascript' src='jquery-1.6.2.min.js'></script>
<script type='text/javascript' src='jquery-ui-1.8.14.custom.min.js'></script>
<style>
BODY {font-family : Verdana,Arial,Helvetica,sans-serif; color: #000000; font-size : 13px ; }
#map_canvas { width:100%; height: 100%; z-index: 0; }
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false" /></script>
<script type='text/javascript'>
jQuery(document).ready(function($){
function closeInfos(){
if(infos.length > 0){
infos[0].set("marker",null);
infos[0].close();
infos.length = 0;
}
}
//Get data, and replace it on the form
var geocoder;
var map;
var markersArray = [];
var infos = [];
geocoder = new google.maps.Geocoder();
var myOptions = {
zoom: 9,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
function deleteMarkers() {
for (var i = 0; i < markersArray.length; i++) {
markersArray[i].setMap(null);
}
markersArray = [];
}
setInterval(function(){
$.get('ajax_gp_gps.php', function(data){
var bounds = new google.maps.LatLngBounds();
var encodedString;
var stringArray = [];
encodedString = data;
stringArray = encodedString.split("****");
var x;
for (x = 0; x < stringArray.length; x = x + 1)
{
var addressDetails = [];
var marker;
addressDetails = stringArray[x].split("&&&");
var lat = new google.maps.LatLng(addressDetails[1], addressDetails[2]);
//alert(image + " " + addressDetails[1]);
marker = new google.maps.Marker({
map: map,
position: lat,
content: addressDetails[0]
});
markersArray.push(marker);
google.maps.event.addListener(marker, 'click', function() {
closeInfos();
var info = new google.maps.InfoWindow({content: this.content});
// where I have added .html to the marker object.
//infowindow.setContent(marker.html);
info.open(map,this);
infos[0]=info;
});
bounds.extend(lat);
}
map.fitBounds(bounds);
});
},1000);
});
</script>
</head>
<body>
<?php include_once("ajax_gp_gps.php"); ?>
<div id='input'>
<input type="hidden" id="encodedString" name="encodedString" value="<?php echo $encodedString; ?>">
</div>
<div id="map_canvas"></div>
</body>
</html>
경로를 업데이트했는지 확인하십시오 (에셋> jquery 및 jquery-ui) –
모든 경로가 제 위치에 있으며, 내가보고있는 것에서 오는 것일 수 있습니다. 그것에 손가락. – decongh
크롬/파이어 폭스 도구 (F12)를 확인하고 무슨 일이 일어나는지 확인할 수 있습니까? –