diff --git a/data/results/index.html b/data/results/index.html new file mode 100644 index 0000000..25464d6 --- /dev/null +++ b/data/results/index.html @@ -0,0 +1,25 @@ + + + + + + + + +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/data/results/map.png b/data/results/map.png new file mode 100644 index 0000000..c54f416 Binary files /dev/null and b/data/results/map.png differ diff --git a/data/results/my.js b/data/results/my.js new file mode 100644 index 0000000..5c70a6f --- /dev/null +++ b/data/results/my.js @@ -0,0 +1,105 @@ +function loadData() { + console.log($(location).attr('hash').substr(1)); + $.getJSON($(location).attr('hash').substr(1), function (data) { + var images = {}; + var tiles = { + "openstreetmap": L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxNativeZoom: 19, + maxZoom: 24, + attribution: '© OpenStreetMap' + }), + "esri sat": L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { + maxNativeZoom: 19, + maxZoom: 24, + attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' + }), + "google sat": L.tileLayer('https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', { + maxNativeZoom: 20, + maxZoom: 24, + subdomains: ['mt0', 'mt1', 'mt2', 'mt3'] + }) + }; + var map = L.map("mainMap", {layers: [tiles.openstreetmap]}); + + function styleTrack(feature) { + var styles = {}; + styles.color = data.colors[feature.properties.activity_type]; + return styles; + } + + var highlighted = null; + + function onClick(e) { + var start = e.target.feature.geometry.properties.start_timestamp; + var end = e.target.feature.geometry.properties.end_timestamp; + var changed = highlighted !== e.target.feature; + $.each(images, function (timestamp, board) { + if ((timestamp >= start && timestamp < end) && changed) { + board.image.first().addClass("highlight"); + } else { + board.image.removeClass("highlight"); + highlighted = null; + } + } + ); + if (changed) { + highlighted = e.target.feature; + } + } + + var coords = []; + + function onEachFeature(feature, layer) { + layer.setStyle(styleTrack(feature)); + layer.on('click', onClick); + if (feature.coordinates.length > 1) { + coords = coords.concat(feature.coordinates.map(function (p) { + return [p[1], p[0], 0.1]; + })); + } + } + + var track = L.geoJSON(data['track'], { + //style: styleTrack, + onEachFeature: onEachFeature + }).addTo(map); + + map.fitBounds(track.getBounds()); + + var heat = L.heatLayer(coords); + L.control.layers(tiles, {"heatmap": heat}).addTo(map); + + var list = $("