-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.php
66 lines (60 loc) · 1.57 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
* Geo Locator
*
* You can select which one service is fine for your gps tagging - Google vs.
* Yahoo API. Yahoo has very good APIs and it should be sad forget on them,
* when everybody speaks only about google stuffs.
*
*/
require('GeoLocator.class.php');
require('YahooGeoLocator.class.php');
require('GoogleGeoLocator.class.php');
$yahooApiKey = '';
$googleApiKey= '';
$lang = 'en';
$yahoo = new YahooGeoLocator($yahooApiKey);
$google = new GoogleGeoLocator($googleApiKey,$lang);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>examples for geo locating</title>
</head>
<body>
<p><strong>Search by Yahoo PlaceFinder API service:</strong></p>
<pre>Search by address:
Call:
$yahoo->searchByAddress('Holečkova 32','Praha','Czech republic')
Return:
<?php
print_r($yahoo->searchByAddress('Holečkova 32','Praha','Czech republic'));
?>
</pre>
<pre>Search by location:
Call:
$yahoo->searchByLocation('50.073274','14.392619')
Return:
<?php
print_r($yahoo->searchByLocation('50.073274','14.392619'));
?>
</pre>
<p><strong>Search by Google Maps API service:</strong></p>
<pre>Search by address:
Call:
$google->searchByAddress('Holečkova 32','Praha','Czech republic')
Return:
<?php
print_r($google->searchByAddress('Holečkova 32','Praha','Czech republic'));
?>
</pre>
<pre>Search by location:
Call:
$google->searchByLocation('50.073274','14.392619')
Return:
<?php
print_r($google->searchByLocation('50.073274','14.392619'));
?>
</pre>
</body>
</html>