﻿var gmap = null;

// Define a icon
    icon = new GIcon();
    icon.image = "../App_Styles/Images/organisationPoint.jpg"; // URL of the image
    icon.iconSize = new GSize(8, 8); // size
    icon.iconAnchor = new GPoint(0, 0); // Place of icon
    icon.infoWindowAnchor = new GPoint(10, 17); // place of information
   

function showAddress(htmlinfo, lat , lng, type)
{
    var point = new GLatLng(lat, lng)
    if (type == 1) {
        icon.image = "../App_Styles/Images/organisationPoint2.jpg"; // URL of the image
    } else if (type == 2) {
    icon.image = "../App_Styles/Images/organisationPoint.jpg"; // URL of the image
} else {
icon.image = "../App_Styles/Images/organisationPoint3.jpg"; // URL of the image     
     }
    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 style=\"width:260px;height:250px;overflow-y:scroll;margin-top:10px;\">' + popupArray[i] + '</div>', latitudeArray[i], longitudeArray[i], orgtypeArray[i]);

    }
};