-
Notifications
You must be signed in to change notification settings - Fork 9
/
shapes.php
64 lines (49 loc) · 1.35 KB
/
shapes.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
<?php
// This is for my examples
require( '_system/config.php' );
$relevant_code = array(
'\PHPGoogleMaps\Overlay\Circle',
'\PHPGoogleMaps\Overlay\Rectangle',
'\PHPGoogleMaps\Overlay\Shape',
'\PHPGoogleMaps\Overlay\ShapeDecorator'
);
// Autoload stuff
require( '_system/autoload.php' );
$map = new \PHPGoogleMaps\Map;
$circle_options = array(
'fillColor' => '#00ff00',
'strokeWeight' => 1,
'fillOpacity' => 0.05,
'clickable' => false
);
$circle = \PHPGoogleMaps\Overlay\Circle::createFromLocation( 'San Diego, CA', 1000, $circle_options );
$rectangle_options = array(
'fillColor' => '#ff0000',
'strokeWeight' => 3,
'fillOpacity' => 0.05,
);
$rectangle = new \PHPGoogleMaps\Overlay\Rectangle(
'San Diego, CA',
\PHPGoogleMaps\Service\Geocoder::geocode( 'Balboa Park San Diego, CA' ),
$rectangle_options
);
$map->addObjects( array( $circle, $rectangle ) );
$map->setCenter( 'San Diego, CA' );
$map->setZoom( 14 );
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Shapes - <?php echo PAGE_TITLE ?></title>
<link rel="stylesheet" type="text/css" href="_css/style.css">
<?php $map->printHeaderJS() ?>
<?php $map->printMapJS() ?>
</head>
<body>
<h1>Shapes</h1>
<?php require( '_system/nav.php' ) ?>
<p>Simple map example</p>
<?php $map->printMap() ?>
</body>
</html>