author Angelo Gladding
name Muir Peak via Sam Merrill and Castle Canyon
published 2024-04-24T18:44:00.905830-07:00
type entry
updated 2024-12-08T17:20:06.552470-08:00
url /muir-peak-via-sam-merrill-and-castle-canyon, /2024/04/25/pg
visibility public
Content
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | $ start_time = "2024-04-12T16:58:14Z" $ end_time = "2024-04-13T02:02:59Z" $ media_data = [ $ { $ "name": 'Flora', $ "latlng": [34.2040027777778, -118.126038888889], $ "url": '/media/NGz6.jpg' $ }, $ { $ "name": 'Panoramic View', $ "latlng": [34.2189916666667, -118.120330555556], $ "url": '/media/vLqR.jpg' $ }, $ { $ "name": 'Muir Peak Canyon Live Oak', $ "latlng": [34.2145527777778, -118.102355555556], $ "url": '/media/5Htm.jpg' $ }, $ { $ "name": 'Flowing Fog', $ "latlng": [34.2161, -118.1027], $ "url": '/media/RoGT.mov' $ }, $ ] <link rel=stylesheet href=https://unpkg.com/leaflet/dist/leaflet.css> <script src=https://unpkg.com/leaflet/dist/leaflet.js></script> <div id="map"></div> <style>#map { height: 40em; }</style> <script> let hikemap = L.map('map').setView([34.215, -118.115], 14) L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(hikemap) $# TODO for location in get_locations(start_time, end_time): $for location in web.tx.db.select("locations", where=f'json_extract(locations.location, "$.properties.timestamp") > "{start_time}" and json_extract(locations.location, "$.properties.timestamp") < "{end_time}"'): L.geoJSON($:web.dump(location["location"])).addTo(hikemap) let imageMarkers = $:web.dump(media_data) imageMarkers.forEach(marker => L.marker( marker.latlng, {icon: L.icon({ iconUrl: marker.url, iconSize: [50, 50], iconAnchor: [25, 50]})}) .bindPopup(`<img src="$${marker.url}" alt="$${marker.name}" style="max-width: 200px; max-height: 200px;">`) .addTo(hikemap) ) const redIcon = L.icon({ iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-red.png', iconSize: [60, 60], // Size of the icon iconAnchor: [12, 41], // Point of the icon which corresponds to the marker location popupAnchor: [1, -34], // Point from which the popup opens relative to the iconAnchor shadowUrl: 'https://unpkg.com/leaflet@1.7.1/dist/images/marker-shadow.png', // Optional: Marker shadow shadowSize: [41, 41], // Size of the shadow shadowAnchor: [12, 41] // Anchor of the shadow }) </script> --- $for media in media_data: $ url = media["url"] $if url.endswith(".jpg"): <img src=$url alt="$media['name'] $media['latlng']"> $elif url.endswith(".mov"): <video controls style=width:100%> <source src=$url type=video/quicktime> <source src=$(url[:-4]).mp4 type=video/mp4> <source src=$(url[:-4]).webm type=video/webm> Your browser does not support the video tag. </video> --- <style> table { width: 100% } th { text-align: left } </style> <table> <tr> <th>Time <th>Coordinates <th>Altitude <th>Motion <th>Battery </tr> $for location in web.tx.db.select("locations", where=f'json_extract(locations.location, "$.properties.timestamp") > "{start_time}" and json_extract(locations.location, "$.properties.timestamp") < "{end_time}"'): $ location = location["location"] $ latitude, longitude = location["geometry"]["coordinates"] $ p = location["properties"] $if p.get("type") == "trip": $continue <tr> $ h, m, s = p["timestamp"].partition("T")[2].rstrip("Z").split(":") <td>$(int(h)-8):$m<small style=color:#586e75>:$s</small> <td title="+/-$p['horizontal_accuracy']"><a href=# onclick="L.marker([$longitude, $latitude],{icon:redIcon}).addTo(hikemap);return false;">$round(latitude, 6),$round(longitude, 6)</a> <td title="+/-$p['vertical_accuracy']">$round(p["altitude"]*3.28084) $ motion = p["motion"] <td> $if motion and motion != "stationary" and p["speed"]: <div title="$motion[0]" style=background-color:#6c71c4;color:#002b36;text-align:center;width:$(p["speed"]*25)%><span style=font-size:.75em>$p["speed"]</span></div> $ battery = round(p["battery_level"]*100) <td><div style=background-color:#\ $if battery > 20: 859900\ $elif battery > 10: b58900\ $else: dc322f\ ;color:#002b36;display:inline-block;text-align:center;width:$(battery)%> $if battery > 50: <span style=font-size:.666em;> $if p["battery_state"] == "charging": <strong style=color:#d33682>$(battery)%</strong> $else: $(battery)% </span> $else: </div> $if battery < 50: <span style=display:inline-block;font-size:.666em;> $if p["battery_state"] == "charging": <strong style=color:#d33682>$(battery)%</strong> $else: $(battery)% </span> </tr> </table> |