How can I set the birds eye view as a default?

Hi,
I have been playing around with the code in the new web SDK.
I'm excited that I'll be able to pass a lat long over to get the map.
But when I go to the map it is always set as regular view, not the birds eye view.
How can I set the birds eye view as a default view?

Thanks!

Code Snippet

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
<script>
var map = null;

function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
var latLong = new VELatLong(33.5074070839019, -111.94647789001467);
map.SetCenterAndZoom(latLong, 19);
map.SetMapStyle("o");
}

function SetBirdseyeOrientation(orientation)
{
style = map.GetMapStyle();
if (style == "o")
{
map.SetBirdseyeOrientation(orientation);
var be = map.GetBirdseyeScene();
var id = be.GetID();
var link = "<a href='#' onclick='SetBirdseyeScene(" + id + ")'>" + id + "</a><br />";
idList.innerHTML += link;
}
else alert("Please set the map to bird's eye view to use this feature.");
}

function SetBirdseyeScene(bsid)
{
map.SetBirdseyeScene(bsid);
}

</script>
</head>
<body onload="GetMap();" style="font-family:Arial">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<div id='buttons' style="text-align:center; width:400px">
Set Birdseye Orientation<br />
<input id="btnNorth" type="button" value="N" onclick="SetBirdseyeOrientation('North')"><br />
<input id="btnWest" type="button" value="W" onclick="SetBirdseyeOrientation('West')">
<input id="btnEast" type="button" value="E" onclick="SetBirdseyeOrientation('East')"><br />
<input id="btnSouth" type="button" value="S" onclick="SetBirdseyeOrientation('South')">
</div>
<b>Bird's eye scene ID's:</b>
<div id="idList"></div>
</body>
</html>


[2727 byte] By [mscherry] at [2008-1-8]
# 1

Hi,


If you need to set it through the map.SetMapStyle method, you'll have to attach a javascript delay timer to allow the map.LoadMap method to finish loading. Example:

Code Snippet


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
<script>
var map = null;

function GetMap()
{
map = new VEMap('myMap');
map.LoadMap(new VELatLong(33.5074070839019, -111.94647789001467));
setTimeout("map.SetMapStyle('o')",2000);

}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>

The more simple answer is just to pass it as a parameter to your load map. Eg:

map.LoadMap(new VELatLong(33.5074070839019, -111.94647789001467),null,'o');


Regards,

DerekChan at 2007-10-2 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...
# 2

Hello,

Another idea, which doesn't require a timeout, is to use the 'onobliqueenter' event

Please see Stephan Aiche's (thank you very much) comment here :

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1941924&SiteID=1

AlexandruMatei at 2007-10-2 > top of Msdn Tech,Windows Live Developer Forums,Virtual Earth: Map Control Development...

Windows Live Developer Forums

Site Classified