1 | <?php |
||
24 | abstract class Control extends Component |
||
25 | { |
||
26 | /** |
||
27 | * @var string the name of the javascript variable that will hold the reference |
||
28 | * to the map object. |
||
29 | */ |
||
30 | public $map; |
||
31 | /** |
||
32 | * @var string the initial position of the control (one of the map corners). |
||
33 | */ |
||
34 | public $position = 'topright'; |
||
35 | /** |
||
36 | * @var array the options for the underlying LeafLetJs JS component. |
||
37 | * Please refer to the LeafLetJs api reference for possible |
||
38 | * [options](http://leafletjs.com/reference.html). |
||
39 | */ |
||
40 | public $clientOptions = []; |
||
41 | /** |
||
42 | * @var string the variable name. If not null, then the js creation script |
||
43 | * will be returned as a variable. If null, then the js creation script will |
||
44 | * be returned as a constructor that you can use on other object's configuration options. |
||
45 | */ |
||
46 | private $_name; |
||
47 | |||
48 | /** |
||
49 | * Returns the name of the layer. |
||
50 | * |
||
51 | * @param boolean $autoGenerate whether to generate a name if it is not set previously |
||
52 | * |
||
53 | * @return string name of the layer. |
||
54 | */ |
||
55 | 24 | public function getName($autoGenerate = false) |
|
62 | |||
63 | /** |
||
64 | * Sets the name of the layer. |
||
65 | * |
||
66 | * @param string $value name of the layer. |
||
67 | */ |
||
68 | 9 | public function setName($value) |
|
72 | |||
73 | /** |
||
74 | * Returns the processed js options |
||
75 | * @return array |
||
76 | */ |
||
77 | 21 | public function getOptions() |
|
81 | |||
82 | /** |
||
83 | * Returns the javascript ready code for the object to render |
||
84 | * @return \yii\web\JsExpression |
||
85 | */ |
||
86 | abstract public function encode(); |
||
87 | } |
||
88 |