1 | <?php |
||
36 | class LatLongParser implements ValueParser { |
||
37 | |||
38 | /* public */ const TYPE_FLOAT = 'float'; |
||
39 | /* public */ const TYPE_DMS = 'dms'; |
||
40 | /* public */ const TYPE_DM = 'dm'; |
||
41 | /* public */ const TYPE_DD = 'dd'; |
||
42 | |||
43 | /** |
||
44 | * The symbols representing the different directions for usage in directional notation. |
||
45 | */ |
||
46 | /* public */ const OPT_NORTH_SYMBOL = 'north'; |
||
47 | /* public */ const OPT_EAST_SYMBOL = 'east'; |
||
48 | /* public */ const OPT_SOUTH_SYMBOL = 'south'; |
||
49 | /* public */ const OPT_WEST_SYMBOL = 'west'; |
||
50 | |||
51 | /** |
||
52 | * The symbols representing degrees, minutes and seconds. |
||
53 | */ |
||
54 | /* public */ const OPT_DEGREE_SYMBOL = 'degree'; |
||
55 | /* public */ const OPT_MINUTE_SYMBOL = 'minute'; |
||
56 | /* public */ const OPT_SECOND_SYMBOL = 'second'; |
||
57 | |||
58 | /** |
||
59 | * The symbol to use as separator between latitude and longitude. |
||
60 | */ |
||
61 | /* public */ const OPT_SEPARATOR_SYMBOL = 'separator'; |
||
62 | |||
63 | /** |
||
64 | * @var ParserOptions |
||
65 | */ |
||
66 | private $options; |
||
67 | |||
68 | public function __construct( ParserOptions $options = null ) { |
||
69 | 50 | $this->options = $options ?: new ParserOptions(); |
|
70 | 50 | $this->options->defaultOption( ValueParser::OPT_LANG, 'en' ); |
|
71 | } |
||
72 | 50 | ||
73 | 37 | /** |
|
74 | 37 | * @see ValueParser::parse |
|
75 | * |
||
76 | * @param string $value |
||
77 | * |
||
78 | 2 | * @throws ParseException |
|
79 | * @return LatLongValue |
||
80 | */ |
||
81 | public function parse( $value ) { |
||
92 | 50 | ||
93 | /** |
||
94 | * @return StringValueParser[] |
||
95 | */ |
||
96 | private function getParsers() { |
||
106 | |||
107 | } |
||
108 |