Add analytics
[bus.git] / busui / owa / modules / base / js / includes / jquery / jquery.jmap-r72.js
blob:a/busui/owa/modules/base/js/includes/jquery/jquery.jmap-r72.js -> blob:b/busui/owa/modules/base/js/includes/jquery/jquery.jmap-r72.js
--- a/busui/owa/modules/base/js/includes/jquery/jquery.jmap-r72.js
+++ b/busui/owa/modules/base/js/includes/jquery/jquery.jmap-r72.js
@@ -1,1 +1,1361 @@
-
+/**
+ * @classDescription The Mapifies variable is the main class object for jMaps
+ */
+var Mapifies;
+
+if (!Mapifies) Mapifies = {};
+
+/**
+ * The main object that holds the maps
+ */
+Mapifies.MapObjects = {};
+
+/**
+ * Creates a new map on the passed element with the defined options.  Creates a global object that contains the map.
+ * @method
+ * @namespace Mapifies.MapObjects
+ * @id Mapifies.MapObjects.Set
+ * @alias Mapifies.MapObjects.Set
+ * @param {jQuery} element The element that contains the map.
+ * @param {Object} options An object that contains the options.
+ * @return {Object} The object that contains the map.
+ */
+Mapifies.MapObjects.Set = function ( element, options ) {
+	var mapName = jQuery(element).attr('id');
+	var thisMap = new GMap2(element);
+	Mapifies.MapObjects[mapName] = thisMap;
+	Mapifies.MapObjects[mapName].Options = options;
+	return Mapifies.MapObjects[mapName];
+};
+
+/**
+ * Adds additional objects and functions to an existing MapObject
+ * @method
+ * @namespace Mapifies.MapObjects
+ * @id Mapifies.MapObjects.Append
+ * @alias Mapifies.MapObjects.Append
+ * @param {jQuery} element The element that contains the map
+ * @param {Object} description The name of the object to create
+ * @param {Object} appending The object or function to append
+ */
+Mapifies.MapObjects.Append = function ( element, description, appending ) {
+	var mapName = jQuery(element).attr('id');
+	Mapifies.MapObjects[mapName][description] = appending;
+};
+
+/**
+ * Returns the current map object for the passed element
+ * @method
+ * @namespace Mapifies.MapObjects
+ * @id Mapifies.MapObjects.Get
+ * @alias Mapifies.MapObjects.Get
+ * @param {jQuery} element The element that contains the map.
+ * @return {Object} Mapifies The Mapifies object that contains the map.
+ */
+Mapifies.MapObjects.Get = function ( element ) {
+	return Mapifies.MapObjects[jQuery(element).attr('id')];
+};
+
+/**
+ * The main function to initialise the map
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.Initialise
+ * @alias Mapifies.Initialise
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Object} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the map object and options.
+ */
+Mapifies.Initialise = function ( element, options, callback ) {
+	/**
+	 * Default options for Initialise
+	 * @method
+	 * @namespace Mapifies.Initialise
+	 * @id Mapifies.Initialise.defaults
+	 * @alias Mapifies.Initialise.defaults
+	 * @param {String} language The locale language for the map
+	 * @param {String} mapType The type of map to create.  Options are 'map' (default), 'sat' and 'hybrid'.
+	 * @param {Object} mapCenter An array that contains the Lat/Lng coordinates of the map center.
+	 * @param {Number} mapZoom The initial zoom level of the map.
+	 * @param {String} mapControl The option for the map control.  The options are 'small' (default), 'large' or 'none'
+	 * @param {Boolean} mapEnableType Defines if the buttons for map type are shown.  Default false.
+	 * @param {Boolean} mapEnableOverview Defines if the map overview is shown.  Default false.
+	 * @param {Boolean} mapEnableDragging Defines if the map is draggable or not.  Default true.
+	 * @param {Boolean} mapEnableInfoWindows Defines if info windows are shown on the map or not.  Default true.
+	 * @param {Boolean} mapEnableDoubleClickZoom Defines if double clicking zooms the map.  Default false.
+	 * @param {Boolean} mapEnableSmoothZoom Defines if smooth scrolling is enabled.  Default false.
+	 * @param {Boolean} mapEnableGoogleBar Defines if the google map search tool is enabled.  Default false.
+	 * @param {Boolean} mapEnableScaleControl Defines if the scale bar is shown.  Default false.
+	 * @param {Boolean} mapShowjMapsIcon Defines if the jMaps icon is shown.  Default true.
+	 * @param {Boolean} debugMode Defines if the map object created is returned to the Firebug console.  Default false.
+	 * @return {Object} The options for SearchAddress
+	 */
+	function defaults() {
+		return {
+			// Initial type of map to display
+			'language': 'en',
+			// Options: "map", "sat", "hybrid"
+			'mapType': 'map',
+			// Initial map center
+			'mapCenter': [55.958858,-3.162302],
+			// Initial zoom level
+			'mapZoom': 12,
+			// Initial map control size
+			// Options: "large", "small", "none"
+			'mapControl': 'small',
+			// Initialise type of map control
+			'mapEnableType': false,
+			// Initialise small map overview
+			'mapEnableOverview': false,
+			// Enable map dragging when left button held down
+			'mapEnableDragging': true,
+			// Enable map info windows
+			'mapEnableInfoWindows': true,
+			// Enable double click zooming
+			'mapEnableDoubleClickZoom': false,
+			// Enable zooming with scroll wheel
+			'mapEnableScrollZoom': false,
+			// Enable smooth zoom
+			'mapEnableSmoothZoom': false,
+			// Enable Google Bar
+			'mapEnableGoogleBar': false,
+			// Enables scale bar
+			'mapEnableScaleControl': false,
+			// Enable the Mapifies icon
+			'mapShowjMapsIcon': true,
+			//Debug Mode
+			'debugMode': false
+		};
+	};
+	options = jQuery.extend(defaults(), options);
+	
+	if (GBrowserIsCompatible()) {
+			
+		var thisMap = Mapifies.MapObjects.Set(element, options);
+		var mapType = Mapifies.GetMapType(options.mapType);
+		thisMap.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]), options.mapZoom, mapType);
+		
+		if (options.mapShowjMapsIcon) {
+			Mapifies.AddScreenOverlay(element,
+				{
+					'imageUrl':'http://hg.digitalspaghetti.me.uk/jmaps/raw-file/3228fade0b3c/docs/images/jmaps-mapicon.png',
+					'screenXY':[70,10],
+					'overlayXY':[0,0],
+					'size':[42,25]
+				}
+			);
+		}
+		
+		// Attach a controller to the map view
+		// Will attach a large or small.  If any other value passed (i.e. "none") it is ignored
+		switch (options.mapControl) {
+			case "small":
+				thisMap.addControl(new GSmallMapControl());
+				break;
+			case "large":
+				thisMap.addControl(new GLargeMapControl());
+				break;
+		};
+		// Type of map Control (Map,Sat,Hyb)
+		if (options.mapEnableType) 
+			thisMap.addControl(new GMapTypeControl()); // Off by default
+		// Show the small overview map
+		if (options.mapEnableOverview) 
+			thisMap.addControl(new GOverviewMapControl());// Off by default
+		// GMap2 Functions (in order of the docs for clarity)
+		// Enable a mouse-dragable map
+		if (!options.mapEnableDragging) 
+			thisMap.disableDragging(); // On by default
+		// Enable Info Windows
+		if (!options.mapEnableInfoWindows) 
+			thisMap.disableInfoWindow(); // On by default
+		// Enable double click zoom on the map
+		if (options.mapEnableDoubleClickZoom) 
+			thisMap.enableDoubleClickZoom(); // On by default
+		// Enable scrollwheel on the map
+		if (options.mapEnableScrollZoom) 
+			thisMap.enableScrollWheelZoom(); //Off by default
+		// Enable smooth zooming
+		if (options.mapEnableSmoothZoom) 
+			thisMap.enableContinuousZoom(); // Off by default
+		// Enable Google Bar
+		if (options.mapEnableGoogleBar) 
+			thisMap.enableGoogleBar(); //Off by default
+		// Enables Scale bar
+		if (options.mapEnableScaleControl) 
+			thisMap.addControl(new GScaleControl());
+		
+		if (options.debugMode) 
+			console.log(Mapifies);
+		
+		if (typeof callback == 'function') 
+			return callback(thisMap, element, options);
+	} else {
+		jQuery(element).text('Your browser does not support Google Maps.');
+		return false;
+	}
+	return;
+};
+
+/**
+ * A function to move a map to a passed position
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.MoveTo
+ * @alias Mapifies.MoveTo
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Object} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the map object and options or true.
+ */
+Mapifies.MoveTo = function ( element, options, callback ) {
+	/**
+ 	 * Default options for MoveTo
+   * @method
+   * @namespace Mapifies
+   * @id Mapifies.MoveTo
+   * @alias Mapifies.MoveTo
+   * @param {String} centerMethod The element to initialise the map on.
+   * @param {String} mapType The type of map to create.  Options are 'map' (default), 'sat' and 'hybrid'.
+   * @param {Object} mapCenter An array that contains the Lat/Lng coordinates of the map center.
+   * @param {Number} mapZoom The initial zoom level of the map.
+   * @return {Function} callback The callback option with the point object and options or true.
+   */	
+	function defaults() {
+		return {
+			'centerMethod': 'normal',
+			'mapType': null,
+			'mapCenter': [],
+			'mapZoom': null
+		};
+	};
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);	
+	if (options.mapType)
+		var mapType = Mapifies.GetMapType(options.mapType);
+	var point = new GLatLng(options.mapCenter[0], options.mapCenter[1]);
+	switch (options.centerMethod) {
+		case 'normal':
+			thisMap.setCenter(point, options.mapZoom, mapType);
+		break;
+		case 'pan':
+			thisMap.panTo(point);
+		break;
+	}
+	if (typeof callback == 'function') return callback(point, options);
+};
+
+/**
+ * Save your current position on the map
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.SavePosition
+ * @alias Mapifies.SavePosition
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Object} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the map object and options or true.
+ */
+Mapifies.SavePosition = function( element, options, callback ) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	thisMap.savePosition();
+	if (typeof callback == 'function') return callback(thisMap);
+};
+
+/**
+ * Goto a previously saved position
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.GotoSavedPosition
+ * @alias Mapifies.GotoSavedPosition
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the map object and options or true.
+ */
+Mapifies.GotoSavedPosition = function ( element, options, callback) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	thisMap.returnToSavedPosition();
+	if (typeof callback == 'function') return callback(thisMap);
+};
+
+/**
+ * Create a keyboard handler to handle keyboard navigation
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.CreateKeyboardHandler
+ * @alias Mapifies.CreateKeyboardHandler
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Object} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the keyboard handler.
+ */
+Mapifies.CreateKeyboardHandler = function( element, options, callback ) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	var keyboardHandler = new GKeyboardHandler(thisMap);
+	if (typeof callback == 'function') return callback(keyboardHandler);
+};
+
+/**
+ * Check if a map container element has been resized or toggled from show/hide (Added r68)
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.CheckResize
+ * @alias Mapifies.CheckResize
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Object} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the map object handler.
+ */
+Mapifies.CheckResize = function( element, options, callback ) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	thisMap.checkResize();
+	if (typeof callback == 'function') return callback(element);
+};
+
+/**
+ * The SearchAddress function takes a map, options and callback function.  The options can contain either an address string, to which a point is returned - or reverse geocoding a GLatLng, where an address is returned
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.SearchAddress
+ * @param {jQuery} element The jQuery object containing the map element.
+ * @param {Object} options An object of options
+ * @param {Function} callback The callback function that returns the result
+ * @return {Function} Returns a passed callback function or true if no callback specified
+ */
+Mapifies.SearchAddress = function( element, options, callback) {
+	/**
+	 * Default options for SearchAddress
+	 * @method
+	 * @namespace Mapifies.SearchAddress
+	 * @id Mapifies.SearchAddress.defaults
+	 * @alias Mapifies.SearchAddress.defaults
+	 * @param {String} query The Address or GLatLng to query in the geocoder
+	 * @param {String} returnType The type of value you want to return from Google.  This is mapped to the function names available, the options are 'getLatLng' which returns coordinates, and 'getLocations' which returns points.
+	 * @param {GGeoCache} cache The GGeoCache to store the results in if required
+	 * @param {String} countryCode The country code to localise results
+	 * @return {Object} The options for SearchAddress
+	 */
+	function defaults() {
+		return {
+			// Address to search for
+			'query': null,
+			// Return Type
+			'returnType': 'getLatLng',
+			// Optional Cache to store Geocode Data (not implemented yet)
+			'cache': undefined,
+			// Country code for localisation (not implemented yet)
+			'countryCode': 'uk'
+		};
+	};
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);
+	
+	// Check to see if the Geocoder already exists in the object
+	// or create a temporary locally scoped one.
+	if (typeof thisMap.Geocoder === 'undefined') {	
+		if (typeof options.cache === 'undefined') {
+		 	var geoCoder = new GClientGeocoder();
+		} else {
+			var geoCoder = new GClientGeocoder(cache);
+		}
+		Mapifies.MapObjects.Append(element, 'Geocoder', geoCoder);
+		// We need to get the map object again, now we have attached the geocoder
+		thisMap = Mapifies.MapObjects.Get(element);
+	}
+	thisMap.Geocoder[options.returnType](options.query, function(result){
+		if (typeof callback === 'function') {
+			return callback(result, options); 
+		}
+	});
+	return;
+};
+	
+/**
+ * The SearchDirections function allows you to search for directions between two or more points and return it to a map and a directions panel
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.SearchDirections
+ * @param {jQuery} element The jQuery object containing the map element.
+ * @param {Object} options An object of options
+ * @param {Function} callback The callback function that returns the result
+ * @return {Function} Returns a passed callback function or true if no callback specified
+ */
+Mapifies.SearchDirections = function( element, options, callback) {
+	/**
+	 * Default options for SearchDirections
+	 * @method
+	 * @namespace Mapifies.SearchDirections
+	 * @id Mapifies.SearchDirections.defaults
+	 * @alias Mapifies.SearchDirections.defaults
+	 * @param {String} query The directions query to parse.  Must contain one 'from:' and one 'to:' query, but can contain multiple 'to:' queries.
+	 * @param {String} panel The ID of the panel that the directions will be sent to.
+	 * @param {String} local The local for the directions.
+	 * @param {String} travelMode Allows you to specify the travel mode, either 'driving' or 'walking'.  Driving is the default.
+	 * @param {Boolean} avoidHighways Allows you to avoid Highways/Motorway's on trips.  Please note this may not always be possible depending on the route.
+	 * @param {Boolean} getPolyline Decides if the returned result will draw a polyline on the map on the journey.  Default is True.
+	 * @param {Boolean} getSteps Decides if the textual directions are returned to the directions panel.
+	 * @param {Boolean} preserveViewport Decides if the map will zoom and center in on the directions results.
+	 * @param {Boolean} clearLastSearch Clears the last direction search if you do not want to have multiple points.
+	 * @return {Object} The options for SearchDirections
+	 */
+	function defaults() {
+		return {
+			// From address
+			'query': null,
+			// Optional panel to show text directions
+			'panel': null,
+			//The locale to use for the directions result.
+			'locale': 'en_GB',
+			//The mode of travel, such as driving (default) or walking
+			'travelMode': 'driving',
+			// Option to avoid highways
+			'avoidHighways': false,
+			// Get polyline
+			'getPolyline': true,
+			// Get directions
+			'getSteps': true,
+			// Preserve Viewport
+			'preserveViewport' : false,
+			// clear last search
+			'clearLastSearch' : false
+		};
+	};
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);
+	
+	var queryOptions = {
+		'locale': options.locale,
+		'travelMode': options.travelMode,
+		'avoidHighways': options.avoidHighways,
+		'getPolyline': options.getPolyline,
+		'getSteps': options.getSteps,
+		'preserveViewport' : options.preserveViewport
+	};
+	
+	var panel = $(options.panel).get(0);
+	
+	if (typeof thisMap.Directions === 'undefined') {
+  	Mapifies.MapObjects.Append(element, 'Directions', new GDirections(thisMap, panel));
+  }	
+	
+	GEvent.addListener(thisMap.Directions, "load", onLoad);
+  GEvent.addListener(thisMap.Directions, "error", onError);
+	
+	if (options.clearLastSearch) {
+		thisMap.Directions.clear();
+	}
+	
+	thisMap.Directions.load(options.query, queryOptions);
+	
+	function onLoad() {
+		if (typeof callback == 'function') return callback(thisMap.Directions, options);	
+	}
+	
+	function onError() {
+		if (typeof callback == 'function') return callback(thisMap.Directions, options);	
+	}
+	
+	return;
+};
+
+/**
+ * Create an adsense ads manager for the map.  The Adsense manager will parse your page and show adverts on the map that relate to this.  Requires your adsense publisher id and channel
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.CreateAdsManager
+ * @param {jQuery} element The jQuery object containing the map element.
+ * @param {Object} options An object of options
+ * @param {Function} callback The callback function that returns the result
+ * @return {Function} Returns a passed callback function or true if no callback specified
+ */
+
+Mapifies.CreateAdsManager = function( element, options, callback) {
+	/**
+	 * Default options for CreateAdsManager
+	 * @method
+	 * @namespace Mapifies.CreateAdsManager
+	 * @id Mapifies.CreateAdsManager.defaults
+	 * @alias Mapifies.CreateAdsManager.defaults
+	 * @param {String} publisherId Your Adsense publisher ID
+	 * @param {Number} maxAdsOnMap The maximum number of ads to show on the map at one time
+	 * @param {Number} channel The AdSense channel this belongs to
+	 * @param {Number} minZoomLevel The minimum zoom level to begin showing ads at
+	 * @return {Object} The options for CreateAdsManager
+	 */
+	function defaults() {
+		return {
+			'publisherId':'',
+			'maxAdsOnMap':3,
+			'channel':0,
+			'minZoomLevel':6
+		}
+	};
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);
+	
+	var adsOptions = {
+		'maxAdsOnMap':options.maxAdsOnMap,
+		'channel':options.channel,
+		'minZoomLevel':options.minZoomLevel
+	}
+	
+	if (typeof thisMap.AdsManager == 'undefined') {
+  	Mapifies.MapObjects.Append(element, 'AdsManager', new GAdsManager(thisMap, options.publisherId, adsOptions));
+  }	
+	
+	if (typeof callback == 'function') return callback(thisMap.AdsManager, options);
+};
+/**
+ * This function allows you to pass a GeoXML or KML feed to a Google map.
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.AddFeed
+ * @alias Mapifies.AddFeed
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Fucntion} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the feed object and options.
+ */
+Mapifies.AddFeed = function( element, options, callback ) {
+	/**
+	 * Default options for AddFeed
+	 * @method
+	 * @namespace Mapifies.AddFeed
+	 * @id Mapifies.AddFeed.defaults
+	 * @alias Mapifies.AddFeed.defaults
+	 * @param {String} feedUrl The URL of the GeoXML or KML feed.
+	 * @param {Object} mapCenter An array with a lat/lng position to center the map on
+	 * @return {Object} The options for AddFeed
+	 */
+	function defaults() {
+		return {
+			// URL of the feed to pass (required)
+			'feedUrl': null,
+			// Position to center the map on (optional)
+			'mapCenter': []
+		};
+	};
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);
+
+	// Load feed
+	var feed = new GGeoXml(options.feedUrl);
+	// Add as overlay
+	thisMap.addOverlay(feed);
+	
+	// If the user has passed the optional mapCenter,
+	// then center the map on that point
+	if (options.mapCenter[0] && options.mapCenter[1])
+		thisMap.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
+		
+	if (typeof callback == 'function') return callback( feed, options );
+	return;
+};
+
+/**
+ * This function allows you to remove a GeoXML or KML feed from a Google map.
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.RemoveFeed
+ * @alias Mapifies.RemoveFeed
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {GGeoXML} feed The feed to remove from the map
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the feed object and options.
+ */
+Mapifies.RemoveFeed = function ( element, feed, callback ) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	thisMap.removeOverlay(feed);
+	if (typeof callback == 'function') return callback( feed );
+	return;
+};
+/**
+ * This function allows you to add a ground overlay to a map
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.AddGroundOverlay
+ * @alias Mapifies.AddGroundOverlay
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the feed object and options.
+ */
+Mapifies.AddGroundOverlay = function( element, options, callback) {
+  /**
+	 * Default options for AddGroundOverlay
+	 * @method
+	 * @namespace Mapifies.AddGroundOverlay
+	 * @id Mapifies.AddGroundOverlay.defaults
+	 * @alias Mapifies.AddGroundOverlay.defaults
+	 * @param {Object} overlaySouthWestBounds The coordinates of the South West bounds of the image
+	 * @param {Object} overlayNorthEastBounds The coordinates of the North East bounds of the image
+	 * @param {String} overlayImage The URL of the image to be loaded
+	 * @return {Object} The options for AddGroundOverlay
+	 */
+	function defaults() {
+		return {
+			// South West Boundry
+			'overlaySouthWestBounds': undefined,
+			// North East Boundry
+			'overlayNorthEastBounds': undefined,
+			// Image
+			'overlayImage': undefined
+		};
+	};
+	
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);
+	
+	var boundries = new GLatLngBounds(new GLatLng(options.overlaySouthWestBounds[0], options.overlaySouthWestBounds[1]), new GLatLng(options.overlayNorthEastBounds[0], options.overlayNorthEastBounds[1]));
+	groundOverlay = new GGroundOverlay(options.overlayImage, boundries);
+	
+	thisMap.addOverlay(groundOverlay);
+		
+	if (typeof callback == 'function') return callback( groundOverlay, options );
+	return;
+};
+
+/**
+ * This function removes an existing ground overlay
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.RemoveGroundOverlay
+ * @alias Mapifies.RemoveGroundOverlay
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {GGroundOverlay} groundOverlay The ground overlay to remove.
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the feed object and options.
+ */
+Mapifies.RemoveGroundOverlay = function ( element, groundOverlay, callback ) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	thisMap.removeOverlay(groundOverlay);
+	if (typeof callback === 'function') return callback(groundOverlay);
+	return;
+};
+/**
+ * This function allows you to add markers to the map with several options
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.AddMarker
+ * @alias Mapifies.AddMarker
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {Object} options The object that contains the options.
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the marker object and options.
+ */
+Mapifies.AddMarker = function ( element, options, callback ) {
+	/**
+	 * Default options for AddGroundOverlay
+	 * @method
+	 * @namespace Mapifies.AddGroundOverlay
+	 * @id Mapifies.AddGroundOverlay.defaults
+	 * @alias Mapifies.AddGroundOverlay.defaults
+	 * @param {Object} pointLatLng The Lat/Lng coordinates of the marker.
+	 * @param {String} pointHTML The HTML to appear in the markers info window.
+	 * @param {String} pointOpenHTMLEvent The javascript event type to open the marker info window.  Default is 'click'.
+	 * @param {Boolean} pointIsDraggable Defines if the point is draggable by the end user.  Default false.
+	 * @param {Boolean} pointIsRemovable Defines if the point can be removed by the user.  Default false.
+	 * @param {Boolean} pointRemoveEvent The event type to remove a marker.  Default 'dblclick'.
+	 * @param {Number} pointMinZoom The minimum zoom level to display the marker if using a marker manager.
+	 * @param {Number} pointMaxZoom The maximum zoom level to display the marker if using a marker manager.
+	 * @param {GIcon} pointIcon A GIcon to display instead of the standard marker graphic.
+	 * @param {Boolean} centerMap Automatically center the map on the new marker.  Default false.
+	 * @param {String} centerMoveMethod The method in which to move to the marker.  Options are 'normal' (default) and 'pan'.  Added r64
+	 * @return {Object} The options for AddGroundOverlay
+	 */
+	function defaults() {
+		var values = {
+			'pointLatLng': undefined,
+			'pointHTML': undefined,
+			'pointOpenHTMLEvent': 'click',
+			'pointIsDraggable': false,
+			'pointIsRemovable': false,
+			'pointRemoveEvent': 'dblclick',
+			'pointMinZoom': 4,
+			'pointMaxZoom': 17,
+			'pointIcon': undefined,
+			'centerMap': false,
+			'centerMoveMethod':'normal'
+		};
+		return values;
+	};
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend({}, defaults(), options);
+	
+	var markerOptions = {}
+	
+	if (typeof options.pointIcon == 'object')
+		jQuery.extend(markerOptions, {'icon': options.pointIcon});
+		
+	if (options.pointIsDraggable)
+		jQuery.extend(markerOptions, {'draggable': options.pointIsDraggable});
+			
+	if (options.centerMap) {
+		switch (options.centerMoveMethod) {
+			case 'normal':
+				thisMap.setCenter(new GLatLng(options.pointLatLng[0],options.pointLatLng[1]));
+			break;
+			case 'pan':
+				thisMap.panTo(new GLatLng(options.pointLatLng[0],options.pointLatLng[1]));
+			break;
+		}
+	}
+		
+		
+	// Create marker, optional parameter to make it draggable
+	var marker = new GMarker(new GLatLng(options.pointLatLng[0],options.pointLatLng[1]), markerOptions);
+		
+	// If it has HTML to pass in, add an event listner for a click
+	if(options.pointHTML)
+		GEvent.addListener(marker, options.pointOpenHTMLEvent, function(){
+			marker.openInfoWindowHtml(options.pointHTML, {maxContent: options.pointMaxContent, maxTitle: options.pointMaxTitle});
+		});
+	// If it is removable, add dblclick event
+	if(options.pointIsRemovable)
+		GEvent.addListener(marker, options.pointRemoveEvent, function(){
+			thisMap.removeOverlay(marker);
+		});
+
+	// If the marker manager exists, add it
+	if(thisMap.MarkerManager) {
+		thisMap.MarkerManager.addMarker(marker, options.pointMinZoom, options.pointMaxZoom);	
+	} else {
+		// Direct rendering to map
+		thisMap.addOverlay(marker);
+	}
+		
+	if (typeof callback == 'function') return callback(marker, options);
+	return;
+};
+
+
+/**
+ * This function allows you to remove markers from the map
+ * @method
+ * @namespace Mapifies
+ * @id Mapifies.RemoveMarker
+ * @alias Mapifies.RemoveMarker
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {GMarker} options The marker to be removed
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the marker object.
+ */
+Mapifies.RemoveMarker = function ( element, marker, callback ) {
+	var thisMap = Mapifies.MapObjects.Get(element);
+	thisMap.removeOverlay(marker);
+	if (typeof callback === 'function') return callback(marker);
+	return;
+};
+
+/**
+ * This function allows you to create a marker manager to store and manage any markers created on the map.  Google recommends not using this marker manager and instead using the open source one.
+ * @method
+ * @deprecated
+ * @namespace Mapifies
+ * @id Mapifies.CreateMarkerManager
+ * @alias Mapifies.CreateMarkerManager
+ * @param {jQuery} element The element to initialise the map on.
+ * @param {GMarker} options The marker to be removed
+ * @param {Function} callback The callback function to pass out after initialising the map.
+ * @return {Function} callback The callback option with the marker object and options.
+ */
+Mapifies.CreateMarkerManager = function(element, options, callback) {
+	/**
+	 * Default options for CreateMarkerManager
+	 * @method
+	 * @namespace Mapifies.CreateMarkerManager
+	 * @id Mapifies.CreateMarkerManager.defaults
+	 * @alias Mapifies.CreateMarkerManager.defaults
+	 * @param {Number} borderPadding Specifies, in pixels, the extra padding outside the map's current viewport monitored by a manager. Markers that fall within this padding are added to the map, even if they are not fully visible.
+	 * @param {Number} maxZoom The maximum zoom level to show markers at
+	 * @param {Boolean} trackMarkers Indicates whether or not a marker manager should track markers' movements.
+	 * @return {Object} The options for CreateMarkerManager
+	 */
+	function defaults() {
+		return {
+			'markerManager': 'GMarkerManager',
+			// Border Padding in pixels
+			'borderPadding': 100,
+			// Max zoom level 
+			'maxZoom': 17,
+			// Track markers
+			'trackMarkers': false
+		}
+	}
+	var thisMap = Mapifies.MapObjects.Get(element);
+	options = jQuery.extend(defaults(), options);
+	
+	var markerManagerOptions = {
+		'borderPadding': options.borderPadding,
+		'maxZoom': options.maxZoom,
+		'trackMarkers': options.trackMarkers
+	}
+	
+	var markerManager = new window[options.markerManager](thisMap, options);
+	Mapifies.MapObjects.Append(element, 'MarkerManager',markerManager);
+
+	// Return the callback
+	if (typeof callback == 'function') return callback( markerManager, options );
+};
+/**
<