Hi,
I have been playing around with small earth/map integration page this
morning.
One thing I have been having an issue with is calculating a zoom level
for a static Maps url from a given LookAt range.
What I wish to know is, from a given a view in Google Earth what is
the most accurate way to convert the current 'range' to the equivalent
'zoom' amount?
Anyhow, I have been having limited success with the following...
---------------------------------------------------------------------------------
// get the data required
var lookAt = ge.getView().copyAsLookAt
(ge.ALTITUDE_RELATIVE_TO_GROUND);
var zoom = Math.round(26 - (Math.log(lookAt.getRange()) / Math.log
(2)));
// if(zoom < 0) { zoom = 0; }
// if(zoom > 21) zoom = 21; }
// build the maps url
var url = "
http://maps.google.co.uk/?ll=" +
lookAt.getLatitude() + "," + lookAt.getLongitude() +
"&z=" + zoom;
---------------------------------------------------------------------------------
Alternately, I was thinking maybe there was a way to calculate the
'sspn' (screen span) parameter from the plug-in's
getViewportGlobeBounds() method. Anyone have have any thoughts on
this? I'm sure I can work it out given time but I wondered if anyone
had anything already?
...maybe I just need more coffee :)
Thanks,
Fraser.