ProductPromotion
Logo

Java.Script

made by https://0x3d.site

GitHub - dawidjaniga/map-countdown: Display the countdown on top of the Google Maps
Display the countdown on top of the Google Maps. Contribute to dawidjaniga/map-countdown development by creating an account on GitHub.
Visit Site

GitHub - dawidjaniga/map-countdown: Display the countdown on top of the Google Maps

GitHub - dawidjaniga/map-countdown: Display the countdown on top of the Google Maps

MapCountdown

Build Status Coverage Status JavaScript Style Guide Greenkeeper badge semantic-release semantic-release

Overview

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

Demo

Usage

Steps

  1. Install
  2. Prepare route points
  3. Prepare Google Maps API Key
  4. Add MapCountdown
    1. With module bundler
    2. In browser

Install

yarn install map-countdown

or

npm install map-countdown

Prepare route points

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.

  1. First ensure map-countdown is installed. Next you have to download workout in .tcx format. The most popular sport tracking app are supported:
    1. Endomondo - Instructions
    2. Polar - Instructions
    3. Garmin - Instructions
  2. After download open a terminal in your project's directory and run:
route-importer ~/Downloads/training-file.tcx routePoints.js

route-importer will parse TCX file and save it with given name.

Prepare Google Maps API Key

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 bundler

import MapCountdown from 'map-countdown'
import './../path/to/routePoints'

new Countdown({
    selector: '#countdown',
    key: 'GOOGLE_API_KEY',
    meta: '2019-07-13 11:30:00'
})

In browser

You have to include routePoints.js along with MapCountdown, which load those points automatically. Next, add container for countdown (ie. #countdown).

<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>

jQuery

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>

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory