Index: trunk/extensions/Maps/Services/GoogleMaps/GoogleMapFunctions.js |
— | — | @@ -101,45 +101,59 @@ |
102 | 102 | |
103 | 103 | map.setMapType(mapOptions.type); |
104 | 104 | |
| 105 | + var hasSearchBar = false; |
| 106 | + |
| 107 | + for ( i = mapOptions.controls.length - 1; i >= 0; i-- ) { |
| 108 | + if ( mapOptions.controls[i] == 'searchbar' ) { |
| 109 | + hasSearchBar = true; |
| 110 | + break; |
| 111 | + } |
| 112 | + } |
| 113 | + |
105 | 114 | // List of GControls: http://code.google.com/apis/maps/documentation/reference.html#GControl |
106 | | - for (i = 0; i < mapOptions.controls.length; i++){ |
107 | | - if (mapOptions.controls[i].toLowerCase() == 'auto') { |
108 | | - if (mapElement.offsetHeight > 75) mapOptions.controls[i] = mapElement.offsetHeight > 320 ? 'large' : 'small'; |
| 115 | + for ( i = 0; i < mapOptions.controls.length; i++ ) { |
| 116 | + if ( mapOptions.controls[i].toLowerCase() == 'auto' ) { |
| 117 | + if ( mapElement.offsetHeight > 75 ) mapOptions.controls[i] = mapElement.offsetHeight > 320 ? 'large' : 'small'; |
109 | 118 | } |
110 | 119 | |
111 | | - switch (mapOptions.controls[i]) { |
| 120 | + switch ( mapOptions.controls[i] ) { |
112 | 121 | case 'large' : |
113 | | - map.addControl(new GLargeMapControl3D()); |
| 122 | + map.addControl( new GLargeMapControl3D() ); |
114 | 123 | break; |
115 | 124 | case 'small' : |
116 | | - map.addControl(new GSmallZoomControl3D()); |
| 125 | + map.addControl( new GSmallZoomControl3D() ); |
117 | 126 | break; |
118 | 127 | case 'large-original' : |
119 | | - map.addControl(new GLargeMapControl()); |
| 128 | + map.addControl( new GLargeMapControl() ); |
120 | 129 | break; |
121 | 130 | case 'small-original' : |
122 | | - map.addControl(new GSmallMapControl()); |
| 131 | + map.addControl( new GSmallMapControl() ); |
123 | 132 | break; |
124 | 133 | case 'zoom' : |
125 | | - map.addControl(new GSmallZoomControl()); |
| 134 | + map.addControl( new GSmallZoomControl() ); |
126 | 135 | break; |
127 | 136 | case 'type' : |
128 | | - map.addControl(new GMapTypeControl()); |
| 137 | + map.addControl( new GMapTypeControl() ); |
129 | 138 | break; |
130 | 139 | case 'type-menu' : |
131 | | - map.addControl(new GMenuMapTypeControl()); |
| 140 | + map.addControl( new GMenuMapTypeControl() ); |
132 | 141 | break; |
133 | 142 | case 'overlays' : |
134 | | - map.addControl(new MoreControl()); |
135 | | - break; |
| 143 | + map.addControl( new MoreControl() ); |
| 144 | + break; |
136 | 145 | case 'overview' : case 'overview-map' : |
137 | | - map.addControl(new GOverviewMapControl()); |
138 | | - break; |
| 146 | + map.addControl( new GOverviewMapControl() ); |
| 147 | + break; |
139 | 148 | case 'scale' : |
140 | | - map.addControl(new GScaleControl()); |
| 149 | + if ( hasSearchBar ) { |
| 150 | + map.addControl( new GScaleControl(), new GControlPosition( G_ANCHOR_BOTTOM_LEFT, new GSize( 5,37 ) ) ); |
| 151 | + } |
| 152 | + else { |
| 153 | + map.addControl( new GScaleControl() ); |
| 154 | + } |
141 | 155 | break; |
142 | 156 | case 'nav-label' : case 'nav' : |
143 | | - map.addControl(new GNavLabelControl()); |
| 157 | + map.addControl( new GNavLabelControl() ); |
144 | 158 | break; |
145 | 159 | case 'searchbar' : |
146 | 160 | map.enableGoogleBar(); |
— | — | @@ -168,7 +182,7 @@ |
169 | 183 | |
170 | 184 | // Code to add KML files. |
171 | 185 | var kmlOverlays = []; |
172 | | - for ( i = mapOptions.kml.length -1; i >= 0; i-- ) { |
| 186 | + for ( i = mapOptions.kml.length - 1; i >= 0; i-- ) { |
173 | 187 | kmlOverlays[i] = new GGeoXml( mapOptions.kml[i] ); |
174 | 188 | map.addOverlay( kmlOverlays[i] ); |
175 | 189 | } |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define( 'Maps_VERSION', '0.6.4 a6' ); |
| 37 | + define( 'Maps_VERSION', '0.6.4 a7' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 'float' ); |