MapCountdown is a JavaScript browser library which shows countdown with additional route filling on a map. It uses Google Map to draw polygons from provided paths and animates them according to time left.
Demo Usage Stepsyarn install map-countdown
or
Prepare route pointsnpm install map-countdown
To draw polygons on Google Maps we need to pass an array of route points. To do that we can import .tcx file and use route-parser
CLI to parse it.
map-countdown
is installed. Next you have to download workout in .tcx format. The most popular sport tracking app are supported:
route-importer ~/Downloads/training-file.tcx routePoints.js
route-importer
will parse TCX file and save it with given name.
Google Maps need an api key for working. If you don't have a key already, don't worry. You can create new one below: https://developers.google.com/maps/documentation/embed/get-api-key Replace 'GOOGLE_API_KEY' from chosen snippet below with your api key.
Add MapCountdown With module bundlerIn browserimport MapCountdown from 'map-countdown'
import './../path/to/routePoints'
Â
new Countdown({
    selector: '#countdown',
    key: 'GOOGLE_API_KEY',
    meta: '2019-07-13 11:30:00'
})
You have to include routePoints.js along with MapCountdown, which load those points automatically. Next, add container for countdown (ie. #countdown).
jQuery<html>
<head>
    <title>MapCountdown Example</title>
    <script src="https://unpkg.com/map-countdown@latest/dist/bundle.js"></script>Â
    <script src="routePoints.js"></script>Â
    <script>
        window.addEventListener('DOMContentLoaded', function () {
            new MapCountdown({
                selector: '#countdown',
                key: 'GOOGLE_API_KEY',
                meta: '2019-07-13 11:30:00',
            })
        })
    </script>Â
    <body>
Â
        <div id="countdown"></div>
Â
    </body>
</html>
You can use jQuery, if you will.
<html>
<head>
    <title>MapCountdown Example</title>
    <script src="https://unpkg.com/map-countdown@latest/dist/bundle.js"></script>Â
    <script src="routePoints.js"></script>Â
    <script>
        $(function () {
            new MapCountdown({
                selector: '#countdown',
                key: 'GOOGLE_API_KEY',
                meta: '2019-07-13 11:30:00',
            })
        })
    </script>Â
    <body>
Â
        <div id="countdown"></div>
Â
    </body>
</html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4