chrisuk2006
added my code here
<
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;
var clickEvent = null;
var zoomLevel = 3;
var From = "FromPostcode" + ", UK";
var To = "ToPostcode" + ", UK";
function GetMap()
{
map =
new VEMap('myMap');
map.LoadMap();
map.SetZoomLevel(zoomLevel);
txtZoom.value = zoomLevel;
map.AttachEvent(
"onclick", GetLatLong);
latLong = map.GetCenter();
divInfo.innerHTML = latLong;
}
function GetLatLong(e)
{
//Get the pixel coordinates from the click event, convert to LatLong value
var x = e.mapX;
var y = e.mapY;
pixel =
new VEPixel(x, y);
latLong = map.PixelToLatLong(pixel);
divInfo.innerHTML = latLong;
}
function SetCenterAndZoom()
{
map.SetCenterAndZoom(latLong, zoomLevel);
}
function SetCenter()
{
map.SetCenter(latLong);
}
function SetZoom()
{
map.SetZoomLevel(zoomLevel);
}
function ZoomIn()
{
//Increase zoom level by a factor of 1
map.ZoomIn();
txtZoom.value = map.GetZoomLevel();
}
function ZoomOut()
{
//Decrease zoom level by a factor of 1
map.ZoomOut();
txtZoom.value = map.GetZoomLevel();
}
function ValidateEntry()
{
//Check to make sure zoom level is within range
if (txtZoom.value > 0 && txtZoom.value <= 19) zoomLevel = txtZoom.value;
else alert("Enter a value between 1 and 19.");
}
// Dashboard hide & show calls
function HideDashboard()
{
map.HideDashboard();
}
function ShowDashboard()
{
map.ShowDashboard();
}
// 3D Navigation hide & show calls
function Hide3DNav()
{
map.Hide3DNavigationControl();
}
function Show3DNav()
{
if (map.GetMapMode() == 1)
{
map.SetMapMode(VEMapMode.Mode3D);
}
map.Show3DNavigationControl();
}
// Find Control hide & show calls
function HideFindControl()
{
map.HideFindControl();
}
function ShowFindControl()
{
map.ShowFindControl();
}
// Mini Map hide & show calls
function HideMiniMap()
{
map.HideMiniMap();
}
function ShowMiniMap()
{
if (map.GetMapMode() == 2)
{
map.SetMapMode(VEMapMode.Mode2D);
}
map.ShowMiniMap(200, 100);
}
function SetScaleBar(distanceUnit)
{
map.SetScaleBarDistanceUnit(distanceUnit);
}
function GetMap()
{
map =
new VEMap('myMap');
map.LoadMap();
map.GetRoute(From, To);
}
</script>
</
head>
<
body onload="GetMap();" style="font-family: Arial">
<div id='myMap' style="position:relative; width:704px; height:500px; z-index: 100; left: 0px; top: 0px;"></div>
<input id="ShowMiniMap" type="button" value="ShowMiniMap" onclick="ShowMiniMap()" style="z-index: 113; left: 880px; position: absolute; top: 248px">
<input id="HideMiniMap" type="button" value="HideMiniMap" onclick="HideMiniMap()" style="z-index: 113; left: 756px; position: absolute; top: 248px">
<input id="ShowFindControl" type="button" value="ShowFindControl" onclick="ShowFindControl()" style="z-index: 113; left: 880px; position: absolute; top: 208px">
<input id="HideFindControl" type="button" value="HideFindControl" onclick="HideFindControl()" style="z-index: 113; left: 732px; position: absolute; top: 208px">
<input id="Show3DNav" type="button" value="Show3DNav" onclick="Show3DNav()" style="z-index: 113; left: 880px; position: absolute; top: 168px">
<input id="Hide3DNav" type="button" value="Hide3DNav" onclick="Hide3DNav()" style="z-index: 113; left: 772px; position: absolute; top: 168px">
<input id="HideDashboard()" type="button" value="HideDashboard" onclick="HideDashboard()()" style="z-index: 113; left: 880px; position: absolute; top: 128px">
<input id="ShowDashboard" type="button" value="ShowDashboard" onclick="ShowDashboard()" style="z-index: 113; left: 728px; position: absolute; top: 128px">
<input id="btnZoomOut" type="button" value="Zoom out by 1" onclick="ZoomOut()" style="z-index: 113; left: 880px; position: absolute; top: 88px">
<input id="btnZoomIn" type="button" value="Zoom in by 1" onclick="ZoomIn()" style="z-index: 113; left: 756px; position: absolute; top: 88px">
<input id="btnSetZoom" type="button" value="Set Zoom" onclick="SetZoom()" style="z-index: 113; left: 880px; position: absolute; top: 48px">
<input id="btnSetCenter" type="button" value="Set Center" onclick="SetCenter()" style="z-index: 113; left: 776px; position: absolute; top: 48px">
<input id="btnSetCZ" type="button" value="Set Center and Zoom" onclick="SetCenterAndZoom()" style="z-index: 101; left: 776px; position: absolute; top: 16px">
<input id="GetRoute" type="button" value="GetRoute" onclick="GetRoute()" style="z-index: 113 left: 840px; position: absolute; top: 284px; left: 836px;">
Click the map to select a center point.
<br />
<div id="divInfo"><br /> </div>
Zoom Level:
<input id="txtZoom" type="text" value="" onchange="ValidateEntry()"/><br />
<br />
<br />
<br />
<div id="links">
</div>
</
body>
</
html>