Directory

← Back

x-weather

A collection of Web Components implementing portions of the OpenWeatherMap API.

Author

Rating

Not enough ratings

Popularity

<100

x-weather

About

Installation

Add Internet Explorer 11 compatible polyfills

  <div id="ce-es5-shim">
    <script>
      if (!window.customElements) {
        var ceShimContainer = document.querySelector('#ce-es5-shim')

        // This prevents custom-elements-es5-adapter.js from parsing or running.
        ceShimContainer.parentElement.removeChild(ceShimContainer)
      }
    </script>

    <!-- Required, due to a conflict between the polyfills, transpilation, and IE... -->
    <script
      charset="utf-8"
      src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"
    ></script>
  </div>

  <!-- Web component polyfill (only loads what it needs) -->
  <script
    charset="utf-8"
    src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-lite.js"
  ></script>

Load and register the web component in the CustomElementRegistry

  <script src="https://cdn.jsdelivr.net/npm/x-weather@latest/lib/build-ie11-iife/iife/main.js"></script>

Usage

  <x-weather
    appid="NOT_A_REAL_API_KEY"
    host="api.openweathermap.org"
    location="Phoenix, Arizona"
  >
    <x-current scale="F"></x-current>
    <x-forecast days="2" scale="F"></x-forecast>
  </x-weather>

Additional information

  • Other builds and examples (including basic service workers) can be found inside the lib folder
  • The package can be installed and imported by npm:
    • npm i x-weather
    • import 'x-weather/lib/build-no-polyfills-esm/esm/main'

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

1.0.3 imported 2018-12-28
1.0.1 imported 2018-11-25
1.0.0 imported 2018-11-11
0.1.1 imported 2018-11-06
0.1.0 imported 2018-11-04
0.0.12 imported 2018-11-04
0.0.9 imported 2018-11-03
0.0.8 imported 2018-11-03
0.0.7 imported 2018-11-03
0.0.6 imported 2018-11-03
0.0.11 imported 2018-11-03
0.0.10 imported 2018-11-03
0.0.5 imported 2018-10-29
0.0.4 imported 2018-10-29
0.0.3 imported 2018-10-28
0.0.2 imported 2018-10-28

Dependencies

  • express#^4.16.3
Released
2018-12-28
Maturity
IMPORTED
License
GNU Affero General Public License v3.0

Compatibility

Framework
Browser
Browser Independent

x-weather - Vaadin Add-on Directory

A collection of Web Components implementing portions of the OpenWeatherMap API. x-weather - Vaadin Add-on Directory
x-weather ====== ## About * A collection of [web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) implementing portions of the [OpenWeatherMap API](https://openweathermap.org/api). ## Installation ### Add Internet Explorer 11 compatible polyfills ```html
``` ### Load and register the web component in the CustomElementRegistry ```html ``` ## Usage * After installation and [signing up for an API key](https://home.openweathermap.org/users/sign_up), use the custom element: ```html ``` ## Additional information * Other builds and examples (including basic service workers) can be found inside the [lib folder](https://github.com/kherrick/x-weather/tree/master/lib) * The package can be installed and imported by npm: - `npm i x-weather` - `import 'x-weather/lib/build-no-polyfills-esm/esm/main'`
Online