示例#1
0
 /**
  * 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
 /**
  * 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
 /**
  * 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
 /**
  * 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));
 }