-
Notifications
You must be signed in to change notification settings - Fork 9
/
kml_layers.php
41 lines (29 loc) · 914 Bytes
/
kml_layers.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
<?php
// This is for my examples
require( '_system/config.php' );
$relevant_code = array(
'\PHPGoogleMaps\Layer\KmlLayer',
'\PHPGoogleMaps\Layer\KmlLayerDecorator'
);
// Autoload stuff
require( '_system/autoload.php' );
$map = new \PHPGoogleMaps\Map;
$kml = new \PHPGoogleMaps\Layer\KmlLayer( 'http://local.yahooapis.com/MapsService/rss/trafficData.xml?appid=YahooDemo&city=new+york' );
$map->addObject( $kml );
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>KML Layers - <?php echo PAGE_TITLE ?></title>
<link rel="stylesheet" type="text/css" href="_css/style.css">
<?php $map->printHeaderJS() ?>
<?php $map->printMapJS() ?>
</head>
<body>
<h1>KML Layers</h1>
<?php require( '_system/nav.php' ) ?>
<?php $map->printMap() ?>
<a href="#" onclick="<?php echo $kml->getJsVar() ?>.setMap(null)">Remove KML Layer</a>
</body>
</html>