Index: trunk/extensions/Maps/includes/Maps_Location.php |
— | — | @@ -91,8 +91,36 @@ |
92 | 92 | */ |
93 | 93 | protected $separator; |
94 | 94 | |
| 95 | + /** |
| 96 | + * Creates and returns a new instance of a MapsLocation from a latitude and longitude. |
| 97 | + * |
| 98 | + * @since 1.0 |
| 99 | + * |
| 100 | + * @param float $lat |
| 101 | + * @param float $lon |
| 102 | + * @param integer $format |
| 103 | + * |
| 104 | + * @return MapsLocation |
| 105 | + */ |
| 106 | + public static function newFromLatLon( $lat, $lon, $format = Maps_COORDS_FLOAT ) { |
| 107 | + return new self( $lat . ',' . $lon, $format ); |
| 108 | + } |
95 | 109 | |
96 | 110 | /** |
| 111 | + * Creates and returns a new instance of a MapsLocation from an address. |
| 112 | + * |
| 113 | + * @since 1.0 |
| 114 | + * |
| 115 | + * @param string $address |
| 116 | + * @param integer $format |
| 117 | + * |
| 118 | + * @return MapsLocation |
| 119 | + */ |
| 120 | + public static function newFromAddress( $address, $format = Maps_COORDS_FLOAT ) { |
| 121 | + return new self( $address, $format ); |
| 122 | + } |
| 123 | + |
| 124 | + /** |
97 | 125 | * Constructor. |
98 | 126 | * |
99 | 127 | * @param mixed $coordsOrAddress string or array with lat and lon |