﻿// JScript File
	var GridRefFigure = 10;
	var map = null;
	var GeoCoder = null;
	var localSearch = new GlocalSearch();
	var icon = new GIcon();
	icon.image = "http://www.google.com/mapfiles/marker.png";
	icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	icon.iconSize = new GSize(20, 34);
	icon.shadowSize = new GSize(37, 34);
	icon.iconAnchor = new GPoint(10, 34);
    
    //<![CDATA[

    var map, timer;
    var chosen = [];
     
    /* Array of GLayers
     * The 'name' label is not being used here
    */
    /*
    var CustomLayer1 = new GGeoXml("http://www.record-lrc.co.uk/GoogleMaps/Maps/KML/rECOrd%20coverage%20boundary_region.kml");
            
    var layers = [
     { name: "Pano", obj: CustomLayer1},
     { name: "Wiki", obj: new GLayer("lmc:wikipedia_en") }
    ];
    */

    function LoadGoogleMap() {
      if (GBrowserIsCompatible()) {
		
        map = new GMap2(document.getElementById("GoogleMap"));
        map.addControl(new GLargeMapControl3D());
		//map.addControl(new GOverviewMapControl());
		//map.addControl(new GMapTypeControl());
		map.addMapType(G_PHYSICAL_MAP);
		//map.addMapType(G_SATELLITE_3D_MAP);
		
	  	// Adding custom control
	  	var hControl = new GHierarchicalMapTypeControl();
        hControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", true);
        map.addControl(hControl);
        
		// Add the self created control
        //map.addControl(new MoreControl());

	  	GeoCoder = new GClientGeocoder();
		//map.setCenter(new GLatLng(53.215902,-2.551575),20);
		map.setCenter(new GLatLng(53.215902,-2.551575),9);
      }
   }
   
   function showAddress(address) {
     var geocoder = new GClientGeocoder();
     geocoder.getLatLng(address, function(point) {
										  	if(!point) {
											  alert(address + " not found.");
											}else {
												map.setCenter(point, 14);
												}
											});
  	}
    