1 : <?php
2 : /**
3 : * This file is part of NoiseLabs-PHP-ToolKit
4 : *
5 : * NoiseLabs-PHP-ToolKit is free software; you can redistribute it
6 : * and/or modify it under the terms of the GNU Lesser General Public
7 : * License as published by the Free Software Foundation; either
8 : * version 3 of the License, or (at your option) any later version.
9 : *
10 : * NoiseLabs-PHP-ToolKit is distributed in the hope that it will be
11 : * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 : * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 : * Lesser General Public License for more details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public
16 : * License along with NoiseLabs-PHP-ToolKit; if not, see
17 : * <http://www.gnu.org/licenses/>.
18 : *
19 : * Copyright (C) 2011 Vítor Brandão
20 : *
21 : * @category NoiseLabs
22 : * @package GoogleAPI
23 : * @author Vítor Brandão <noisebleed@noiselabs.org>
24 : * @copyright (C) 2011 Vítor Brandão <noisebleed@noiselabs.org>
25 : * @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
26 : * @link http://www.noiselabs.org
27 : * @since 0.1.0
28 : */
29 :
30 : namespace NoiseLabs\ToolKit\GoogleAPI\Maps;
31 :
32 : use NoiseLabs\Toolkit\GoogleAPI\ParameterBag;
33 :
34 : class Marker
35 0 : {
36 : protected $latitude;
37 : protected $longitude;
38 :
39 : /**
40 : * Marker options.
41 : *
42 : * Known keys:
43 : * - icon: An icon to show in place of the default icon
44 : * - title:
45 : *
46 : * @var \NoiseLabs\ToolKit\ParameterBag
47 : */
48 : public $options;
49 :
50 : public function __construct()
51 : {
52 0 : $this->options = new ParameterBag();
53 0 : }
54 :
55 : public static function create($latitude, $longitude, array $options = array())
56 : {
57 0 : $marker = new static();
58 0 : $marker->setLatitude($latitude);
59 0 : $marker->setLongitude($longitude);
60 0 : $marker->options->add($options);
61 :
62 0 : return $marker;
63 : }
64 :
65 : public function setLatitude($latitude)
66 : {
67 0 : $this->latitude = (float) $latitude;
68 0 : }
69 :
70 : public function getLatitude()
71 : {
72 0 : return $this->latitude;
73 : }
74 :
75 : public function setLongitude($longitude)
76 : {
77 0 : $this->longitude = (float) $longitude;
78 0 : }
79 :
80 : public function getLongitude()
81 : {
82 0 : return $this->longitude;
83 : }
84 : }
85 :
86 : ?>
87 :
|