Changeset 3158 for trunk/modules
- Timestamp:
- 07/19/2008 07:42:10 PM (5 months ago)
- Files:
-
- 1 modified
-
trunk/modules/gmaps/libraries/Gmap.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/gmaps/libraries/Gmap.php
r3156 r3158 136 136 protected $center; 137 137 protected $control; 138 protected $overview_control; 138 139 protected $type_control = FALSE; 139 140 … … 201 202 202 203 /** 204 * Set the GMap overview map. 205 * 206 * @chainable 207 * @param integer $width width 208 * @param integer $height height 209 * @return object 210 */ 211 public function overview($width = '', $height = '') 212 { 213 $size = (is_int($width) AND is_int($height)) ? 'new GSize('.$width.','.$height.')' : ''; 214 $this->overview_control = 'map.addControl(new google.maps.OverviewMapControl('.$size.'));'; 215 216 return $this; 217 } 218 219 /** 203 220 * Set the GMap type controls. 204 221 * by default renders G_NORMAL_MAP, G_SATELLITE_MAP, and G_HYBRID_MAP … … 259 276 260 277 // Map controls 261 $controls = empty($this->control) ? '' : 'map.addControl(new google.maps.'.$this->control.'MapControl());';278 $controls[] = empty($this->control) ? '' : 'map.addControl(new google.maps.'.$this->control.'MapControl());'; 262 279 263 280 // Map Types … … 267 284 { 268 285 foreach($this->types as $type => $action) 269 $controls .= 'map.'.$action.'MapType('.$type.');';286 $controls[] = 'map.'.$action.'MapType('.$type.');'; 270 287 } 271 288 272 $controls .= 'map.addControl(new google.maps.MapTypeControl());'; 273 } 289 $controls[] = 'map.addControl(new google.maps.MapTypeControl());'; 290 } 291 292 if ( ! empty($this->overview_control)) 293 $controls[] = $this->overview_control; 274 294 275 295 // Map centering … … 281 301 'map' => $map, 282 302 'options' => $this->options, 283 'controls' => $controls,303 'controls' => implode("\n", $controls), 284 304 'center' => $center, 285 305 'markers' => $this->markers,
