Measure your speed using the Geolocation API and DeviceMotion event.
Demo
Click the "Start meter" button to begin measuring your speed and start walking or driving. The speedometer will
display your current speed in km/h.
km/h
Code
coords.speed is in metres per second. DeviceMotion helps suppress small speed readings when the device is still. This simplified example shows the display conversion and rounding.