r66022 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66021‎ | r66022 | r66023 >
Date:15:12, 7 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Applied patch of Benjamin Langguth as seen in bug 23431
Modified paths:
  • /trunk/extensions/Maps/Maps.i18n.php (modified) (history)
  • /trunk/extensions/Maps/Services/GoogleMaps/GoogleMapFunctions.js (modified) (history)
  • /trunk/extensions/Maps/Services/GoogleMaps3/GoogleMap3Functions.js (modified) (history)
  • /trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js (modified) (history)
  • /trunk/extensions/Maps/Services/OpenStreetMap/OSMFunctions.js (modified) (history)
  • /trunk/extensions/Maps/Services/YahooMaps/YahooMapFunctions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Services/GoogleMaps3/GoogleMap3Functions.js
@@ -17,7 +17,7 @@
1818
1919 // TODO: types - http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeRegistry
2020
21 - for (marker in markerData) getGMaps3Marker(map, markerData[marker]);
 21+ for (var marker = 0; marker < markerData.length; marker++) getGMaps3Marker(map, markerData[marker]);
2222 }
2323
2424 function getGMaps3Marker(map, data) {
Index: trunk/extensions/Maps/Services/YahooMaps/YahooMapFunctions.js
@@ -61,7 +61,7 @@
6262
6363 map.removeZoomScale();
6464
65 - for (i in controls){
 65+ for (var i =0; i < controls.length; i++){
6666 if (controls[i].toLowerCase() == 'auto-zoom') {
6767 if (mapElement.offsetHeight > 42) controls[i] = mapElement.offsetHeight > 100 ? 'zoom' : 'zoom-short';
6868 }
@@ -90,7 +90,7 @@
9191
9292 var map_locations = ((zoom == null || centre == null) && markers.length > 1) ? Array() : null;
9393
94 - for (i in markers) {
 94+ for (var i=0; i < markers.length; i++) {
9595 var marker = markers[i];
9696 map.addOverlay(createYMarker(marker.point, marker.title, marker.label, marker.icon));
9797 if (map_locations != null) map_locations.push(marker.point);
Index: trunk/extensions/Maps/Services/OpenLayers/OpenLayerFunctions.js
@@ -32,7 +32,7 @@
3333 var map = new OpenLayers.Map(mapName, mapOptions);
3434
3535 // Add the controls.
36 - for (i in controls) {
 36+ for (var i = 0; i < controls.length; i++) {
3737
3838 // If a string is provided, find the correct name for the control, and use eval to create the object itself.
3939 if (typeof controls[i] == 'string') {
@@ -54,7 +54,7 @@
5555 }
5656
5757 // Add the base layers.
58 - for (i in mapTypes) map.addLayer(mapTypes[i]);
 58+ for (i = 0; i < mapTypes.length; i++) map.addLayer(mapTypes[i]);
5959
6060 // Layer to hold the markers.
6161 var markerLayer = new OpenLayers.Layer.Markers('Markers');
@@ -69,7 +69,7 @@
7070 bounds = new OpenLayers.Bounds();
7171 }
7272
73 - for (i in marker_data) {
 73+ for (i = 0; i < marker_data.length; i++) {
7474 marker_data[i].lonlat.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
7575 if (bounds != null) bounds.extend(marker_data[i].lonlat); // Extend the bounds when no center is set.
7676 markerLayer.addMarker(getOLMarker(markerLayer, marker_data[i], map.getProjectionObject())); // Create and add the marker.
@@ -102,7 +102,7 @@
103103 'WMSGetFeatureInfo', 'ZoomBox', 'ZoomIn', 'ZoomOut', 'ZoomPanel',
104104 'ZoomToMaxExtent'];
105105
106 - for (i in OLControls) {
 106+ for (var i = 0; i < OLControls.length; i++) {
107107 if (control == OLControls[i].toLowerCase()) {
108108 return OLControls[i];
109109 }
Index: trunk/extensions/Maps/Services/OpenStreetMap/OSMFunctions.js
@@ -57,7 +57,7 @@
5858 'WMSGetFeatureInfo', 'ZoomBox', 'ZoomIn', 'ZoomOut', 'ZoomPanel',
5959 'ZoomToMaxExtent'];
6060
61 - for (i in OLControls) {
 61+ for (var i =0; i < OLControls.length; i++) {
6262 if (control == OLControls[i].toLowerCase()) {
6363 return OLControls[i];
6464 }
@@ -70,13 +70,13 @@
7171 var self = this;
7272 this.mapId = mapId;
7373
74 - for (key in mapParams)
 74+ for (var key = 0; key < mapParams.length key++)
7575 this[key] = mapParams[key];
7676
7777 // Add the controls
7878 this.mapOptions = {controls: []};
7979
80 - for (i in this.controls) {
 80+ for (var i = 0; i < this.controls.length; i++) {
8181 if (typeof controls[i] == 'string') {
8282 if (this.controls[i].toLowerCase() == 'autopanzoom') {
8383 //if (this.height > 140) this.controls[i] = this.height > 320 ? 'panzoombar' : 'panzoom';
@@ -116,7 +116,7 @@
117117 bounds = new OpenLayers.Bounds();
118118 }
119119
120 - for (i in this.markers) {
 120+ for (var i = 0; i < this.markers.length; i++) {
121121 this.markers[i].lonlat.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913"));
122122 if (bounds != null) bounds.extend(this.markers[i].lonlat); // Extend the bounds when no center is set
123123 markerLayer.addMarker(getOSMMarker(markerLayer, this.markers[i], this.map.getProjectionObject())); // Create and add the marker
@@ -140,7 +140,7 @@
141141 var map = new OpenLayers.Map(mapId, this.mapOptions /* all provided for by OSM.js */);
142142
143143 if (initializedContols) {
144 - for (i in initializedContols) {
 144+ for (var i = 0; i < initializedContols.length; i++) {
145145 map.addControl(initializedContols[i]);
146146 initializedContols[i].activate();
147147 }
Index: trunk/extensions/Maps/Services/GoogleMaps/GoogleMapFunctions.js
@@ -96,7 +96,7 @@
9797 map.setMapType(mapOptions.type);
9898
9999 // List of GControls: http://code.google.com/apis/maps/documentation/reference.html#GControl
100 - for (i in mapOptions.controls){
 100+ for (i = 0; i < mapOptions.controls.length; i++){
101101 if (mapOptions.controls[i].toLowerCase() == 'auto') {
102102 if (mapElement.offsetHeight > 75) mapOptions.controls[i] = mapElement.offsetHeight > 320 ? 'large' : 'small';
103103 }
@@ -140,7 +140,7 @@
141141
142142 var bounds = ((mapOptions.zoom == null || mapOptions.centre == null) && markers.length > 1) ? new GLatLngBounds() : null;
143143
144 - for (i in markers) {
 144+ for (i = 0; i < markers.length; i++) {
145145 var marker = markers[i];
146146 map.addOverlay(createGMarker(marker.point, marker.title, marker.label, marker.icon));
147147 if (bounds != null) bounds.extend(marker.point);
Index: trunk/extensions/Maps/Maps.i18n.php
@@ -1,13 +1,13 @@
22 <?php
33
44 /**
5 - * Internationalization file for the Maps extension
 5+ * Internationalization file for the Maps extension.
66 *
77 * @file Maps.i18n.php
88 * @ingroup Maps
99 *
1010 * @author Jeroen De Dauw
11 -*/
 11+ */
1212
1313 $messages = array();
1414

Follow-up revisions

RevisionCommit summaryAuthorDate
r66023Applied patch of Benjamin Langguth as seen in bug 23431jeroendedauw15:12, 7 May 2010

Status & tagging log