Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/aerisweather/awxjs-observations-module
- Owner: aerisweather
- License: bsd-3-clause
- Created: 2020-03-05T16:29:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T22:29:54.000Z (almost 2 years ago)
- Last Synced: 2024-03-26T21:19:49.414Z (10 months ago)
- Topics: aeris, aerisweather-sdk, api, javascript, maps, sdk, weather
- Language: Shell
- Size: 1.88 MB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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).