-
Notifications
You must be signed in to change notification settings - Fork 9
/
fusion_tables.php
62 lines (45 loc) · 1.47 KB
/
fusion_tables.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
<?php
// Autoloader stuff
require( '_system/autoload.php' );
// This is just for my examples
require( '_system/config.php' );
$relevant_code = array(
'\PHPGoogleMaps\Layer\FusionTable',
'\PHPGoogleMaps\Layer\FusionTableDecorator'
);
// Create a map
$map = new \PHPGoogleMaps\Map;
// Create a fusion table for CT
$ft_ct_options = array(
'query' => 'SELECT location FROM 232192 WHERE state_province_abbrev="CT"'
);
$ft_ct = new \PHPGoogleMaps\Layer\FusionTable( 232192, $ft_ct_options );
// Create a fusion table for RI
$ft_ri_options = array(
'query' => 'SELECT location FROM 232192 WHERE state_province_abbrev="RI"'
);
$ft_ri = new \PHPGoogleMaps\Layer\FusionTable( 232192, $ft_ri_options );
// Add the CT fusion table to the map and get the decorator for later use
$ft_ct_map = $map->addObject( $ft_ct );
// Add the RI fusion table to the map
$map->addObject( $ft_ri );
// Set map options
$map->setCenter( 'Connecticut' );
$map->setZoom( 7 );
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fusion Tables - <?php echo PAGE_TITLE ?></title>
<link rel="stylesheet" type="text/css" href="_css/style.css">
<?php $map->printHeaderJS() ?>
<?php $map->printMapJS() ?>
</head>
<body>
<h1>Fusion Tables</h1>
<?php require( '_system/nav.php' ) ?>
<?php $map->printMap() ?>
<a href="#" onclick="<?php echo $ft_ct_map->getJsVar() ?>.setOptions({heatmap:true})">Make CT a heat map</a>
</body>
</html>