Development

Changeset 17901

You must first sign up to be able to contribute.

Changeset 17901

Show
Ignore:
Timestamp:
05/03/09 18:29:39 (5 years ago)
Author:
fabriceb
Message:

[sfEasyGMapPlugin]
* merge of tomr's contribution : it is now possible to add multiple controls to the map

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfEasyGMapPlugin/trunk/lib/GMap.class.php

    r17900 r17901  
    1111  protected $default_options = array( 
    1212      'double_click_zoom' => true, 
    13       'control' => 'new google.maps.LargeMapControl()'
     13      'control' => array('new google.maps.LargeMapControl()')
    1414      'zoom' => 10, 
    1515      'center_lat' => 48.845398, 
     
    264264   * @return $string 
    265265   * @author Fabrice Bernhard 
     266   * @since 2009-04-23 tomr changed control from string to array 
     267   * @since 2009-05-03 fabriceb added backwards compatibility 
    266268   */ 
    267269  public function getJavascript() 
     
    279281      $init_events[] = $this->getJsName().'.enableDoubleClickZoom();'; 
    280282    } 
    281     if ($options['control']!='') 
     283    if (is_array($options['control'])) 
     284    { 
     285      foreach ($options['control'] as $control) 
     286      { 
     287        $init_events[] = $this->getJsName().'.addControl('.$control.');'; 
     288      } 
     289    } 
     290    else if ($options['control'] != '') 
    282291    { 
    283292      $init_events[] = $this->getJsName().'.addControl('.$options['control'].');';