﻿var gmap = null;

// Define a icon
icon = new GIcon();
icon.image = "../App_Styles/Images/organisationPoint.gif"; // URL of the image
icon.iconSize = new GSize(32, 32); // size
icon.iconAnchor = new GPoint(0, 0); // Place of icon
icon.infoWindowAnchor = new GPoint(10, 10); // place of information

function showAddress(htmlinfo, lat, lng) {
    var point = new GLatLng(lat, lng)
    var marker = new GMarker(point, icon);

    gmap.addOverlay(marker);
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(htmlinfo);
    }
    );
};

function addPoints() {
    for (var i = 0; i < popupArray.length; i++) {
        showAddress('<div class=\"officeMarker\">' + popupArray[i] + '</div>', latitudeArray[i], longitudeArray[i]);
    }
};