Finding the latitude and longitude of a birdseyeview window

This Page is locked
Modified: 2007/06/16 02:21 by ViaVE Visitor
Here is an updated function for getting the mapview for both birds eye and normal views:

//gets the map top left and bottom right lat lon
function getMapView(){
    var result;
    if(map.GetMapStyle()==VEMapStyle.Birdseye){
        //build view decoding latlongs
        result = getBirdsEyeMapView();
    }
    else{
        //get view from map
        result = map.GetMapView();
    }
    return result;
}

//gets the map view rectangle for a birds eye scene function getBirdsEyeMapView(){ var result; var v = map.GetMapView(); var dc = new VELatLongDecoder; var tl = dc.Decode(v.TopLeftLatLong); var br = dc.Decode(v.BottomRightLatLong); //check birds eye direction and correct rectangle var be = map.GetBirdseyeScene();

//need to flip some lat long if the scene has been rotated switch(be.GetOrientation()){ case VEOrientation.North: result = new VELatLongRectangle(tl,br,null,null); break; case VEOrientation.East: //flip long result = new VELatLongRectangle(new VELatLong(tl.Latitude,br.Longitude),new VELatLong(br.Latitude,tl.Longitude),null,null); break; case VEOrientation.South: //flip lat and long result = new VELatLongRectangle(br,tl,null,null); break; case VEOrientation.West: //flip lat result = new VELatLongRectangle(new VELatLong(br.Latitude,tl.Longitude),new VELatLong(tl.Latitude,br.Longitude),null,null); break; } return result;
}