/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }