﻿/*

* Google maps activation

*/

var map;

function gMapLoad(containerElementID, latitude, longitude, zoomLevel) {

    if (GBrowserIsCompatible()) {

        map = new GMap2(document.getElementById(containerElementID));

        map.setCenter(new GLatLng(latitude, longitude), zoomLevel);

        map.setMapType(G_NORMAL_MAP);

        map.addControl(new GSmallZoomControl3D());

        var shIcon = new GIcon(G_DEFAULT_ICON);
        shIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";
        shIcon.iconSize = new GSize(32, 32);
        shIcon.shadowSize = new GSize(56, 32);
        shIcon.iconAnchor = new GPoint(16, 32);
        shIcon.infoWindowAnchor = new GPoint(16, 0); 


        markerOptions = { icon: shIcon };

        var point = new GLatLng(latitude, longitude);

        map.addOverlay(new GMarker(point, markerOptions));

    }

}

function gMapAddPoint(latitude, longitude) {

    if (GBrowserIsCompatible()) {

        if (map) {
            var shIcon = new GIcon(G_DEFAULT_ICON);

            shIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png";

            // change the properties that are different.
            shIcon.iconSize = new GSize(32, 32);
            shIcon.shadowSize = new GSize(56, 32);
            shIcon.iconAnchor = new GPoint(16, 32);
            shIcon.infoWindowAnchor = new GPoint(16, 0); 
            
            markerOptions = { icon: shIcon };

            var point = new GLatLng(latitude, longitude);

            map.addOverlay(new GMarker(point, markerOptions));
        
        }

        
        

    }

}
