This repository has been archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Method $map->setCenter() can now take "lat,long" string, Google_Maps_…
…Point or Google_Maps_Coordinat as parameter.
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* Google_Maps_Location | ||
* | ||
* Copyright (c) 2008 Mika Tuupola | ||
* | ||
* Licensed under the MIT license: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
* | ||
* Project home: | ||
* http://www.appelsiini.net/projects/google_maps | ||
* | ||
* Revision: $Id$ | ||
* | ||
*/ | ||
|
||
require_once 'Google/Maps/Overload.php'; | ||
|
||
abstract class Google_Maps_Location extends Google_Maps_Overload { | ||
|
||
/** | ||
* Return point as coordinate. | ||
* | ||
* @return object Google_Maps_Coordinate | ||
*/ | ||
abstract public function toCoordinate(); | ||
|
||
/** | ||
* Return coordinate as point. | ||
* | ||
* @return object Google_Maps_Point | ||
*/ | ||
abstract public function toPoint(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--TEST-- | ||
Google_Maps::create() | ||
--SKIPIF-- | ||
<?php | ||
include 'skipif.php'; | ||
?> | ||
--FILE-- | ||
<?php | ||
include 'skipif.php'; | ||
|
||
$point = new Google_Maps_Point(355500011, 230704001); | ||
$coord = new Google_Maps_Coordinate(24.5165921956, 58.3813335747); | ||
|
||
|
||
$map_1 = Google_Maps::create('static'); | ||
$map_2 = Google_Maps::create('static'); | ||
$map_3 = Google_Maps::create('static'); | ||
|
||
$map_1->setCenter($coord); | ||
$map_2->setCenter($point); | ||
$map_3->setCenter("24.5165921956, 58.3813335747"); | ||
|
||
print_r($map_1->getCenter()); | ||
print_r($map_2->getCenter()); | ||
print_r($map_3->getCenter()); | ||
|
||
?> | ||
--GET-- | ||
--POST-- | ||
--EXPECT-- | ||
Google_Maps_Coordinate Object | ||
( | ||
[lat:protected] => 24.5165921956 | ||
[lon:protected] => 58.3813335747 | ||
) | ||
Google_Maps_Coordinate Object | ||
( | ||
[lat:protected] => 24.5165921956 | ||
[lon:protected] => 58.3813335747 | ||
) | ||
Google_Maps_Coordinate Object | ||
( | ||
[lat:protected] => 24.5165921956 | ||
[lon:protected] => 58.3813335747 | ||
) |