1 | <?php |
||
23 | class TileLayer extends Layer |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * @var string a template has the following form: |
||
28 | * |
||
29 | * ``` |
||
30 | * 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png' |
||
31 | * ``` |
||
32 | * |
||
33 | * {s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain |
||
34 | * limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, |
||
35 | * {x} and {y} — tile coordinates. |
||
36 | * |
||
37 | * You can use custom keys in the template, which will be evaluated from TileLayer options, like this: |
||
38 | * |
||
39 | * ``` |
||
40 | * $layer = new TileLayer([ |
||
41 | * 'urlTemplate' => 'L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', |
||
42 | * 'clientOptions' => [ |
||
43 | * 'foo' => 'bar' |
||
44 | * ] |
||
45 | * ]); |
||
46 | * ``` |
||
47 | */ |
||
48 | public $urlTemplate; |
||
49 | |||
50 | /** |
||
51 | * @throws \yii\base\InvalidConfigException |
||
52 | */ |
||
53 | 42 | public function init() |
|
60 | |||
61 | /** |
||
62 | * @return \yii\web\JsExpression the marker constructor string |
||
63 | */ |
||
64 | 36 | public function encode() |
|
77 | } |
||
78 |