コード例 #1
0
ファイル: Popup.php プロジェクト: netzmacht/php-leaflet
 /**
  * Create openOn map method.
  *
  * @param Map $map The map.
  *
  * @return $this
  */
 public function openOn(Map $map)
 {
     $this->map = $map;
     $map->addLayer($this);
     return $this->addMethod('openOn', array($map));
 }
コード例 #2
0
ファイル: AbstractControl.php プロジェクト: pfitz/php-leaflet
 /**
  * Add control to the map.
  *
  * @param Map $map The leaflet map.
  *
  * @return $this
  */
 public function addTo(Map $map)
 {
     $map->addControl($this);
     return $this->addMethod('addTo', array($map));
 }
コード例 #3
0
 /**
  * Build map bounds calculations.
  *
  * @param Map      $map   The map being built.
  * @param MapModel $model The map model.
  *
  * @return void
  */
 private function buildLocate(Map $map, MapModel $model)
 {
     if ($model->locate) {
         $options = array();
         $mapping = array('setView' => 'locateSetView', 'watch' => 'locateWatch', 'enableHighAccuracy' => 'enableHighAccuracy');
         foreach ($mapping as $option => $property) {
             if ($model->{$property}) {
                 $options[$option] = (bool) $model->{$property};
             }
         }
         $mapping = array('maxZoom' => 'locateMaxZoom', 'timeout' => 'locateTimeout', 'maximumAge' => 'locateMaximumAge');
         foreach ($mapping as $option => $property) {
             if ($model->{$property}) {
                 $options[$option] = (int) $model->{$property};
             }
         }
         $map->locate($options);
     }
 }