r98406 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98405‎ | r98406 | r98407 >
Date:12:40, 29 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
patch by Michael Erdmann
Modified paths:
  • /trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js
@@ -93,14 +93,14 @@
9494 */
9595 this.removeEarthType = function() {
9696 if ( Array.prototype.filter ) {
97 - options.types = options.types.filter( function( element, index, array ) { return element != 'earth'; } );
 97+ options.types = options.types.filter( function( element, index, array ) { return element !== 'earth'; } );
9898 }
9999 else {
100100 // Seems someone is using the o-so-awesome browser that is IE.
101101 var types = [];
102102
103103 for ( i in options.types ) {
104 - if ( options.types[i] != 'earth' ) {
 104+ if ( typeof( options.types[i] ) !== 'function' && options.types[i] !== 'earth' ) {
105105 types.push( options.types[i] );
106106 }
107107 }
@@ -110,10 +110,6 @@
111111 };
112112
113113 this.addOverlays = function() {
114 -// for ( i in this.markers ) {
115 -// this.markers[i].setMap( map );
116 -// }
117 -
118114 // Add the Google KML/KMZ layers.
119115 for ( i = options.gkml.length - 1; i >= 0; i-- ) {
120116 var kmlLayer = new google.maps.KmlLayer(
@@ -159,7 +155,9 @@
160156 mapOptions.streetViewControl = $.inArray( 'streetview', options.controls ) != -1;
161157
162158 for ( i in options.types ) {
163 - options.types[i] = eval( 'google.maps.MapTypeId.' + options.types[i] );
 159+ if ( typeof( options.types[i] ) !== 'function' ) {
 160+ options.types[i] = eval( 'google.maps.MapTypeId.' + options.types[i] );
 161+ }
164162 }
165163
166164 // Map control styles