Menu

1 / 2

A Real-Time Earthquake Map for Japan in 300 Lines of JavaScript — USGS GeoJSON + Leaflet

DEV Community·SEN LLC·5 months ago
#OUMkR5qm
Reading 0:00
15s threshold

Japan's official seismic data — from the Japan Meteorological Agency — is the most authoritative catalog of domestic earthquakes. It's also un-callable from a browser: no CORS headers, XML payloads, and bulk-download endpoints that gate behind accounts. A real-time map of "what just shook near Japan" needs a different feed. USGS's FDSN event service has it: CORS-enabled, no auth, GeoJSON, 5-10 min publishing latency. This is the 300-line page that wires that feed into a Leaflet map with magnitude-sized, depth-colored epicenter circles, refreshing every 5 minutes.

🌐 Demo : https://sen.ltd/portfolio/earthquake-jp/

📦 GitHub : https://github.com/sen-ltd/earthquake-jp

Why USGS, not JMA

Japan Meteorological Agency (JMA) publishes a much more complete domestic catalog — it goes down to M2 and below, names of villages, JMA shindo intensities. None of which a browser can fetch directly:

No CORS on the JMA endpoints.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.