Ho provato a fare questo ma non funziona....
codice:
<body><style type="text/css"> div#gmaps-canvas {
width:775px;
height:300px;
}
</style>
<?php
echo "OK!";
$filename = "longitudine.txt";
$handle = fopen($filename, "r");
$longitudine = fread($handle, filesize($filename));
fclose($handle);
$filename = "latitudine.txt";
$handle = fopen($filename, "r");
$latitudine = fread($handle, filesize($filename));
fclose($handle);
echo $latitudine;
echo $longitudine;
?>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?
sensor=false"></script>
<script type="text/javascript">
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest(); //Not IE
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP"); //IE
} else {
alert("Your browser doesn't support the XmlHttpRequest object.");
}
}
function initialize() {
var myLatLng = new google.maps.LatLng($latitudine,$longitudine);
var myOptions = {
zoom: 14,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("gmaps-canvas"), myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="gmaps-canvas"></div>
</body>
</html>