Add Collection To Existing map
Hello, I have seen these post on here before but none of them seem to answer my question. I was wondering how to take the code below and add a VE Collection code to that and make it so the Collection loads automaticaly. I know it is on the sdk, but i cant get it to work thanks!
(Code that I want the VE Collection to be IN)
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<script>
var map = null;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap(new VELatLong(47.22, -122.44), 12, 'r', false, VEMapMode.Mode3D, true);
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
</body>
</html>
(VE Collection Code From SDK)
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js"></script>
<script>
var map = null;
var layerid=1;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
}
function AddMyLayer(type)
{
var veLayerSpec = new VELayerSpecification();
veLayerSpec.Type = type;
veLayerSpec.ID = layerid;
veLayerSpec.LayerSource = txtSource.value;
veLayerSpec.Method = 'get';
veLayerSpec.FnCallback = onFeedLoad;
map.AddLayer(veLayerSpec);
layerid++;
}
function onFeedLoad(feed)
{
alert('RSS or Collection loaded. There are '+feed.length+' items in this list.');
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:400px; height:400px;"></div>
<INPUT id="txtSource" type="text" value="[URL or collection ID]"
name="txtSource">
<INPUT id="loadFeed" type="button" value="Load RSS" name="loadFeed"
onclick="AddMyLayer(VELayerType.GeoRSS);">
<INPUT id="loadCollection" type="button" value="Load VE Collection"
name="loadCollection" onclick="AddMyLayer(VELayerType.VECollection);">
</body>
</html>
Thanks you!

