ok so this was a strange one... i have code written that loops through my database and pulls out markers and siplays them on my google maps... but here is my problem, last week my web hose was networksolution s, and i was on a shared web server... the code worked and ran fine. this week i changed over to a dedicated server, and trying to run the same code, when i add a point on the map and refresh, the map goes blank... and the whole map disapears. any ideas? both servers were running about the same versions of php and mysql, cant quite get my head around this one...
any help will be appreciated... if i run just the php query all by itself it runs fine and displays text... but when i run it in the map script the map just goes blank and disapears... thanks again
gt
Code:
<script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.16.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
<script type="text/javascript">
var icon = new google.maps.MarkerImage("http://maps.google.com/mapfiles/ms/micons/blue.png",
new google.maps.Size(32, 32), new google.maps.Point(0, 0),
new google.maps.Point(16, 32));
var center = null;
var map = null;
var currentPopup;
var bounds = new google.maps.LatLngBounds();
function addMarker(lat, lng, info) {
var pt = new google.maps.LatLng(lat, lng);
bounds.extend(pt);
var marker = new google.maps.Marker({
position: pt,
icon: icon,
map: map
});
var popup = new google.maps.InfoWindow({
content: info,
maxWidth: 300
});
google.maps.event.addListener(marker, "click", function() {
if (currentPopup != null) {
currentPopup.close();
currentPopup = null;
}
popup.open(map, marker);
currentPopup = popup;
});
google.maps.event.addListener(popup, "closeclick", function() {
map.panTo(center);
currentPopup = null;
});
}
function initMap() {
map = new google.maps.Map(document.getElementById("map"), {
center: new google.maps.LatLng(36.879, -96.537),
zoom: 3,
mapTypeId: google.maps.MapTypeId.HYBRID,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL
}
});
<?
$mapquery = mysql_query("SELECT * FROM worldmap WHERE memid='$id' ");
while($Mrow = mysql_fetch_array($mapquery)){
$name = $Mrow['name'];
$lat = $Mrow['latitude'];
$lon = $Mrow['longitude'];
$desc = $Mrow['description'];
echo ("addMarker($lat, $lon,'<b>$name</b><br/>$desc');\n");
}
?>
center = bounds.getCenter();
map.fitBounds(bounds);
}
</script>
</head>
<body onLoad="initMap()">
<div id="map"></div>
<?
$mapquery = mysql_query("SELECT * FROM worldmap WHERE memid='$id' ");
while($Mrow = mysql_fetch_array($mapquery)){
$name = $Mrow['name'];
$lat = $Mrow['latitude'];
$lon = $Mrow['longitude'];
$desc = $Mrow['description'];
echo ("addMarker($lat, $lon,'<b>$name</b><br/>$desc');\n");
}
?>
</body>
gt
Comment