SvgOverlay Class¶
- class BeastBytes\Yii\Leaflet\Layers\Vector\SvgOverlay¶
SvgOverlay allows the display of and provides DOM access to an SVG file over specific bounds of the map
@template T of array{float, float}array{float, float, float}|array{lat: float, lng: float}|array{lat: float, lng: float, alt: float}|LatLng
- function __construct(string $innerHtml, array|string $viewBox, array|LatLngBounds $bounds, array $options = [])
- Parameters:
$innerHtml (
string) – The SVG content$viewBox (
array{int, int, int, int}|string) – The SVG view box$bounds (
array{T, T}|LatLngBounds) – The overlay geographical bounds; either an array of corners or a LatLngBounds object$options (
array<string, mixed>.) – SVGOverlay options
Inherited from Layer¶
- BeastBytes\Yii\Leaflet\Layers\Vector\SvgOverlay::popup(string $content, array $options = [])¶
Binds a popup to the layer
- Parameters:
$content (
string) – The popup content$options (
array<string, mixed>.) – Popup options- Returns:
A new instance of SvgOverlay with the popup
- Return type:
SvgOverlay
- BeastBytes\Yii\Leaflet\Layers\Vector\SvgOverlay::tooltip(string $content, array $options = [])¶
Binds a tooltip to the layer
- Parameters:
$content (
string) – The tooltip content$options (
array<string, mixed>.) – Tooltip options- Returns:
A new instance of SvgOverlay with the tooltip
- Return type:
SvgOverlay
Inherited from Component¶
- BeastBytes\Yii\Leaflet\Layers\Vector\SvgOverlay::addToMap(bool $addToMap)¶
Whether to add the component to the map
By default, a component is added to the map.
- Parameters:
$addToMap (
bool) – Whether the component is added to the map- Returns:
A new instance of SvgOverlay with the addToMap parameter set
- Return type:
SvgOverlay
- BeastBytes\Yii\Leaflet\Layers\Vector\SvgOverlay::getJsVar()¶
Returns the JavaScript variable name
- Returns:
The JavaScript variable name
- Return type:
string
- BeastBytes\Yii\Leaflet\Layers\Vector\SvgOverlay::jsVar(string $jsVar)¶
Set the JavaScript variable name
- Parameters:
$jsVar (
string) – The JavaScript variable name- Returns:
A new instance of SvgOverlay with the JavaScript variable name set
- Return type:
SvgOverlay
See also