1 | <?php |
||
25 | class Icon extends Type |
||
26 | { |
||
27 | /** |
||
28 | * @var string the variable name. If not null, then the js icon creation script |
||
29 | * will be returned as a variable: |
||
30 | * |
||
31 | * ``` |
||
32 | * var iconName = L.icon({...}); |
||
33 | * // after it can be shared among other markers |
||
34 | * L.marker({icon: iconName, ...).addTo(map); |
||
35 | * L.marker({icon: iconName, ...).addTo(map); |
||
36 | * ``` |
||
37 | * If null, the js icon creation script will be returned to be used as constructor so it can be used within another |
||
38 | * constructor options: |
||
39 | * |
||
40 | * ``` |
||
41 | * L.marker({icon: L.icon({...}), ...).addTo(map); |
||
42 | * ``` |
||
43 | */ |
||
44 | public $name; |
||
45 | /** |
||
46 | * @var string (required) the URL to the icon image (absolute or relative to your script path). |
||
47 | */ |
||
48 | public $iconUrl; |
||
49 | /** |
||
50 | * @var string the URL to a retina sized version of the icon image (absolute or relative to your script path). Used |
||
51 | * for Retina screen devices. |
||
52 | */ |
||
53 | public $iconRetinaUrl; |
||
54 | /** |
||
55 | * @var string the URL to the icon shadow image. If not specified, no shadow image will be created. |
||
56 | */ |
||
57 | public $shadowUrl; |
||
58 | /** |
||
59 | * @var string the URL to the retina sized version of the icon shadow image. If not specified, no shadow image will |
||
60 | * be created. Used for Retina screen devices. |
||
61 | */ |
||
62 | public $shadowRetinaUrl; |
||
63 | /** |
||
64 | * @var string a custom class name to assign to both icon and shadow images. Empty by default. |
||
65 | */ |
||
66 | public $className; |
||
67 | /** |
||
68 | * @var Point size of the icon image in pixels. |
||
69 | */ |
||
70 | private $_iconSize; |
||
71 | /** |
||
72 | * @var Point the coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so |
||
73 | * that this point is at the marker's geographical location. Centered by default if size is specified, also can be |
||
74 | * set in CSS with negative margins. |
||
75 | */ |
||
76 | private $_iconAnchor; |
||
77 | /** |
||
78 | * @var Point size of the shadow image in pixels. |
||
79 | */ |
||
80 | private $_shadowSize; |
||
81 | /** |
||
82 | * @var Point the coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor |
||
83 | * if not specified). |
||
84 | */ |
||
85 | private $_shadowAnchor; |
||
86 | /** |
||
87 | * @var Point the coordinates of the point from which popups will "open", relative to the icon anchor. |
||
88 | */ |
||
89 | private $_popupAnchor; |
||
90 | |||
91 | /** |
||
92 | * @param Point $iconAnchor |
||
93 | */ |
||
94 | 3 | public function setIconAnchor(Point $iconAnchor) |
|
98 | |||
99 | /** |
||
100 | * @return Point |
||
101 | */ |
||
102 | 6 | public function getIconAnchor() |
|
106 | |||
107 | /** |
||
108 | * @param Point $iconSize |
||
109 | */ |
||
110 | 3 | public function setIconSize(Point $iconSize) |
|
114 | |||
115 | /** |
||
116 | * @return Point |
||
117 | */ |
||
118 | 6 | public function getIconSize() |
|
122 | |||
123 | /** |
||
124 | * @param Point $popupAnchor |
||
125 | */ |
||
126 | 3 | public function setPopupAnchor(Point $popupAnchor) |
|
130 | |||
131 | /** |
||
132 | * @return Point |
||
133 | */ |
||
134 | 6 | public function getPopupAnchor() |
|
138 | |||
139 | /** |
||
140 | * @param Point $shadowAnchor |
||
141 | */ |
||
142 | 3 | public function setShadowAnchor(Point $shadowAnchor) |
|
146 | |||
147 | /** |
||
148 | * @return Point |
||
149 | */ |
||
150 | 6 | public function getShadowAnchor() |
|
154 | |||
155 | /** |
||
156 | * @param Point $shadowSize |
||
157 | */ |
||
158 | 3 | public function setShadowSize(Point $shadowSize) |
|
162 | |||
163 | /** |
||
164 | * @return Point |
||
165 | */ |
||
166 | 6 | public function getShadowSize() |
|
170 | |||
171 | /** |
||
172 | * Initializes the object |
||
173 | * @throws \yii\base\InvalidConfigException |
||
174 | */ |
||
175 | 6 | public function init() |
|
181 | |||
182 | /** |
||
183 | * @return string the js initialization code of the object |
||
184 | */ |
||
185 | 6 | public function encode() |
|
195 | |||
196 | /** |
||
197 | * @return array the configuration options of the array |
||
198 | */ |
||
199 | 6 | public function getOptions() |
|
217 | } |
||
218 |