-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathstreetview.php
61 lines (47 loc) · 1.38 KB
/
streetview.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
<?php
// This is for the examples
require( '_system/config.php' );
// Autoload stuff
require( '_system/autoload.php' );
$map = new \PHPGoogleMaps\Map;
$map->enableStreetView();
$map->setCenter('Anchorage, AK');
$map2 = new \PHPGoogleMaps\Map( array( 'map_id' => 'map2' ) );
$map2->enableStreetView( array( 'addressControl' => false, 'enableCloseButton' => false ), 'container' );
$map2->setCenter('San Diego, CA');
$map3 = new \PHPGoogleMaps\Map( array( 'map_id' => 'map3', 'center' => 'New Haven, CT' ) );
try {
$map3->enableStreetView( array( 'position' => 'New Haven, CT' ) );
}
catch ( GeocodeException $e ) {
echo $e->error;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Streetview - <?php echo PAGE_TITLE ?></title>
<link rel="stylesheet" type="text/css" href="_css/style.css">
<?php $map->printHeaderJS() ?>
<?php $map->printMapJS() ?>
<?php $map2->printMapJS() ?>
<?php $map3->printMapJS() ?>
<style type="text/css">
#map2, #container { float:left }
</style>
</head>
<body>
<h1>Streetview</h1>
<?php require( '_system/nav.php' ) ?>
<h2>Same Container</h2>
<?php $map->printMap() ?>
<hr>
<h2>Different Container</h2>
<?php $map2->printMap() ?>
<div id="container" style="width:500px;height:500px;"></div>
<hr style="clear:both">
<h2>Auto Open</h2>
<?php $map3->printMap() ?>
</body>
</html>