Commits

Anonymous committed 93f7615

Add Map to Room Page.

Comments (0)

Files changed (6)

src/java/com/mpbsoftware/roomie/Payment/Reconcile.java

 import javax.persistence.Query;
 import org.apache.axis.utils.ArrayUtil;
 import org.apache.commons.lang.ArrayUtils;
-//import static org.quaere.DSL.*;
+import static org.quaere.DSL.*;
 
 /**
  *
     
 
     public static void Reconcile(String roomid){
-     /*
+     
         PersistenceService ps = PersistenceService.getInstance();
         EntityManager em = ps.getEntityManager();
         Room r = em.find(Room.class, Long.parseLong(roomid));
         for (PlanComponent planComponent : plan) {
             System.out.println(planComponent.getTo() + " " + planComponent.getFrom() + " " + planComponent.getAmount());
         }
-      **/
+      
     }
 
 }
           <fieldset style="text-align:right;">
             <input type="button" value="Edit Profile" onclick="location.href='?edit';"/>
           </fieldset>
+
+          <form action="https://authorize.payments.amazon.com/cobranded-ui/actions/start" method="get">
+   <input type="hidden" name="maxVariableFee" value="2.00" >
+   <input type="hidden" name="maxFixedFee" value="0.2" >
+   <input type="hidden" name="callerAccountId" value="XRVAPTBXUUKH2FR3NB2ZIHFPN7N91ZHLB9JMME" >
+   <input type="hidden" name="recipientPaysFee" value="True" >
+   <input type="hidden" name="returnURL" value="http://kubasik.net/blog" >
+   <input type="hidden" name="awsSignature" value="52NGpaIM7QB2VziqSiyt84Gjrds=" >
+   <input type="hidden" name="collectEmailAddress" value="True" >
+   <input type="hidden" name="callerReference" value="e2e2569b-4447-4e9f-87f9-cadeadcb640d" >
+   <input type="hidden" name="callerKey" value="11SEM03K88SD016FS1G2" >
+   <input type="hidden" name="pipelineName" value="Recipient" >
+   <input type="image" src="https://authorize.payments.amazon.com/pba/images/MarketPlaceFeeWithLogo.png" border="0">
+  </form>
         </div>
       </div>
       <div id="profile_edit" style="height:0px;overflow:hidden;">
     <link rel="stylesheet" href="css/style.css" type="text/css" />
     <link rel="stylesheet" href="css/formcheck.css" type="text/css" />
     <link rel="stylesheet" href="css/forms.css" type="text/css" />
-
+    <script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAArxYLfoyP1d_S7X7FDOvYnxQ3cJKdgLyOB5N9kHNpJkOc65dGrhR4DYj3VPRWTY6O0KAYFlfTb8YLyQ"></script>
     <script type="text/javascript" src="scripts/jquery.js"></script>
     <script type="text/javascript" src="scripts/mootools.js"></script>
     <script type="text/javascript" src="scripts/login.js"></script>
     <script type="text/javascript" src="scripts/lang/en.js"></script>
     <script type="text/javascript" src="scripts/formcheck.js"></script>
