﻿var map = null;
var layerid = 1;

function GetMap() {
    map = new VEMap('myMap');
    map.SetDashboardSize(VEDashboardSize.Small);
    map.LoadMap(new VELatLong(52.231734, 21.0056768), 11, '4', false);
    //AddMyLayer(VEDataType.VECollection);
    AddPushpins(map);
}

function AddPushpins(map) {
    var latLong01 = new VELatLong(52.229259, 21.0033711);
    var icon1 = "<img src='/content/core/gfx/map/pkp.gif' />";
    var shape1 = new VEShape(VEShapeType.Pushpin, latLong01);
    shape1.SetTitle("PKP - Warszawa Centralna");
    shape1.SetCustomIcon(icon1);
    map.AddShape(shape1);

    var latLong02 = new VELatLong(52.231734, 21.0056768);
    var icon2 = "<img src='/content/core/gfx/map/pkin.gif' />";
    var shape2 = new VEShape(VEShapeType.Pushpin, latLong02);
    shape2.SetTitle("Pałac Kultury i Nauki");
    shape2.SetDescription("");
    shape2.SetCustomIcon(icon2);
    map.AddShape(shape2);

    var latLong03 = new VELatLong(52.252474, 21.051626);
    var icon3 = "<img src='/content/core/gfx/map/pkp.gif' />";
    var shape3 = new VEShape(VEShapeType.Pushpin, latLong03);
    shape3.SetTitle("PKP - Warszawa Wschodnia");
    shape3.SetDescription("");
    shape3.SetCustomIcon(icon1);
    map.AddShape(shape3);

    var latLong04 = new VELatLong(52.217777, 20.9648161);
    var icon4 = "<img src='/content/core/gfx/map/pkp.gif' />";
    var shape4 = new VEShape(VEShapeType.Pushpin, latLong04);
    shape4.SetTitle("PKP - Warszawa Zachodnia");
    shape4.SetDescription("");
    shape4.SetCustomIcon(icon4);
    map.AddShape(shape4);

    var latLong05 = new VELatLong(52.170679, 20.9722398);
    var icon5 = "<img src='/content/core/gfx/map/lot.gif' />";
    var shape5 = new VEShape(VEShapeType.Pushpin, latLong05);
    shape5.SetTitle("Port Lotniczy im. Fryderyka Chopina");
    shape5.SetDescription("");
    shape5.SetCustomIcon(icon5);
    map.AddShape(shape5);
}

function AddMyLayer(type) {
    var l = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, 'B52CCCE63645A8A0!129', l);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
}
function onFeedLoad(feed) {
    //alert('RSS or Collection loaded. There are '+feed.length+' items in this list.');
}

window.onload = GetMap;
