﻿var map = null;
var pinid = 0;
var icon = "<img src='/images/mapIcon.jpg' style='border: solid 1px #000;' alt='' />";

function GetMap() {
    map = new VEMap('officesMap');
    map.LoadMap(new VELatLong(32.9164853473144, -98.83300781250001), 4);
}

function AddPushpin(latitude, longitude, title, address) {
    var shape = new VEShape(VEShapeType.Pushpin, new VELatLong(latitude, longitude));

    // Set the icon
    shape.SetCustomIcon(icon);

    // Set the info box
    map.ClearInfoBoxStyles();
    shape.SetTitle("<h3>" + title + "</h3>");
    shape.SetDescription("<div style='width: 100px;'><a href='http://www.bing.com/maps/?v=2&cp=" + latitude + "~" + longitude + "&lvl=16&sty=h&rtp=adr.~pos." + latitude + "_" + longitude + "_" + address + "___e_&mode=D&rtop=0~0~0~' target='_new'>driving directions</a></div>");

    // Add the shape the the map
    map.AddShape(shape);
    pinid++;
}

