﻿// JScript File

/*
This GoogleMap solution is a simple solution that takes advantage of the GoogleAPIs built in
support for two formats, namely GeoRSS and KML.

The GeoRSS file (which has a lat/long ref is passed as an argument to the map.addOverlay function.

The GeoRSS co-ordinates are now part of the CMS RSS feeds if the url of the feed includes ?georss=true

This function gets passed the GeoRSS feed url from the code behind of the user control.

N.B. The Google server must have access to your feed.
*/

//declare the Google map for use later
var map;

//set up the map when the page loads
function load(feedurl) {

//alert(window.location.host);

//if the Browser supports GoogleMaps create one in the map div and load in the RSS feed.
if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        
        var gx = new GGeoXml(feedurl);
        map.addOverlay(gx);

        map.setCenter(new GLatLng(53.8104,-1.6301), 10);
        
        //add some zoom controls etc.
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
      }
}

