-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
77 lines (55 loc) · 2.3 KB
/
index.php
File metadata and controls
77 lines (55 loc) · 2.3 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Geoply - The MongoDB Geo-Location Toolkit</title>
<script src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script src="js/jquery-1.6.4.min.js"></script>
<link rel="stylesheet" href="css/g-spot.css">
<script src="js/g-spot.js"></script>
<!--[if lt IE 9]>
<style>.git-ribbon { top: -2em; left: -2em; }</style>
<![endif]-->
<script>
/* OPTIONS */
options = {
zoom: 17, // This allows you to select a zoom level
type: 'ROADMAP', // This allows you to pick the tap of map to use
lat: false, // This is a custom coordinate to use for centering map, otherwise browser attempts to use HTML5 to find current location
lng: false, // This is a custom coordinate to use for centering map, otherwise browser attempts to use HTML5 to find current location
imgs: 'img', // This is the base location of images and markers
markers: false, // This allows you to manually input a marker array
check_markers: false // This takes time but prevents missing icons from NOT being display by automatically using the default icon if custom icon is not found
};
/* CREATING A MAP IS THIS SIMPLE */
$(document).ready(function(){
$('#gspot').gSpot(options);
});
</script>
<?php
/* THIS PHP EXAMPLE ALLOWS FOR CUSTOM QUERIES VIA URL */
/* AS DOES THE JSON.php FILE DIRECTLY */
/* CURRENTLY DYNAMIC VARIABLES INCLUDE */
/* limit = number of markers to query */
if(isset($_GET['limit'])) $limit = (int)$_GET['limit'];
else $limit = 500;
/* feature_code = only show places with this feature_code */
if(isset($_GET['feature_code'])) $feature_code = $_GET['feature_code'];
else $feature_code = false;
?>
</head>
<body>
<div class="git-ribbon"><a href="https://github.com/msmalley/Geoply">Fork Me on GitHub</a></div>
<div id="header">
<h1>Geoply</h1>
<span class="social-media-links">
<a href="http://twitter.com/m_smalley" class="twitter">Twitter</a>
<a href="http://facebook.com/mark.smalley" class="facebook">Facebook</a>
<a href="http://www.linkedin.com/profile/view?id=10311122" class="linkedin">Linked-In</a>
</span>
</div>
<div id="map-wrapper">
<div id="gspot" data-ajax="json.php?limit=<?php echo $limit; ?>&feature_code=<?php echo $feature_code; ?>"></div>
</div>
</body>
</html>