Skip to content

Instantly share code, notes, and snippets.

@smzn
Created July 17, 2024 02:09
Show Gist options
  • Save smzn/bf99cb2f7b059f0d75e9f35b8fcd3951 to your computer and use it in GitHub Desktop.
Save smzn/bf99cb2f7b059f0d75e9f35b8fcd3951 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ISS Latest Positions</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<style>
#map {
height: 600px;
width: 100%;
}
</style>
</head>
<body>
<h1>ISS Latest Positions</h1>
<div id="map"></div>
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script>
var map = L.map('map').setView([0, 0], 2); // 初期表示の中心を設定
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
}).addTo(map);
// 最新のポイントデータを取得してマーカーを配置
var points = {{ points | tojson }};
points.forEach(function(point) {
var marker = L.marker([point.latitude, point.longitude]).addTo(map);
marker.bindPopup("<b>Timestamp:</b> " + point.timestamp + "<br><b>Latitude:</b> " + point.latitude + "<br><b>Longitude:</b> " + point.longitude);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment