Re: GEvent.addListener onload
Take the code that is running when the map moves, put it in a function
that you can call in 2 places:
1. just after you create and initialize your map
2. inside the GEvent.addListener (where I got the code below from)
Should work, but not tested.
-- Larry
function displayCenterLatLng()
{
var center = map.getCenterLatLng();
var latLngStr = '(' + center.y + ', ' + center.x + ')';
document.getElementById("message").innerHTML = latLngStr;
var lngdeg = dec2sex (center.y, 'y');
document.getElementById("message1").innerHTML = lngdeg;
var latdeg = dec2sex (center.x, 'x');
document.getElementById("message2").innerHTML = latdeg;
}
0 Comments:
Yorum Gönder
<< Home