http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94064

Revision: 94064
Author:   jeroendedauw
Date:     2011-08-08 16:28:50 +0000 (Mon, 08 Aug 2011)
Log Message:
-----------
fixed zoom parameter for google maps v3

Modified Paths:
--------------
    trunk/extensions/Maps/RELEASE-NOTES
    trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js

Modified: trunk/extensions/Maps/RELEASE-NOTES
===================================================================
--- trunk/extensions/Maps/RELEASE-NOTES 2011-08-08 16:20:33 UTC (rev 94063)
+++ trunk/extensions/Maps/RELEASE-NOTES 2011-08-08 16:28:50 UTC (rev 94064)
@@ -14,6 +14,8 @@
 
 * Use of Validator 0.4.10s setMessage method instead of setDescription for 
better i18n.
 
+* Fixed zoom parameter for Google Maps v3.
+
 === Maps 1.0 ===
 (2011-07-19)
 

Modified: 
trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js
===================================================================
--- trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js     
2011-08-08 16:20:33 UTC (rev 94063)
+++ trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js     
2011-08-08 16:28:50 UTC (rev 94064)
@@ -5,7 +5,7 @@
  * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
  */
 
-(function( $ ){ $.fn.googlemaps = function( options ) {
+(function( $, mw ){ $.fn.googlemaps = function( options ) {
 
        /**
         * All markers that are currently on the map.
@@ -147,11 +147,12 @@
                for ( var i = markers.length - 1; i >= 0; i-- ) {
                        bounds.extend( markers[i].getPosition() );
                }
-               
+       }
+       
+       if ( options.zoom === false ) {
                map.fitBounds( bounds );
        }
-       
-       if ( options.zoom !== false ) {
+       else {
                map.setZoom( options.zoom );
        }
        
@@ -186,4 +187,4 @@
        
        return this;
        
-}; })( jQuery );
\ No newline at end of file
+}; })( jQuery, window.mediaWiki );
\ No newline at end of file


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to