r61702 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61701‎ | r61702 | r61703 >
Date:00:15, 30 January 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.5.3.
* Small js change
Modified paths:
  • /trunk/extensions/Maps/OpenStreetMap/OSMFunctions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/OpenStreetMap/OSMFunctions.js
@@ -75,7 +75,7 @@
7676
7777 return false;
7878 }
79 -
 79+
8080 function slippymap_map(mapId, mapParams) {
8181 var self = this;
8282 this.mapId = mapId;
@@ -85,17 +85,23 @@
8686
8787 // Add the controls
8888 this.mapOptions = {controls: []};
89 -
 89+
9090 for (i in this.controls) {
91 - if (this.controls[i].toLowerCase() == 'autopanzoom') {
92 - if (this.height > 140) this.controls[i] = this.height > 320 ? 'panzoombar' : 'panzoom';
93 - }
94 -
95 - control = getValidControlName(this.controls[i]);
96 -
97 - if (control) {
98 - eval(' this.mapOptions.controls.push( new OpenLayers.Control.' + control + '() ); ');
 91+ if (typeof controls[i] == 'string') {
 92+ if (this.controls[i].toLowerCase() == 'autopanzoom') {
 93+ if (this.height > 140) this.controls[i] = this.height > 320 ? 'panzoombar' : 'panzoom';
 94+ }
 95+
 96+ control = getValidControlName(this.controls[i]);
 97+
 98+ if (control) {
 99+ eval(' this.mapOptions.controls.push( new OpenLayers.Control.' + control + '() ); ');
 100+ }
99101 }
 102+ else {
 103+ this.mapOptions.controls.push(controls[i]); // If a control is provided, instead a string, just add it
 104+ controls[i].activate(); // And activate it
 105+ }
100106 }
101107 }
102108

Status & tagging log