r64311 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64310‎ | r64311 | r64312 >
Date:21:38, 28 March 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.6
* Re-enabled smart pan zoom control functionallity
Modified paths:
  • /trunk/extensions/Maps/GoogleMaps/GoogleMapFunctions.js (modified) (history)
  • /trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js (modified) (history)
  • /trunk/extensions/Maps/YahooMaps/YahooMapFunctions.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js
@@ -25,6 +25,7 @@
2626 };
2727
2828 var map = new OpenLayers.Map(mapName, mapOptions);
 29+ var mapElement = document.getElementById(mapName);
2930
3031 // Add the controls.
3132 for (i in controls) {
@@ -32,7 +33,7 @@
3334 // If a string is provided, find the correct name for the control, and use eval to create the object itself.
3435 if (typeof controls[i] == 'string') {
3536 if (controls[i].toLowerCase() == 'autopanzoom') {
36 - //if (height > 140) controls[i] = height > 320 ? 'panzoombar' : 'panzoom';
 37+ if (mapElement.offsetHeight > 140) controls[i] = mapElement.offsetHeight > 320 ? 'panzoombar' : 'panzoom';
3738 }
3839
3940 control = getValidControlName(controls[i]);
Index: trunk/extensions/Maps/GoogleMaps/GoogleMapFunctions.js
@@ -84,7 +84,7 @@
8585 // List of GControls: http://code.google.com/apis/maps/documentation/reference.html#GControl
8686 for (i in mapOptions.controls){
8787 if (mapOptions.controls[i].toLowerCase() == 'auto') {
88 - // if (mapOptions.height > 75) mapOptions.controls[i] = mapOptions.height > 320 ? 'large' : 'small';
 88+ if (mapElement.offsetHeight > 75) mapOptions.controls[i] = mapElement.offsetHeight > 320 ? 'large' : 'small';
8989 }
9090
9191 switch (mapOptions.controls[i]) {
Index: trunk/extensions/Maps/YahooMaps/YahooMapFunctions.js
@@ -60,7 +60,7 @@
6161
6262 for (i in controls){
6363 if (controls[i].toLowerCase() == 'auto-zoom') {
64 - //if (height > 42) controls[i] = height > 100 ? 'zoom' : 'zoom-short';
 64+ if (mapElement.offsetHeight > 42) controls[i] = mapElement.offsetHeight > 100 ? 'zoom' : 'zoom-short';
6565 }
6666
6767 switch (controls[i]) {

Status & tagging log