-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmobile.php
41 lines (31 loc) · 969 Bytes
/
mobile.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' );
// Autoload stuff
require( '_system/autoload.php' );
$map = new \PHPGoogleMaps\Map;
$marker = \PHPGoogleMaps\Overlay\Marker::createFromUserLocation( array( 'geolocation_high_accuracy' => true, 'geolocation_timeout' => 10000 ) );
$map->addObject( $marker );
$map->centerOnUser( \PHPGoogleMaps\Service\Geocoder::geocode('New Haven, CT') );
$map->setWidth('100%');
$map->setHeight('100%');
$map->enableMobile();
$map->disableAutoEncompass();
$map->setZoom(14);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Geolocation - <?php echo PAGE_TITLE ?></title>
<link rel="stylesheet" type="text/css" href="_css/style.css">
<style type="text/css">
html,body{ height:100%;width:100%;padding:0;margin:0 }
</style>
<?php $map->printHeaderJS() ?>
<?php $map->printMapJS() ?>
</head>
<body>
<?php $map->printMap() ?>
</body>
</html>