/** * 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}.control.fullscreen({$map->options2Js($this->options)})"); }
/** * 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) { return new JsExpression("{$map->leafletVar}.icon({$map->options2Js($this->options)})"); }
/** * Generates the object's JavaScript code * * @param Map $map The map widget * @return JsExpression Object JavaScript code */ public function toJs($map) { $baseLayers = $overlays = []; foreach ($this->_baseLayers as $key => $layer) { $baseLayers[$key] = $layer->jsVar; } foreach ($this->_overlays as $key => $layer) { $overlays[$key] = $layer->jsVar; } $baseLayers = Json::encode($baseLayers); $overlays = Json::encode($overlays); return $this->toJsExpression("{$map->leafletVar}.control.layers({$baseLayers}, {$overlays}, {$map->options2Js($this->options)})"); }
/** * 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) { return $this->toJsExpression("{$map->leafletVar}.popup({$map->options2Js($this->options)}).setContent('{$this->_content}').setLatLng({$this->getLatLng()->toJs($map)})" . $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) { $data = Json::encode($this->_data); return $this->toJsExpression("{$map->leafletVar}.geoJson({$data}, {$map->options2Js($this->options)})" . $map->events2Js($this->events)); }