-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
57 lines (49 loc) · 1.95 KB
/
index.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
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Exif To GeoJSON</title>
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<style>
#map {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="//cdn.leafletjs.com/leaflet-0.7.2/leaflet-src.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
var map = L.map('map').setView([45.943,-119.723], 7);
L.tileLayer('http://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}', {
maxZoom: 18
}).addTo(map);
$.get('exif.geojson', function (data) {
var geojson = null;
if (typeof data === 'string') {
geojson = JSON.parse(data)
} else {
geojson = data;
}
var layer = L.geoJson(geojson, {
onEachFeature: function(feature, layer) {
var imgPath = feature.properties.imgPath;
var html = '<a href="'+imgPath+'" target="_blank">'+imgPath+'<br/><img width="200px" src="'+imgPath+'"</img></a><br/>';
html += 'GPS Timestamp: <br/><b>' + feature.properties.gpsTimeStr + '</b><br/>';
html += 'Image Timestamp: <br/><b>' + feature.properties.imgTimeStr + '</b><br/>';
html += 'Latitude: <br/><b>' + feature.geometry.coordinates[1] + '</b><br/>';
html += 'Longitude: <br/><b>' + feature.geometry.coordinates[0] + '</b><br/>';
// html += JSON.stringify(feature.properties, null, 2);
layer.bindPopup(html);
}
}).addTo(map);
map.fitBounds(layer.getBounds());
});
</script>
</body>
</html>