miércoles, 4 de febrero de 2009

Funcionetes utils Google Maps.

Punt central del mapa:
GLatLng = map.getCenter();

Extrems del mapa:
GLatLngBounds = map.getBounds();


Distàncies entre extrems i centre del mapa:

west = new GLatLng(map.getBounds().getSouthWest().lat(), map.getCenter().lng());
top = new GLatLng(map.getCenter().lat(), map.getBounds().getSouthWest().lng());
alert("Radi vertical (m):"+west.distanceFrom(center)+ "\nRadi horitzontal (m):"+top.distanceFrom(center));


Posicionament mapa:
GEvent.addListener(map, "mousemove", function(point){
document.getElementById("EXEMPLE").innerHTML = point.toString();
});