1 | <?php |
||
27 | class LatLngBounds extends Type |
||
28 | { |
||
29 | /** |
||
30 | * @var string the variable name. If not null, then the js icon creation script |
||
31 | * will be returned as a variable: |
||
32 | * |
||
33 | * ``` |
||
34 | * var bounds = L.latLngBounds(...); |
||
35 | * // after it can be included to the map |
||
36 | * map.fitBounds(bounds); |
||
37 | * ``` |
||
38 | * If null, the js icon creation script will be returned to be used as constructor so it can be used within another |
||
39 | * constructor options: |
||
40 | * |
||
41 | * ``` |
||
42 | * L.map({maxBounds: L.latLngBounds(...)); |
||
43 | * ``` |
||
44 | */ |
||
45 | public $name; |
||
46 | /** |
||
47 | * @var LatLng the southWest boundary |
||
48 | */ |
||
49 | private $_southWest; |
||
50 | /** |
||
51 | * @var LatLng the northEast boundary |
||
52 | */ |
||
53 | private $_northEast; |
||
54 | |||
55 | /** |
||
56 | * @return LatLng |
||
57 | */ |
||
58 | 45 | public function getSouthWest() |
|
62 | |||
63 | /** |
||
64 | * @param LatLng $latLng |
||
65 | */ |
||
66 | 45 | public function setSouthWest(LatLng $latLng) |
|
70 | |||
71 | /** |
||
72 | * @return LatLng |
||
73 | */ |
||
74 | 45 | public function getNorthEast() |
|
78 | |||
79 | /** |
||
80 | * @param LatLng $latLng |
||
81 | */ |
||
82 | 45 | public function setNorthEast(LatLng $latLng) |
|
86 | |||
87 | /** |
||
88 | * Initializes the class |
||
89 | * @throws \yii\base\InvalidConfigException |
||
90 | */ |
||
91 | 45 | public function init() |
|
98 | |||
99 | /** |
||
100 | * @return \yii\web\JsExpression the js initialization code of the object |
||
101 | */ |
||
102 | 21 | public function encode() |
|
112 | |||
113 | /** |
||
114 | * Finds bounds of an array of LatLng instances |
||
115 | * |
||
116 | * @param LatLng[] $latLngs |
||
117 | * @param int $margin |
||
118 | * |
||
119 | * @return LatLngBounds |
||
120 | */ |
||
121 | 24 | public static function getBoundsOfLatLngs(array $latLngs, $margin = 0) |
|
151 | } |
||
152 |