Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aerisweather/awxjs-observations-module

An external map module to be used with interactive maps and the AerisWeather Javascript SDK.
https://github.com/aerisweather/awxjs-observations-module

aeris aerisweather-sdk api javascript maps sdk weather

Last synced: about 2 months ago
JSON representation

An external map module to be used with interactive maps and the AerisWeather Javascript SDK.

Awesome Lists containing this project

README

        

Aeris JS SDK - Observations Module
===========================

Starting with version 1.3.0 of the [Aeris Javascript SDK](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/), you can now create and add [map source modules](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/map-modules/) to easily include custom data sources and layers to your [InteractiveMapApp](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/interactive-map-app/) and [InteractiveMap](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/interactive-map/) instances.

We've created this Observations module as an example for you to reference when creating your own custom modules for your mapping applications. Feel free to use this module in your own projects, whether you're using our [precompiled SDK scripts](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/getting-started/script-usage/) or [importing our NPM package](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/getting-started/module-usage/) into your Javascript projects.

![AerisWeather JS - Observations Module](docs/img/awxjs-observations-infopanel.png)

## Using the Module

The method for adding the Observations module to your project depends on how your project is setup, either as a module-based/NodeJS project or using precompiled scripts in an HTML file. Follow the appropriate examples below for your project's use case.

### Module/NodeJS Project

If you are developing your own JavaScript application using a NodeJS server or using NPM libraries, you can use the source files in this repository and import them as needed within your maps.

**NOTE:** This module is written using Typescript and modern ES6 Javascript syntax. If you need the module's Typescript source compiled to Javascript, use the source files located within the `dist/src/` directory or run `yarn build` from the root of this project's directory to recompile the source files.

The following is an example of importing and using the project source files in your Javascript project:

```javascript
import AerisWeather from '@aerisweather/javascript-sdk/dist/AerisWeather';
import InteractiveMapApp from '@aerisweather/javascript-sdk/dist/apps/InteractiveMapApp';
import Observations from 'path/to/awxjs-observations-module/dist/src/Observations';

const aeris = new AerisWeather('CLIENT_ID', 'CLIENT_SECRET');

const app = new apps.InteractiveMapApp('#app', {
account: aeris.account(),
// config options...
});
app.on('ready', () => {
app.modules.add(new Observations());
});
```

### Precompiled Script

To start using our Observations module quickly and easily, just load our precompiled script into your HTML and add it to your maps:

[awxjs-observations.min.js](https://cdn.aerisapi.com/sdk/js/modules/awxjs-observations.min.js)

```html




Aeris JS - Observations Module



html, body {
height: 100%;
margin: 0;
padding: 0;
width: 100%;
}
#app {
height: 100%;
width: 100%;
}

window.addEventListener('load', () => {

const aeris = new AerisWeather('CLIENT_ID', 'CLIENT_SECRET');

aeris.apps().then((apps) => {
const app = new apps.InteractiveMapApp('#app', {
// config options...
});
app.on('ready', () => {
app.modules.add(new Observations());
});
});

});

```

## Map Module Documentation

We have extensive [documentation](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/map-modules/) online when using map modules with [InteractiveMapApp](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/map-modules/interactive-map-app/) and [InteractiveMap](https://www.aerisweather.com/support/docs/toolkits/aeris-js-sdk/map-modules/interactive-map/) instances, which will go into more detail on the various options available to you related to map modules.

## Support

Feel free to [submit a new ticket](http://helpdesk.aerisweather.com/) with any questions, bug reports or feature suggestions you have. You can also reach out to us on Twitter at [@AerisWeather](https://twitter.com/AerisWeather).