コード例 #1
0
ファイル: GridLayer.php プロジェクト: beastbytes/yii2-leaflet
 /**
  * Generates the object's JavaScript code
  *
  * @param Map $map The map widget
  * @return JsExpression Object JavaScript code
  */
 public function toJs($map)
 {
     return $this->toJsExpression("{$map->leafletVar}.gridLayer({$map->options2Js($this->options)})" . $map->events2Js($this->events));
 }
コード例 #2
0
 /**
  * Generates the object's JavaScript code
  *
  * @param Map $map The map widget
  * @return JsExpression Object JavaScript code
  */
 public function toJs($map)
 {
     $layers = Json::encode($this->getLayers());
     return $this->toJsExpression("{$map->leafletVar}.featureGroup({$layers})" . $map->events2Js($this->events));
 }
コード例 #3
0
ファイル: TileLayer.php プロジェクト: beastbytes/yii2-leaflet
 /**
  * Generates the object's JavaScript code
  *
  * @param Map $map The map widget
  * @return JsExpression Object JavaScript code
  */
 public function toJs($map)
 {
     return $this->toJsExpression("{$map->leafletVar}.tileLayer('{$this->_url}', {$map->options2Js($this->options)})" . $map->events2Js($this->events));
 }
コード例 #4
0
ファイル: Polyline.php プロジェクト: beastbytes/yii2-leaflet
 /**
  * Generates the object's JavaScript code
  *
  * @param Map $map The map widget
  * @return JsExpression Object JavaScript code
  */
 public function toJs($map)
 {
     $latLngs = Json::encode($this->getLatLngs());
     return $this->toJsExpression("{$map->leafletVar}.polyline\n        ({$latLngs}, {$map->options2Js($this->options)})" . $map->events2Js($this->events));
 }
コード例 #5
0
ファイル: GeoJson.php プロジェクト: beastbytes/yii2-leaflet
 /**
  * Generates the object's JavaScript code
  *
  * @param Map $map The map widget
  * @return JsExpression Object JavaScript code
  */
 public function toJs($map)
 {
     $data = Json::encode($this->_data);
     return $this->toJsExpression("{$map->leafletVar}.geoJson({$data}, {$map->options2Js($this->options)})" . $map->events2Js($this->events));
 }