forked from stopfrisknyc/docs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmap.html
45 lines (45 loc) · 1.34 KB
/
map.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Sample Map</title>
<script type='text/javascript'>
var geojson = [];
function jsonpdata(data) {
for (var i = 0; i < data.results.length; i++) {
geojson.push({
geometry: {
type: 'Point',
coordinates: data.results[i].loc
},
properties: {
title: data.results[i].race,
description: data.results[i].sex,
'marker-symbol': 'police',
'marker-color': '#2D6F83',
}
});
}
};
</script>
<script src='http://api.occupy-data.org/v1/loc/$near=-73.88:40.78:1/?results&value=loc&value=race&value=sex&callback=jsonpdata'></script>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map'></div>
<script>
mapbox.auto('map', 'herwig.map-dlouakvr', function(m) {
var markerLayer = mapbox.markers.layer().features(geojson);
m.addLayer(markerLayer);
m.centerzoom({lon:-73.88, lat:40.78}, 14);
mapbox.markers.interaction(markerLayer);
mapbox.markers.extent(markerLayer);
});
</script>
</body>
</html>