Ai esta um exemplo básico do que seria, eu preciso de uma maneira de passar o valor das variáveis zoom e coords para ser trabalhadas em outra linguagem, o ideal seria escrever em um arquivo de texto ou xml, mas no javascript é aquele velho problema.... Se você tiver qualquer sugestão ai... Vlw <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example: Simple Map</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYu
ghuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) { //Testa se browser é compativel
var zoom=13
var coords=new GLatLng(37.4419, -122.1419) //coordenada
var map = new GMap2(document.getElementById("map_canvas")); //cria o mapa
map.setCenter(coords, zoom); //seta o mapa na coordenada e zoom indicados
GEvent.addListener(map, "zoomend", function(oldlevel,newlevel) {//evento mudança de zoom
zoom=newlevel; //novo zoom
document.write(zoom)
});
GEvent.addListener(map, "dragend", function() { // evento "arraste" do mapa
coords=map.getCenter(); //novas coordenadas do centro do mapa
});
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>