﻿
var hfTitleID = "";
var hfDescriptionID = "";
var shapeIconUrl = "";

function SetIconUrl(titleID, descriptionID, iconUrl)
{
    hfTitleID = titleID;
    hfDescriptionID = descriptionID;
    shapeIconUrl = iconUrl;
}

function LoadMap(iconUrl)
{
    var map = new VEMap("divMap");
    var center = new VELatLong(46.05216662276254, 13.210555315017714, 0, VEAltitudeMode.RelativeToGround);
    map.LoadMap(center, 13, VEMapStyle.Road, false, VEMapMode.Mode2D, true, 0);
    //map.HideDashboard();
    map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
    var shape = new VEShape(VEShapeType.Pushpin, center);
    shape.SetTitle(document.getElementById(hfTitleID).value);
    shape.SetDescription(document.getElementById(hfDescriptionID).value);
    var iconSpecification = new VECustomIconSpecification();
    iconSpecification.Image = shapeIconUrl;	
    shape.SetCustomIcon(iconSpecification);
    map.AddShape(shape);
}

/*
function VEWD_IbtnHover(ibtn)
{
    var ibtnSrc = ibtn.src;
    ibtn.src = ibtnSrc.replace(/Norm/,'Hover');
}

function VEWD_IbtnOut(ibtn)
{
    var ibtnSrc = ibtn.src;
    ibtn.src = ibtnSrc.replace(/Hover/,'Norm');
}*/
