﻿/// <reference path="Microsoft/VeJavaScriptIntellisenseHelper.js" />

var _map = null;

$(document).ready(function () {
    var interval = setInterval(function () {
        if ((eval("typeof VEMap") != "undefined") && (document.getElementById("map").attachEvent != undefined)) {
            clearInterval(interval);
            loadMap(); 
        }
    }, 10);
});

function loadMap() {
    var area = new VELatLong(53.721573986345, -1.8685);
    var office = new VELatLong(53.7220, -1.86888);

    _map = new VEMap("map");
    _map.LoadMap(area, 1, VEMapStyle.BirdseyeHybrid, false);
    //_map.AttachEvent("onendpan", function () { console.log(_map.GetCenter()) });

    var shape = new VEShape(VEShapeType.Pushpin, office);
    shape.SetCustomIcon("/content/images/ink-tag.png");
    shape.SetTitle("Ink Digital Agency");
    shape.SetDescription("The Elsie Whiteley Innovation Centre, Hopwood Lane, Halifax, HX1 5ER");
    _map.AddShape(shape);
}
