-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample2.php
More file actions
47 lines (38 loc) · 801 Bytes
/
example2.php
File metadata and controls
47 lines (38 loc) · 801 Bytes
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
<?php
/**
* A clone of the "Quick Example" map shown on the Google Static Maps API
*/
include 'staticmap.class.php';
$options = array(
'center' =>'Brooklyn Bridge,New York,NY',
'zoom' =>'14',
'size' =>'512x512',
'maptype' =>'roadmap',
'sensor' =>'false'
);
$map = new StaticMap($options);
$styles = array(
'color' =>'blue',
'label' =>'S'
);
$map->add_marker('40.702147,-74.015794', $styles);
$styles = array(
'color' =>'green',
'label' =>'G'
);
$map->add_marker('40.711614,-74.012318', $styles);
$styles = array(
'color' =>'red',
'label' =>'C'
);
$map->add_marker('40.718217,-73.998284', $styles);
// Display Static Map:
if ($map->is_valid())
{
echo '<img src="' . $map->get_map() . '" alt="Google Map" ' . $map->get_size() . '>';
}
else
{
echo 'Invalid Map!';
}
?>