+    <script type="text/javascript" src="scripts/jquery.jmap.js"></script>
     <script type="text/javascript">
         jQuery(document).ready(function (){
             new FormCheck("room_edit_form");
             showPanel(getParam());
+             jQuery('#map').jmap('init');
+            
             if ("${sessionScope.room_id}" != "" ){
             jQuery.getJSON("GetRoom", loadRoom);
+
         }
     });
     function loadRoom(res){
                     <input type="text" class="validate['required','alphanum']" name="addr1" /><br />
                     <input type="text" class="validate['alphanum']" name="addr2" />
                   </label>
+                    <div id="map" style="width:400px;height:400px;"></div>
                   <label>
                     <span>City : </span>
                     <input type="text" class="validate['required','alphanum']" name="city" />
                     <span>Address : </span>
                     <div id="address_display"><img src="images/text-loader.gif" /></div>
                   </label>
+                  <div id="map" style="width:400px;height:400px;"></div>
                   <label>
                     <span>City : </span>
                     <div id="city_display"><img src="images/text-loader.gif" /></div>

web/scripts/amazon.js.js

+/* 
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+

web/scripts/jquery.jmap.js

+(function(jQuery){
+	/**
+	 *	The global namespace for jMaps
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap
+	 */
+	jQuery.jmap = jQuery.jmap || {};
+
+	jQuery.jmap.store = {};
+	
+	/**
+	 *	The global object that contains the project details
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap.JDetails
+	 */
+	jQuery.jmap.JDetails = {
+		name: "jMaps Google Maps Plugin",
+		description: "jMaps is a jQuery plugin that makes google maps easy",
+		version: "3.0",
+		releaseDate: "19/04/2008",
+		author: "Tane Piper <digitalspaghetti@gmail.com>",
+		blog: "http://digitalspaghetti.me.uk",
+		repository: "http://hg.digitalspaghetti.me.uk/jmaps",
+		googleGroup: "http://groups.google.com/group/jmaps",
+		licenceType: "MIT",
+		licenceURL: "http://www.opensource.org/licenses/mit-license.php"
+	};
+	
+	/**
+	 *	The global object for i18n error messages
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap.JErrors
+	 */
+	jQuery.jmap.JErrors = {
+		en : {
+			functionDoesNotExist : "jMap Error 1: The function does not exist",
+			addressNotFound: "This address cannot be found.  Please modify your search.",
+			browserNotCompatible: "This browser is reported as being not compatible with Google Maps.",
+			cannotLoad: "Cannot load the Google Maps API at this time.  Please check your connection."
+		},
+		fr : {
+			addressNotFound: "Cette adresse ne peut pas être trouvée. Veuillez modifier votre recherche.",
+			browserNotCompatible: "Ce navigateur est rapporté en tant qu'étant non compatible avec des cartes de Google.",
+			cannotLoad: "Ne peut pas charger les cartes api de Google actuellement. Veuillez vérifier votre raccordement."
+		},
+		de : {
+			addressNotFound: "Diese Adresse kann nicht gefunden werden. Ändern Sie bitte Ihre Suche.",
+			browserNotCompatible: "Diese Datenbanksuchroutine wird als seiend nicht kompatibel mit Google Diagrammen berichtet.",
+			cannotLoad: "Kann nicht die Google Diagramme API diesmal laden. Überprüfen Sie bitte Ihren Anschluß."
+		},
+		nl : {
+			addressNotFound: "Dit adres kan worden gevonden niet. Gelieve te wijzigen uw onderzoek.",
+			browserNotCompatible: "Dit browser wordt gemeld zoals zijnd niet compatibel met Kaarten Google.",
+			cannotLoad: "Kan de Google Kaarten API op dit moment laden niet. Gelieve te controleren uw verbinding."
+		},
+		es : {
+			addressNotFound: "Esta dirección no puede ser encontrada. Modifique por favor su búsqueda.",
+			browserNotCompatible: "Este browser se divulga como siendo no compatible con los mapas de Google.",
+			cannotLoad: "No puede cargar los mapas API de Google en este tiempo. Compruebe por favor su conexión."
+		},
+		sv : {
+			addressNotFound: "Denna adress kunde ej hittas. Var god justera din sökning",
+			browserNotCompatible: "Denna webbläsare är ej kompatibel med Google Maps",
+			cannotLoad: "Kan inte ladda Google Maps API för tillfället. Var god kontrollera din anslutning."
+		}
+	};
+	
+	/**
+	 *	The global object for .jmap("init") calls
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap.JDefaults
+	 */	
+        jQuery.jmap.JDefaults = {
+		// Initial type of map to display
+		language: "en",
+		// Options: "map", "sat", "hybrid"
+		mapType: "map",
+		// Initial map center
+		mapCenter: [55.958858,-3.162302],
+		// Initial map size
+		mapDimensions: [400, 400],
+		// Initial zoom level
+		mapZoom: 12,
+		// Initial map control size
+		// Options: "large", "small", "none"
+		mapControlSize: "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 jMap icon
+		mapShowjMapIcon: true,
+		//Debug Mode
+		debugMode: false
+	}
+	
+	/**
+	 *	The global object for the google ads manager
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap.JAdsManagerDefaults
+	 */
+	jQuery.jmap.JAdsManagerDefaults = {
+		// Google Adsense publisher ID
+		publisherId: ""
+	};
+	
+	/**
+	 *	The global object for adding KML or OpenRSS feeds to the map
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap.JFeedDefaults
+	 */
+	jQuery.jmap.JFeedDefaults = {
+		// URL of the feed to pass (required)
+		feedUrl: "",
+		// Position to center the map on (optional)
+		mapCenter: []
+	}
+	
+	/**
+	 *	The global object that contains ground overlay details
+	 *	@type Object
+	 *	@cat jMapOptions
+	 *	@name jQuery.jmap.JGroundOverlayDefauts
+	 */
+
+	jQuery.jmap.JGroundOverlayDefaults = {
+		// South West Boundry
+		overlaySouthWestBounds: [],
+		// North East Boundry
+		overlayNorthEastBounds: [],
+		// Image
+		overlayImage: ""
+	}
+	
+	jQuery.jmap.JIconDefaults = {
+		iconImage: "",
+		iconShadow: "",
+		iconSize: null,
+		iconShadowSize: null,
+		iconAnchor: null,
+		iconInfoWindowAnchor: null,
+		iconPrintImage: "",
+		iconMozPrintImage: "",
+		iconPrintShadow: "",
+		iconTransparent: ""
+	};
+	
+	// Marker manager default options
+	jQuery.jmap.JMarkerManagerDefaults = {
+		// Border Padding in pixels
+		borderPadding: 100,
+		// Max zoom level 
+		maxZoom: 17,
+		// Track markers
+		trackMarkers: false
+	};
+	
+	// Default options for a point to be created
+	jQuery.jmap.JMarkerDefaults = {
+		// Point lat & lng
+		pointLatLng: [],
+		// Point HTML for infoWindow
+		pointHTML: null,
+		// Event to open infoWindow (click, dblclick, mouseover, etc)
+		pointOpenHTMLEvent: "click",
+		// Point is draggable?
+		pointIsDraggable: false,
+		// Point is removable?
+		pointIsRemovable: false,
+		// Event to remove on (click, dblclick, mouseover, etc)
+		pointRemoveEvent: "dblclick",
+		// These two are only required if adding to the marker manager
+		pointMinZoom: 4,
+		pointMaxZoom: 17,
+		// Optional Icon to pass in (not yet implemented)
+		pointIcon: null,
+		// For maximizing infoWindows (not yet implemented)
+		pointMaxContent: null,
+		pointMaxTitle: null
+	};
+	
+	// Defaults for a Polygon
+	jQuery.jmap.JPolygonDefaults = {
+		// An array of GLatLng objects
+		polygonPoints: [],
+		// The outer stroke colour
+	 	polygonStrokeColor: "#000000",
+	 	// Stroke thickness
+	 	polygonStrokeWeight: 5,
+	 	// Stroke Opacity
+	 	polygonStrokeOpacity: 1,
+	 	// Fill colour
+	 	polygonFillColor: "#ff0000",
+	 	// Fill opacity
+	 	polygonFillOpacity: 1,
+	 	// Optional center map
+	 	mapCenter: [],
+	 	// Is polygon clickable?
+	 	polygonClickable: true
+	};
+	
+	// Default options for a Polyline
+	jQuery.jmap.JPolylineDefaults = {
+		// An array of GLatLng objects
+		polylinePoints: [],
+		// Colour of the line
+		polylineStrokeColor: "#ff0000",
+		// Width of the line
+		polylineStrokeWidth: 10,
+		// Opacity of the line
+		polylineStrokeOpacity: 1,
+		// Optional center map
+		mapCenter: [],
+		// Is line Geodesic (i.e. bends to the curve of the earth)?
+		polylineGeodesic: false,
+		// Is line clickable?
+		polylineClickable: true
+	};
+	
+	jQuery.jmap.JScreenOverlayDefaults = {
+		
+	}
+	
+	jQuery.jmap.JSearchAddressDefaults = {
+		// Address to search for
+		address: null,
+		// Optional Cache to store Geocode Data (not implemented yet)
+		cache: {},
+		// Country code for localisation (not implemented yet)
+		countryCode: 'uk'
+	};
+	
+	jQuery.jmap.JSearchDirectionsDefault = {
+		// From address
+		fromAddress: "",
+		// To address
+		toAddress: "",
+		// Optional panel to show text directions
+		directionsPanel: ""
+	};
+	
+	jQuery.jmap.JTrafficDefaults = {
+		// Can pass in "create" (default) or "destroy" which will remove the layer
+		method: "create",
+		// Center the map on this point (optional)
+		mapCenter: []
+	};
+	
+	jQuery.jmap.JMoveToDefaults = {
+		centerMethod: 'normal',
+		mapType: null,
+		mapCenter: [],
+		mapZoom: null
+	}
+	
+	jQuery.jmap.JSavePositionDefaults = {
+		recall: false
+	}
+	
+	jQuery.jmap.variables = {
+		mapType: "Unknown",
+		mapCenter: []
+	}
+	
+	jQuery.jmap.init = function(el, options, callback) {
+	
+		/* Set Up Options */
+		// First we create out options object by checking passed options
+		// and that no defaults have been overidden
+		var options = jQuery.extend({}, jQuery.jmap.JDefaults, options);
+		// Check for metadata plugin support
+		var options = jQuery.jmap.JOptions = jQuery.meta ? jQuery.extend({}, options, jQuery(this).data()) : options;
+		/* End Set Up Options */
+		
+		// Do checks or throw errors
+		jQuery.jmap._initChecks(el);
+		
+		// Initialise the GMap2 object
+		el.jmap = jQuery.jmap.GMap2 = new GMap2(el);
+		
+		// If the user shows the jMaps icon, show it right away
+		if (options.mapShowjMapIcon) {
+			jQuery.jmap.addScreenOverlay(
+				{
+					imageUrl:'http://hg.digitalspaghetti.me.uk/jmaps/raw-file/3228fade0b3c/docs/images/jmaps-mapicon.png',
+					screenXY:[70,10],
+					overlayXY:[0,0],
+					size:[42,25]
+				}
+			);
+		}
+		
+		
+		// Set map type based on passed option
+		var mapType = jQuery.jmap._initMapType(options.mapType);
+		
+		// Initialise the map with the passed settings
+		el.jmap.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]), options.mapZoom, mapType);
+			
+		// 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.mapControlSize)
+		{
+			case "small":
+				el.jmap.addControl(new GSmallMapControl());
+			break;
+			case "large":
+				el.jmap.addControl(new GLargeMapControl());
+			break;
+		}
+		// Type of map Control (Map,Sat,Hyb)
+		if(options.mapEnableType)
+			el.jmap.addControl(new GMapTypeControl()); // Off by default
+		
+		// Show the small overview map
+		if(options.mapEnableOverview)
+			el.jmap.addControl(new GOverviewMapControl());// Off by default
+		
+		// GMap2 Functions (in order of the docs for clarity)
+		// Enable a mouse-dragable map
+		if(!options.mapEnableDragging)
+			el.jmap.disableDragging(); // On by default
+			
+		// Enable Info Windows
+		if(!options.mapEnableInfoWindows)
+			el.jmap.disableInfoWindow(); // On by default
+		
+		// Enable double click zoom on the map
+		if(options.mapEnableDoubleClickZoom)
+			el.jmap.enableDoubleClickZoom(); // On by default
+		
+		// Enable scrollwheel on the map
+		if(options.mapEnableScrollZoom)
+			el.jmap.enableScrollWheelZoom(); //Off by default
+		
+		// Enable smooth zooming
+		if (options.mapEnableSmoothZoom)
+			el.jmap.enableContinuousZoom(); // Off by default
+
+		// Enable Google Bar
+		if (options.mapEnableGoogleBar)
+			el.jmap.enableGoogleBar();  //Off by default
+			
+		// Enables Scale bar
+		if (options.mapEnableScaleControl)
+			el.jmap.addControl(new GScaleControl());
+
+		// output init to console
+		if (options.debugMode) {
+		    console.log(el.jmap);
+		}
+		
+		// Initialise variables
+		jQuery.jmap.getMapType();
+		
+		if (typeof callback == 'function') return callback(el, options);
+	}
+	
+	/**
+	 *	.addFeed(options, callback?);
+	 *	This function takes a KML or GeoRSS file and
+	 *	adds it to the map
+	 */
+	jQuery.jmap.addFeed = function(options, callback) {
+	
+		var options = jQuery.extend({}, jQuery.jmap.JFeedDefaults, options);
+		
+		// Load feed
+		var feed = new GGeoXml(options.feedUrl);
+		// Add as overlay
+		jQuery.jmap.GMap2.addOverlay(feed);
+		
+		// If the user has passed the optional mapCenter,
+		// then center the map on that point
+		if (options.mapCenter[0] && options.mapCenter[1])
+			jQuery.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
+		
+		if (typeof callback == 'function') return callback(feed, options);
+	}
+	
+	jQuery.jmap.addGroundOverlay = function(options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JGroundOverlayDefaults, options);
+		var boundries = new GLatLngBounds(new GLatLng(options.overlaySouthWestBounds[0], options.overlaySouthWestBounds[1]), new GLatLng(options.overlayNorthEastBounds[0], options.overlayNorthEastBounds[1]));
+		
+		jQuery.jmap.GGroundOverlay = new GGroundOverlay(options.overlayImage, boundries);
+		jQuery.jmap.GMap2.addOverlay(jQuery.jmap.GGroundOverlay);
+		
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.hideGroundOverlay = function(callback) {
+		jQuery.jmap.GGroundOverlay.hide();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.showGroundOverlay = function(callback) {
+		isHidden = jQuery.jmap.GGroundOverlay.isHidden();
+		if (isHidden)
+			jQuery.jmap.GGroundOverlay.show();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	/**
+	 *	Create a marker and add it as a point to the map
+	 */
+	jQuery.jmap.addMarker = function(options, callback) {
+		// Create options
+		var options = jQuery.extend({}, jQuery.jmap.JMarkerDefaults, options);
+		var markerOptions = {}
+		
+		if (typeof options.pointIcon == 'object')
+			jQuery.extend(markerOptions, {icon: options.pointIcon});
+		
+		if (options.pointIsDraggable)
+			jQuery.extend(markerOptions, {draggable: options.pointIsDraggable});
+		
+		// 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(){
+				jQuery.jmap.GMap2.removeOverlay(marker);
+			});
+
+		// If the marker manager exists, add it
+		if(jQuery.jmap.GMarkerManager) {
+			jQuery.jmap.GMarkerManager.addMarker(marker, options.pointMinZoom, options.pointMaxZoom);
+		} else {
+			// Direct rendering to map
+			jQuery.jmap.GMap2.addOverlay(marker);
+		}
+		
+		if (typeof callback == 'function') return callback();
+	}
+	
+	/**
+	 * Create a screen overlay
+	 * @param {Object} options
+	 * @param function callback
+	 */
+	jQuery.jmap.addScreenOverlay = function(options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JScreenOverlayDefaults, options);
+		var overlay = new GScreenOverlay(options.imageUrl, new GScreenPoint(options.screenXY[0],options.screenXY[1]), new GScreenPoint(options.overlayXY[0],options.overlayXY[1]), new GScreenSize(options.size[0],options.size[1]));
+		jQuery.jmap.GMap2.addOverlay(overlay);
+		
+		if (typeof callback == 'function') return callback(overlay, options);
+	}
+	
+	/**
+	 * Create a polygon and render to the map
+	 */
+	 jQuery.jmap.addPolygon = function(options, callback) {
+	 	
+	 	var options = jQuery.extend({}, jQuery.jmap.JPolygonDefaults, options);
+		polygonOptions = {};
+	 	if (!options.polygonClickable)
+			var polygonOptions = jQuery.extend({}, polygonOptions, {
+				clickable: false
+			});
+	 		
+	 	if(options.mapCenter[0] && options.mapCenter[1])
+	 		jQuery.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
+		
+		var polygon = new GPolygon(options.polygonPoints, options.polygonStrokeColor, options.polygonStrokeWeight, options.polygonStrokeOpacity, options.polygonFillColor, options.polygonFillOpacity, polygonOptions);
+
+		jQuery.jmap.GMap2.addOverlay(polygon);
+		
+		if (typeof callback == 'function') return callback();
+	 }
+	
+	/**
+	 *	Create a polyline and render on the map
+	 */
+	jQuery.jmap.addPolyline = function (options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JPolylineDefaults, options);
+		var polyLineOptions = {};
+		if (options.polylineGeodesic)
+			jQuery.extend({}, polyLineOptions, {geodesic: true});
+			
+		if(!options.polylineClickable)
+			jQuery.extend({}, polyLineOptions, {clickable: false});
+
+		if (options.mapCenter[0] && options.mapCenter[1])
+			jQuery.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
+
+		var polyline = new GPolyline(options.polylinePoints, options.polylineStrokeColor, options.polylineStrokeWidth, options.polylineStrokeOpacity, polyLineOptions);
+		jQuery.jmap.GMap2.addOverlay(polyline);
+		
+		if (typeof callback == 'function') return callback();
+	}
+		
+	/**
+	 *	.trafficInfo(options?, callback?);
+	 *	This function renders a traffic info
+	 *	overlay for supported cities
+	 *	The GTrafficOverlay also has it's own show/hide methods
+	 *	that do not destory the overlay.  Can be called:
+	 *	jQuery.jmap.GTrafficOverlay.show();
+	 *	jQuery.jmap.GTrafficOverlay.hide();
+	 */
+	jQuery.jmap.addTrafficInfo = function(options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JTrafficDefaults, options);
+		
+		// Does the user wants to create or destory the overlay
+		switch(options.method) {
+			case "create":
+				jQuery.jmap.GTrafficOverlay = new GTrafficOverlay;
+				// Add overlay
+				jQuery.jmap.GMap2.addOverlay(jQuery.jmap.GTrafficOverlay);
+				// If the user has passed the optional mapCenter,
+				// then center the map on that point
+				if (options.mapCenter[0] && options.mapCenter[1]) {
+					jQuery.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
+				}
+			break;
+			case "destroy":
+				// Distroy overlay
+				jQuery.jmap.GMap2.removeOverlay(jQuery.jmap.GTrafficOverlay);
+			break;
+		
+		}
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.disableTraffic = function(callback) {
+		jQuery.jmap.GTrafficOverlay.hide();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.enableTraffic = function(callback) {
+		jQuery.jmap.GTrafficOverlay.show();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	/**
+	 *	Create a AdSense ad manager
+	 */
+	jQuery.jmap.createAdsManager = function(options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JAdsManagerDefaults, options);
+	
+		jQuery.jmap.GAdsManager = new GAdsManager(jQuery.jmap.GMap2, options.publisherId);
+		
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.hideAds = function(callback){
+		jQuery.jmap.GAdsManager.disable();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.showAds = function(callback){
+		jQuery.jmap.GAdsManager.enable();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	// Create Geocoder cache and attach to global object
+	jQuery.jmap.createGeoCache = function(callback) {
+		jQuery.jmap.GGeocodeCache = new GGeocodeCache();
+		if (typeof callback == 'function') return callback();
+	}
+	
+	// Create a geocoder object
+	jQuery.jmap.createGeoCoder = function(cache, callback) {
+		if (cache) {
+			// Create with cache
+			jQuery.jmap.GClientGeocoder = new GClientGeocoder(cache);
+		} else {
+			// No cache
+			jQuery.jmap.GClientGeocoder = new GClientGeocoder;
+		}
+		if (typeof callback == 'function') return callback();
+	}
+	
+	/**
+	 * Create an icon to return to addMarker
+	 */
+	jQuery.jmap.createIcon = function(options) {
+		var options = jQuery.extend({}, jQuery.jmap.JIconDefaults, options);
+		var icon = new GIcon(G_DEFAULT_ICON);
+		
+		if(options.iconImage)
+			icon.image = options.iconImage;
+		if(options.iconShadow)
+			icon.shadow = options.iconShadow;
+		if(options.iconSize)
+			icon.iconSize = options.iconSize;
+		if(options.iconShadowSize)
+			icon.shadowSize = options.iconShadowSize;
+		if(options.iconAnchor)
+			icon.iconAnchor = options.iconAnchor;
+		if(options.iconInfoWindowAnchor)
+			icon.infoWindowAnchor = options.iconInfoWindowAnchor;
+	
+		return icon;
+	}
+	
+	/**
+	 *	Creates the marker manager and attaches it to the jQuery.jmap namespace
+	 */
+	jQuery.jmap.createMarkerManager = function(options, callback) {
+		// Merge the options with the defaults
+		var options = jQuery.extend({}, jQuery.jmap.JMarkerManagerDefaults, options);
+		// Create the marker manager and attach to the global object
+		jQuery.jmap.GMarkerManager = new GMarkerManager(jQuery.jmap.GMap2, options);
+		// Return the callback
+		if (typeof callback == 'function') return callback();
+	}
+		
+	// This is an alias function that allows the user to simply search for an address
+	// Can be returned as a result, or as a point on the map
+	jQuery.jmap.searchAddress = function(options, callback) {
+	
+		var options = jQuery.extend({}, jQuery.jmap.JSearchAddressDefaults, options);
+		
+		// Add options from pass to marker object
+		var pass = jQuery.extend({}, jQuery.jmap.JMarkerManagerDefaults);
+		
+		// Check to see if the Geocoder already exists in the object
+		// or create a temporary locally scoped one.
+		if (typeof jQuery.jmap.GClientGeocoder == 'undefined') {
+			 var geocoder = new GClientGeocoder;
+		} else {
+			var geocoder = jQuery.jmap.GClientGeocoder;
+		}
+		
+		// Geocode the address
+		geocoder.getLatLng(options.address, function(point){
+				if (!point) {
+					// Address is not found, throw an error
+					throw new Error(jQuery.jmap.JErrors[jQuery.jmap.JOptions.language].addressNotFound);
+				}
+				if (typeof callback == 'function') return callback(options, point);
+		});
+	}
+	
+
+	/**
+	 *	.searchDirections(options, callback?);
+	 *	This function allows you to pass a to and from address.  If To address
+	 *	is previous from address, automatically creates a GRoute object
+	 */	
+	jQuery.jmap.searchDirections = function(options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JSearchDirectionsDefaults, options);
+		var panel = jQuery('#' + options.directionsPanel).get(0);
+		jQuery.jmap.GDirections = new GDirections(jQuery.jmap.GMap2, panel);
+		jQuery.jmap.GDirections.load(options.fromAddress + ' to ' + options.toAddress);
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.moveTo = function(options, callback) {
+		
+		var options = jQuery.extend({}, jQuery.jmap.JMoveToDefaults, options);
+		if (options.mapType)
+			var mapType = jQuery.jmap._initMapType(options.mapType);
+		var point = new GLatLng(options.mapCenter[0], options.mapCenter[1]);
+		switch (options.centerMethod) {
+			case 'normal':
+				jQuery.jmap.GMap2.setCenter(point, options.mapZoom, mapType);
+				break;
+			case 'pan':
+				jQuery.jmap.GMap2.panTo(point);
+				break;
+		}
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.savePosition = function(options, callback) {
+		var options = jQuery.extend({}, jQuery.jmap.JMoveToDefaults, options);
+		if (options.recall) {
+			jQuery.jmap.GMap2.returnToSavedPosition();
+		} else {
+			jQuery.jmap.GMap2.savePosition();
+		}
+		if (typeof callback == 'function') return callback();
+	}
+	
+	jQuery.jmap.createKeyboardHandler = function(callback){
+		jQuery.jmap.keyboardHandler = new GKeyboardHandler(jQuery.jmap.GMap2);
+		if (typeof callback == 'function') return callback();
+	}
+	
+	
+	// Function currently not returning correctly
+	jQuery.jmap.getMapType = function() {
+		var mapTypes = jQuery.jmap.GMap2.getMapTypes();
+		var actMap = jQuery.jmap.GMap2.getCurrentMapType();
+		if (actMap.Hz) {
+			jQuery.jmap.variables.mapType = actMap.Hz;
+		}
+	}
+	
+	jQuery.jmap.getCenter = function(){
+		var center = jQuery.jmap.GMap2.getCenter();
+		jQuery.jmap.variables.mapCenter = center
+		if (typeof callback == 'function') return callback(center);
+	}
+	
+	jQuery.jmap.getBounds = function(){
+		var bounds = jQuery.jmap.GMap2.getBounds();
+		jQuery.jmap.variables.mapBounds = bounds;
+		if (typeof callback == 'function') return callback(bounds);
+	}
+
+	/* Internal Functions */
+	
+	/**
+	 *	Function: 	setMapType
+	 *	Accepts: 	string maptype
+	 *	Returns:	CONSTANT maptype
+	 **/ 
+	jQuery.jmap._initMapType = function(option) {
+		// Lets set our map type based on the options
+		switch(option) {
+			case "map":	// Normal Map
+				var maptype = G_NORMAL_MAP;
+			break;
+			case "sat":	// Satallite Imagery
+				var maptype = G_SATELLITE_MAP;
+			break;
+			case "hybrid":	//Hybrid Map
+				var maptype = G_HYBRID_MAP;
+			break;
+		}
+		return maptype;	
+	}
+	
+	jQuery.jmap._initChecks = function(el) {
+		// Check if API can be loaded
+		if (typeof GBrowserIsCompatible == 'undefined') {
+			// Because map does not load, provide visual error
+			jQuery(el).text(jQuery.jmap.JErrors[jQuery.jmap.JOptions.language].cannotLoad).css({
+				color: "#f00"
+			});
+			// Throw exception
+			throw Error(jQuery.jmap.JErrors[jQuery.jmap.JOptions.language].cannotLoad);
+		}
+		// Check to see if browser is compatible, if not throw and exception
+		if (!GBrowserIsCompatible()) {
+			// Because map does not load, provide visual error
+			jQuery(el).text(jQuery.jmap.JErrors[jQuery.jmap.JOptions.language].browserNotCompatible).css({color: "#f00"});
+			// Throw exception
+			throw Error(jQuery.jmap.JErrors[jQuery.jmap.JOptions.language].browserNotCompatible);
+		}
+	}
+	
+	jQuery.jmap.storePoints = function(options, callback) {
+		jQuery.jmap.store = jQuery.extend({}, jQuery.jmap.store, options);
+		if (typeof callback == 'function') return callback(jQuery.jmap.store);
+	}
+	
+	jQuery.fn.jmap = function(method, options, callback) {
+		return this.each(function(){
+			if (method == "init") {
+				new jQuery.jmap.init(this, options, callback);
+			} else if (typeof method == 'object' || method == null) {
+				new jQuery.jmap.init(this, method, options);
+			} else if (typeof options == 'function'){
+				new jQuery.jmap[method](options);
+			} else {
+				try {
+					new jQuery.jmap[method](options, callback);
+				} catch(err) {
+					throw Error(jQuery.jmap.JErrors[jQuery.jmap.JOptions.language].functionDoesNotExist);
+				}
+			}
+		});
+	}
+})(jQuery);

web/scripts/jquery.jmap.min.js

+(function(A){A.jmap=A.jmap||{};A.jmap.store={};A.jmap.JDetails={name:"jMaps Google Maps Plugin",description:"jMaps is a jQuery plugin that makes google maps easy",version:"3.0",releaseDate:"19/04/2008",author:"Tane Piper <digitalspaghetti@gmail.com>",blog:"http://digitalspaghetti.me.uk",repository:"http://hg.digitalspaghetti.me.uk/jmaps",googleGroup:"http://groups.google.com/group/jmaps",licenceType:"MIT",licenceURL:"http://www.opensource.org/licenses/mit-license.php"};A.jmap.JErrors={en:{functionDoesNotExist:"jMap Error 1: The function does not exist",addressNotFound:"This address cannot be found.  Please modify your search.",browserNotCompatible:"This browser is reported as being not compatible with Google Maps.",cannotLoad:"Cannot load the Google Maps API at this time.  Please check your connection."},fr:{addressNotFound:"Cette adresse ne peut pas être trouvée. Veuillez modifier votre recherche.",browserNotCompatible:"Ce navigateur est rapporté en tant qu'étant non compatible avec des cartes de Google.",cannotLoad:"Ne peut pas charger les cartes api de Google actuellement. Veuillez vérifier votre raccordement."},de:{addressNotFound:"Diese Adresse kann nicht gefunden werden. Ändern Sie bitte Ihre Suche.",browserNotCompatible:"Diese Datenbanksuchroutine wird als seiend nicht kompatibel mit Google Diagrammen berichtet.",cannotLoad:"Kann nicht die Google Diagramme API diesmal laden. Überprüfen Sie bitte Ihren Anschluß."},nl:{addressNotFound:"Dit adres kan worden gevonden niet. Gelieve te wijzigen uw onderzoek.",browserNotCompatible:"Dit browser wordt gemeld zoals zijnd niet compatibel met Kaarten Google.",cannotLoad:"Kan de Google Kaarten API op dit moment laden niet. Gelieve te controleren uw verbinding."},es:{addressNotFound:"Esta dirección no puede ser encontrada. Modifique por favor su búsqueda.",browserNotCompatible:"Este browser se divulga como siendo no compatible con los mapas de Google.",cannotLoad:"No puede cargar los mapas API de Google en este tiempo. Compruebe por favor su conexión."},sv:{addressNotFound:"Denna adress kunde ej hittas. Var god justera din sökning",browserNotCompatible:"Denna webbläsare är ej kompatibel med Google Maps",cannotLoad:"Kan inte ladda Google Maps API för tillfället. Var god kontrollera din anslutning."}};A.jmap.JDefaults={language:"en",mapType:"map",mapCenter:[55.958858,-3.162302],mapDimensions:[400,400],mapZoom:12,mapControlSize:"small",mapEnableType:false,mapEnableOverview:false,mapEnableDragging:true,mapEnableInfoWindows:true,mapEnableDoubleClickZoom:false,mapEnableScrollZoom:false,mapEnableSmoothZoom:false,mapEnableGoogleBar:false,mapEnableScaleControl:false,mapShowjMapIcon:true,debugMode:false};A.jmap.JAdsManagerDefaults={publisherId:""};A.jmap.JFeedDefaults={feedUrl:"",mapCenter:[]};A.jmap.JGroundOverlayDefaults={overlaySouthWestBounds:[],overlayNorthEastBounds:[],overlayImage:""};A.jmap.JIconDefaults={iconImage:"",iconShadow:"",iconSize:null,iconShadowSize:null,iconAnchor:null,iconInfoWindowAnchor:null,iconPrintImage:"",iconMozPrintImage:"",iconPrintShadow:"",iconTransparent:""};A.jmap.JMarkerManagerDefaults={borderPadding:100,maxZoom:17,trackMarkers:false};A.jmap.JMarkerDefaults={pointLatLng:[],pointHTML:null,pointOpenHTMLEvent:"click",pointIsDraggable:false,pointIsRemovable:false,pointRemoveEvent:"dblclick",pointMinZoom:4,pointMaxZoom:17,pointIcon:null,pointMaxContent:null,pointMaxTitle:null};A.jmap.JPolygonDefaults={polygonPoints:[],polygonStrokeColor:"#000000",polygonStrokeWeight:5,polygonStrokeOpacity:1,polygonFillColor:"#ff0000",polygonFillOpacity:1,mapCenter:[],polygonClickable:true};A.jmap.JPolylineDefaults={polylinePoints:[],polylineStrokeColor:"#ff0000",polylineStrokeWidth:10,polylineStrokeOpacity:1,mapCenter:[],polylineGeodesic:false,polylineClickable:true};A.jmap.JScreenOverlayDefaults={};A.jmap.JSearchAddressDefaults={address:null,cache:{},countryCode:"uk"};A.jmap.JSearchDirectionsDefault={fromAddress:"",toAddress:"",directionsPanel:""};A.jmap.JTrafficDefaults={method:"create",mapCenter:[]};A.jmap.JMoveToDefaults={centerMethod:"normal",mapType:null,mapCenter:[],mapZoom:null};A.jmap.JSavePositionDefaults={recall:false};A.jmap.variables={mapType:"Unknown",mapCenter:[]};A.jmap.init=function(C,B,E){var B=A.extend({},A.jmap.JDefaults,B);var B=A.jmap.JOptions=A.meta?A.extend({},B,A(this).data()):B;A.jmap._initChecks(C);C.jmap=A.jmap.GMap2=new GMap2(C);if(B.mapShowjMapIcon){A.jmap.addScreenOverlay({imageUrl:"http://hg.digitalspaghetti.me.uk/jmaps/raw-file/3228fade0b3c/docs/images/jmaps-mapicon.png",screenXY:[70,10],overlayXY:[0,0],size:[42,25]})}var D=A.jmap._initMapType(B.mapType);C.jmap.setCenter(new GLatLng(B.mapCenter[0],B.mapCenter[1]),B.mapZoom,D);switch(B.mapControlSize){case"small":C.jmap.addControl(new GSmallMapControl());break;case"large":C.jmap.addControl(new GLargeMapControl());break}if(B.mapEnableType){C.jmap.addControl(new GMapTypeControl())}if(B.mapEnableOverview){C.jmap.addControl(new GOverviewMapControl())}if(!B.mapEnableDragging){C.jmap.disableDragging()}if(!B.mapEnableInfoWindows){C.jmap.disableInfoWindow()}if(B.mapEnableDoubleClickZoom){C.jmap.enableDoubleClickZoom()}if(B.mapEnableScrollZoom){C.jmap.enableScrollWheelZoom()}if(B.mapEnableSmoothZoom){C.jmap.enableContinuousZoom()}if(B.mapEnableGoogleBar){C.jmap.enableGoogleBar()}if(B.mapEnableScaleControl){C.jmap.addControl(new GScaleControl())}if(B.debugMode){console.log(C.jmap)}A.jmap.getMapType();if(typeof E=="function"){return E(C,B)}};A.jmap.addFeed=function(B,D){var B=A.extend({},A.jmap.JFeedDefaults,B);var C=new GGeoXml(B.feedUrl);A.jmap.GMap2.addOverlay(C);if(B.mapCenter[0]&&B.mapCenter[1]){A.jmap.GMap2.setCenter(new GLatLng(B.mapCenter[0],B.mapCenter[1]))}if(typeof D=="function"){return D(C,B)}};A.jmap.addGroundOverlay=function(B,D){var B=A.extend({},A.jmap.JGroundOverlayDefaults,B);var C=new GLatLngBounds(new GLatLng(B.overlaySouthWestBounds[0],B.overlaySouthWestBounds[1]),new GLatLng(B.overlayNorthEastBounds[0],B.overlayNorthEastBounds[1]));A.jmap.GGroundOverlay=new GGroundOverlay(B.overlayImage,C);A.jmap.GMap2.addOverlay(A.jmap.GGroundOverlay);if(typeof D=="function"){return D()}};A.jmap.hideGroundOverlay=function(B){A.jmap.GGroundOverlay.hide();if(typeof B=="function"){return B()}};A.jmap.showGroundOverlay=function(B){isHidden=A.jmap.GGroundOverlay.isHidden();if(isHidden){A.jmap.GGroundOverlay.show()}if(typeof B=="function"){return B()}};A.jmap.addMarker=function(D,E){var D=A.extend({},A.jmap.JMarkerDefaults,D);var C={};if(typeof D.pointIcon=="object"){A.extend(C,{icon:D.pointIcon})}if(D.pointIsDraggable){A.extend(C,{draggable:D.pointIsDraggable})}var B=new GMarker(new GLatLng(D.pointLatLng[0],D.pointLatLng[1]),C);if(D.pointHTML){GEvent.addListener(B,D.pointOpenHTMLEvent,function(){B.openInfoWindowHtml(D.pointHTML,{maxContent:D.pointMaxContent,maxTitle:D.pointMaxTitle})})}if(D.pointIsRemovable){GEvent.addListener(B,D.pointRemoveEvent,function(){A.jmap.GMap2.removeOverlay(B)})}if(A.jmap.GMarkerManager){A.jmap.GMarkerManager.addMarker(B,D.pointMinZoom,D.pointMaxZoom)}else{A.jmap.GMap2.addOverlay(B)}if(typeof E=="function"){return E()}};A.jmap.addScreenOverlay=function(C,D){var C=A.extend({},A.jmap.JScreenOverlayDefaults,C);var B=new GScreenOverlay(C.imageUrl,new GScreenPoint(C.screenXY[0],C.screenXY[1]),new GScreenPoint(C.overlayXY[0],C.overlayXY[1]),new GScreenSize(C.size[0],C.size[1]));A.jmap.GMap2.addOverlay(B);if(typeof D=="function"){return D(B,C)}};A.jmap.addPolygon=function(C,E){var C=A.extend({},A.jmap.JPolygonDefaults,C);B={};if(!C.polygonClickable){var B=A.extend({},B,{clickable:false})}if(C.mapCenter[0]&&C.mapCenter[1]){A.jmap.GMap2.setCenter(new GLatLng(C.mapCenter[0],C.mapCenter[1]))}var D=new GPolygon(C.polygonPoints,C.polygonStrokeColor,C.polygonStrokeWeight,C.polygonStrokeOpacity,C.polygonFillColor,C.polygonFillOpacity,B);A.jmap.GMap2.addOverlay(D);if(typeof E=="function"){return E()}};A.jmap.addPolyline=function(C,E){var C=A.extend({},A.jmap.JPolylineDefaults,C);var D={};if(C.polylineGeodesic){A.extend({},D,{geodesic:true})}if(!C.polylineClickable){A.extend({},D,{clickable:false})}if(C.mapCenter[0]&&C.mapCenter[1]){A.jmap.GMap2.setCenter(new GLatLng(C.mapCenter[0],C.mapCenter[1]))}var B=new GPolyline(C.polylinePoints,C.polylineStrokeColor,C.polylineStrokeWidth,C.polylineStrokeOpacity,D);A.jmap.GMap2.addOverlay(B);if(typeof E=="function"){return E()}};A.jmap.addTrafficInfo=function(B,C){var B=A.extend({},A.jmap.JTrafficDefaults,B);switch(B.method){case"create":A.jmap.GTrafficOverlay=new GTrafficOverlay;A.jmap.GMap2.addOverlay(A.jmap.GTrafficOverlay);if(B.mapCenter[0]&&B.mapCenter[1]){A.jmap.GMap2.setCenter(new GLatLng(B.mapCenter[0],B.mapCenter[1]))}break;case"destroy":A.jmap.GMap2.removeOverlay(A.jmap.GTrafficOverlay);break}if(typeof C=="function"){return C()}};A.jmap.disableTraffic=function(B){A.jmap.GTrafficOverlay.hide();if(typeof B=="function"){return B()}};A.jmap.enableTraffic=function(B){A.jmap.GTrafficOverlay.show();if(typeof B=="function"){return B()}};A.jmap.createAdsManager=function(B,C){var B=A.extend({},A.jmap.JAdsManagerDefaults,B);A.jmap.GAdsManager=new GAdsManager(A.jmap.GMap2,B.publisherId);if(typeof C=="function"){return C()}};A.jmap.hideAds=function(B){A.jmap.GAdsManager.disable();if(typeof B=="function"){return B()}};A.jmap.showAds=function(B){A.jmap.GAdsManager.enable();if(typeof B=="function"){return B()}};A.jmap.createGeoCache=function(B){A.jmap.GGeocodeCache=new GGeocodeCache();if(typeof B=="function"){return B()}};A.jmap.createGeoCoder=function(B,C){if(B){A.jmap.GClientGeocoder=new GClientGeocoder(B)}else{A.jmap.GClientGeocoder=new GClientGeocoder}if(typeof C=="function"){return C()}};A.jmap.createIcon=function(B){var B=A.extend({},A.jmap.JIconDefaults,B);var C=new GIcon(G_DEFAULT_ICON);if(B.iconImage){C.image=B.iconImage}if(B.iconShadow){C.shadow=B.iconShadow}if(B.iconSize){C.iconSize=B.iconSize}if(B.iconShadowSize){C.shadowSize=B.iconShadowSize}if(B.iconAnchor){C.iconAnchor=B.iconAnchor}if(B.iconInfoWindowAnchor){C.infoWindowAnchor=B.iconInfoWindowAnchor}return C};A.jmap.createMarkerManager=function(B,C){var B=A.extend({},A.jmap.JMarkerManagerDefaults,B);A.jmap.GMarkerManager=new GMarkerManager(A.jmap.GMap2,B);if(typeof C=="function"){return C()}};A.jmap.searchAddress=function(B,E){var B=A.extend({},A.jmap.JSearchAddressDefaults,B);var C=A.extend({},A.jmap.JMarkerManagerDefaults);if(typeof A.jmap.GClientGeocoder=="undefined"){var D=new GClientGeocoder}else{var D=A.jmap.GClientGeocoder}D.getLatLng(B.address,function(F){if(!F){throw new Error(A.jmap.JErrors[A.jmap.JOptions.language].addressNotFound)}if(typeof E=="function"){return E(B,F)}})};A.jmap.searchDirections=function(C,D){var C=A.extend({},A.jmap.JSearchDirectionsDefaults,C);var B=A("#"+C.directionsPanel).get(0);A.jmap.GDirections=new GDirections(A.jmap.GMap2,B);A.jmap.GDirections.load(C.fromAddress+" to "+C.toAddress);if(typeof D=="function"){return D()}};A.jmap.moveTo=function(C,E){var C=A.extend({},A.jmap.JMoveToDefaults,C);if(C.mapType){var D=A.jmap._initMapType(C.mapType)}var B=new GLatLng(C.mapCenter[0],C.mapCenter[1]);switch(C.centerMethod){case"normal":A.jmap.GMap2.setCenter(B,C.mapZoom,D);break;case"pan":A.jmap.GMap2.panTo(B);break}if(typeof E=="function"){return E()}};A.jmap.savePosition=function(B,C){var B=A.extend({},A.jmap.JMoveToDefaults,B);if(B.recall){A.jmap.GMap2.returnToSavedPosition()}else{A.jmap.GMap2.savePosition()}if(typeof C=="function"){return C()}};A.jmap.createKeyboardHandler=function(B){A.jmap.keyboardHandler=new GKeyboardHandler(A.jmap.GMap2);if(typeof B=="function"){return B()}};A.jmap.getMapType=function(){var C=A.jmap.GMap2.getMapTypes();var B=A.jmap.GMap2.getCurrentMapType();if(B.Hz){A.jmap.variables.mapType=B.Hz}};A.jmap.getCenter=function(){var B=A.jmap.GMap2.getCenter();A.jmap.variables.mapCenter=B;if(typeof callback=="function"){return callback(B)}};A.jmap.getBounds=function(){var B=A.jmap.GMap2.getBounds();A.jmap.variables.mapBounds=B;if(typeof callback=="function"){return callback(B)}};A.jmap._initMapType=function(B){switch(B){case"map":var C=G_NORMAL_MAP;break;case"sat":var C=G_SATELLITE_MAP;break;case"hybrid":var C=G_HYBRID_MAP;break}return C};A.jmap._initChecks=function(B){if(typeof GBrowserIsCompatible=="undefined"){A(B).text(A.jmap.JErrors[A.jmap.JOptions.language].cannotLoad).css({color:"#f00"});throw Error(A.jmap.JErrors[A.jmap.JOptions.language].cannotLoad)}if(!GBrowserIsCompatible()){A(B).text(A.jmap.JErrors[A.jmap.JOptions.language].browserNotCompatible).css({color:"#f00"});throw Error(A.jmap.JErrors[A.jmap.JOptions.language].browserNotCompatible)}};A.jmap.storePoints=function(B,C){A.jmap.store=A.extend({},A.jmap.store,B);if(typeof C=="function"){return C(A.jmap.store)}};A.fn.jmap=function(D,B,C){return this.each(function(){if(D=="init"){new A.jmap.init(this,B,C)}else{if(typeof D=="object"||D==null){new A.jmap.init(this,D,B)}else{if(typeof B=="function"){new A.jmap[D](B)}else{try{new A.jmap[D](B,C)}catch(E){throw Error(A.jmap.JErrors[A.jmap.JOptions.language].functionDoesNotExist)}}}}})}})(jQuery);