sumit72


I would like to convert my v4 map to v5 so I can utilize the small dashboard.
I tried to simply substitute the new <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx v=5" ></script>,
but got "Error VELayerSpecification is undefined". Clearly, I'm not a computer person, so can someone please show me the changes I have to make to convert the page to v5.
(It would save me a lot of time staring at this code and being confused).

Greatly appreciated.


<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<!-- #BeginEditable "doctitle" -->
<title>New Page 1</title>
<meta name="keywords" content=" ">
<meta name="description" content=" ">
<!-- #EndEditable -->
<link href="support-files/styles2.css" rel="stylesheet" type="text/css">

<!-- #BeginEditable "map" -->


<script>
var map = null;

function OnPageLoad()
{
map = new VEMap('MapDiv');
map.onLoadMap = fnLoadCollection;
map.LoadMap(new VELatLong(45.567909, 25.620117), 6 ,'r' , false);
map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
}

function fnLoadCollection()
{
var veLayerSpec = new VELayerSpecification();
veLayerSpec.Type = VELayerType.VECollection;
veLayerSpec.ID = "MYLAYER";
veLayerSpec.LayerSource = "CCD5DFDC11361B33!103"; //Romanian Hostels

map.AddLayer(veLayerSpec);
}

</script>

<style type="text/css">
.dashboard {top:-7px!important; left:-7px!important;}
</style>


<!-- #EndEditable -->


</head>


<body bgcolor="#A5D4E3" topmargin="0" onLoad="OnPageLoad()">




Re: Convert Virtual Earth v4 to v5?

Derrick


Code Snippet

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx v=5" ></script>
<!-- #BeginEditable "doctitle" -->
<title>New Page 1</title>
<meta name="keywords" content=" ">
<meta name="description" content=" ">
<!-- #EndEditable -->
<link href="support-files/styles2.css" rel="stylesheet" type="text/css">

<!-- #BeginEditable "map" -->


<script>
var map = null;

function OnPageLoad()
{
map = new VEMap('MapDiv');

map.SetDashboardSize(VEDashboardSize.Small);
map.onLoadMap = fnLoadCollection;
map.LoadMap(new VELatLong(45.567909, 25.620117), 6 ,'r' , false);
map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
}

function fnLoadCollection()
{
var veLayerSpec = new VEShapeSourceSpecification(VEDataType.VECollection, "CCD5DFDC11361B33!103"); //Romanian Hostels
map.ImportShapeLayerData(veLayerSpec, null, true);
}

</script>

<style type="text/css">
.dashboard {top:-7px!important; left:-7px!important;}
</style>


<!-- #EndEditable -->


</head>


<body bgcolor="#A5D4E3" topmargin="0" onLoad="OnPageLoad()">