Skip to content

classes_lib_controls_leaflet.class

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Classes in file lib/controls/leaflet.class.php

class LeafLet

HTML anchor element Wraped as control to allow to inherit from this class and add code for AJAX handling in that derivered classes.

Extends: Control » Renderable

AddAddress

Adds an address to the map. Will use geolocation API to resolve the address to a marker.

Definition: public function AddAddress($address, $title=false, $report_back_url=false)

Returns: static

Parameters:

  • string $address The address as string

  • string $title An optional title

  • bool|string $report_back_url URL to post detection results to (from Javascript) or false to disable

AddMarker

Adds a marker to the map.

Definition: public function AddMarker($lat, $lng, $options)

Returns: static

Parameters:

  • float $lat Latitute

  • float $lng Longitude

  • array $options Optional options

AddMarkerTitled

Shortcut for a named marker.

Definition: public function AddMarkerTitled($lat, $lng, $title, $options)

Returns: static

Parameters:

  • float $lat Latitude

  • float $lng Longitude

  • string $title Marker title

  • array $options Optional options

AddPolygon

Add a polygon.

Definition: public function AddPolygon($color, $points)

Returns: static

Parameters:

  • string $color HTML color

  • array $points Array of points

FindGeoLocation

Find a location using the OpenStreetMap API.

Definition: static public function FindGeoLocation($search, $sRef=false)

Returns: bool|stdClass

Parameters:

  • string $search Search text

  • string $sRef Optional referrer string to send with the query

opt

Sets or gets an option if you specify a $value will set it and retunr $this. else will return the option value

Definition: public function opt($name, $value=null)

Returns: mixed If setting an option returns $this, else returns the option value

Parameters:

  • string $name option name

  • mixed $value option value or null

PreRender

OVERRIDE Control::PreRender

setAutoZoom

En-/Disables auto zooming.

Definition: public function setAutoZoom($on)

Returns: static

Parameters:

  • bool $on If true on, else off

setCenterPoint

Sets the maps center point.

Definition: public function setCenterPoint($lat, $lng)

Returns: static

Parameters:

  • float $lat Latitude

  • float $lng Longitude

setTileProvider

Sets the tile provider.

Definition: public function setTileProvider($name)

Returns: static

Parameters:

  • string $name The provider name

setType

DEPRECATED (2020/10) This method does nothing. It's just there to be compatible with the gMap control.

setUiDisabled

Disables UI controls.

Definition: public function setUiDisabled($disabled=false)

Returns: static

Parameters:

  • bool $disabled If true disabled, else not

setZoom

Sets the maps zoom level.

Definition: public function setZoom($zoomlevel)

Returns: static

Parameters:

  • int $zoomlevel The initial zoom level
Clone this wiki locally