﻿

window.onload = initMap;

var map = null;
var points = [];
var shapes = [];
var center = null;

function initMap() {
    var latitude = 40.6900024;
    var longitude = -73.9961813;
    LoadMap('PixaltMap', latitude, longitude, mapLoaded);
}

function mapLoaded() {
    LoadPin(center, "Pixalt Software", "115 Pacific Street #1<br/>Brooklyn, NY 11201<br/><br/>866-406-7530");
    map.SetZoomLevel(12);

}

function LoadMap(divId, latitude, longitude, onMapLoaded) {
    map = new VEMap(divId);
    options = new VEMapOptions();
    options.EnableBirdseye = true;

    // Makes the control bar less obtrusize.
    map.SetDashboardSize(VEDashboardSize.Small);

    if (onMapLoaded != null)
        map.onLoadMap = onMapLoaded;
    if (latitude != null && longitude != null) {
        center = new VELatLong(latitude, longitude);
    }

    map.LoadMap(center, null, null, null, null, null, null, options);
}

function LoadPin(LL, name, description) {
    var shape = new VEShape(VEShapeType.Pushpin, LL);

    //Make a nice Pushpin shape with a title and description
    shape.SetTitle("<span class=\"pinTitle\"> " + escape(name) + "</span>");
    if (description !== undefined) {
        shape.SetDescription("<p class=\"pinDetails\">" +
        escape(description) + "</p>");
    }

    map.AddShape(shape);
    points.push(LL);
    shapes.push(shape);

}


