项目作者: CodeForAfrica

项目描述 :
The map showing data from air quality sensors deployed across the continent by a variety of projects and government agencies.
高级语言: JavaScript
项目地址: git://github.com/CodeForAfrica/Data4SDGs-AQ-Map.git
创建时间: 2020-09-02T09:30:34Z
项目社区:https://github.com/CodeForAfrica/Data4SDGs-AQ-Map

开源协议:

下载


Data4SDGs AQ Map

visualize sensor data on map of africa for Data4SDGs.

👉 Live Version.

Map application

The implementation makes use of various frameworks and is on ECMA 6 language level.

Used frameworks are:

  • leaflet (mapping framework)
  • d3 (visualisation framework)
  • webpack is used for deployment

How to run

Installation

Requirements:

  • Node JS 10.15.x or higher
  • NPM should be version 6.9.x or higher

install all dependencies

  1. cp src/js/config.js.dist src/js/config.js
  2. npm install

Develop

start development server (http://127.0.0.1:8080/)

  1. npm start

Publish

Deployment to production happens automatically on merge to Master.

To deploy manually, build all files needed to run on a webserver, files will be compiled into dist/):

  1. npm run build
  2. npm run ghpages

Translation

The translation file can be found in src/js/translation.js.

To add a new translated word or sentence, add below the key (see below) a new key-value pair.
The nested key should start with the iso-code of the language followed by the translated world.
You can find the iso-code on wikipedia table (639-1).

  1. "(Sensor)": { // key - original english translation
  2. "de": "Sensor", // nested key - value pair
  3. "fr": "Détecteur" // add new translation "iso-code": "translated word"
  4. },
  5. "PM10 µg/m³": {},
  6. "PM2.5 µg/m³": {},
  7. "AQI US": {},
  8. "Temperature °C": { // key - original english translation
  9. "de": "Temperatur °C",
  10. "fr": "Température °C" // add new translation "iso-code": "translated word"
  11. },...

⚠ Don’t forget to add the comma in the previous key - value pair else syntax is broken.

If you don’t have a Github account download the file src/js/translation.js via the Raw button directly right
over the source code. Send us your file with the translation to “tech (at) sensor.community”.

URL-Parameter

Sensor

valid sensor parameters PM25, PM10, Pressure, Noise, Humidity & Official_AQI_US
http://127.0.0.1:8080/?sensor=Noise

Location

valid parameters zoom level, lat and long
http://127.0.0.1:8080/#9/48.8123/9.2487

combine parameters

first start with sensor then location
http://127.0.0.1:8080/?sensor=Noise#9/48.8123/9.2487