Index: trunk/extensions/Maps/OpenLayers/OpenLayerFunctions.js |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | }; |
27 | 27 | |
28 | 28 | var map = new OpenLayers.Map(mapName, mapOptions); |
| 29 | + var mapElement = document.getElementById(mapName); |
29 | 30 | |
30 | 31 | // Add the controls. |
31 | 32 | for (i in controls) { |
— | — | @@ -32,7 +33,7 @@ |
33 | 34 | // If a string is provided, find the correct name for the control, and use eval to create the object itself. |
34 | 35 | if (typeof controls[i] == 'string') { |
35 | 36 | 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'; |
37 | 38 | } |
38 | 39 | |
39 | 40 | control = getValidControlName(controls[i]); |
Index: trunk/extensions/Maps/GoogleMaps/GoogleMapFunctions.js |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | // List of GControls: http://code.google.com/apis/maps/documentation/reference.html#GControl |
86 | 86 | for (i in mapOptions.controls){ |
87 | 87 | 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'; |
89 | 89 | } |
90 | 90 | |
91 | 91 | switch (mapOptions.controls[i]) { |
Index: trunk/extensions/Maps/YahooMaps/YahooMapFunctions.js |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | |
62 | 62 | for (i in controls){ |
63 | 63 | 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'; |
65 | 65 | } |
66 | 66 | |
67 | 67 | switch (controls[i]) { |