1 | <?php |
||
35 | class LatLng extends Type implements ArrayableInterface |
||
36 | { |
||
37 | /** |
||
38 | * @var float the latitude in degrees. |
||
39 | */ |
||
40 | public $lat; |
||
41 | /** |
||
42 | * @var float the longitude in degrees. |
||
43 | */ |
||
44 | public $lng; |
||
45 | |||
46 | /** |
||
47 | * Initializes the object |
||
48 | * @throws \yii\base\InvalidConfigException |
||
49 | */ |
||
50 | 147 | public function init() |
|
56 | |||
57 | /** |
||
58 | * LatLng is and object to be used |
||
59 | * @return \yii\web\JsExpression the js initialization code of the object |
||
60 | */ |
||
61 | 3 | public function encode() |
|
65 | |||
66 | /** |
||
67 | * Returns the lat and lng as array |
||
68 | * |
||
69 | * @param bool $encode whether to return the array json_encoded or raw |
||
70 | * |
||
71 | * @return array|JsExpression |
||
72 | */ |
||
73 | 132 | public function toArray($encode = false) |
|
81 | } |
||
82 |