forked from opendata-stuttgart/feinstaub-map-v2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from CodeForAfrica/fix/update-map-tiles
Fix map tiles
- Loading branch information
Showing
2 changed files
with
58 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,83 @@ | ||
# sensors.AFRICA-AQ-map-v2 | ||
A new version of air quality map for the Luftdaten. | ||
You can find a here a [Live Version](https://maps.luftdaten.info/). | ||
|
||
## Goals and ideas | ||
* visualise recent sensor data on a map | ||
* switch between sensor data (PM2.5, PM10, humidity data, ...) | ||
* visualization between Air Quality Index (AQI) and normal default levels | ||
* identify and add existing air quality data from external sources | ||
|
||
### Map application | ||
The implementation makes use of various frameworks and is on [ECMA 6](https://developer.mozilla.org/de/docs/Web/JavaScript) language level. Used frameworks are: | ||
# Sensor.Community Map | ||
visualize recent sensor data on a world map for [Sensor.Community](https://sensor.community). | ||
|
||
👉 [Live Version](https://maps.sensor.community/). | ||
|
||
# Map application | ||
The implementation makes use of various frameworks and is on [ECMA 6](https://developer.mozilla.org/de/docs/Web/JavaScript) language level. | ||
|
||
Used frameworks are: | ||
* [leaflet](http://leafletjs.com/) (mapping framework) | ||
* [d3](https://d3js.org/) (visualisation framework) | ||
* [webpack](https://webpack.github.io/) is used for deployment | ||
|
||
## How to run | ||
# How to run | ||
### Installation | ||
Requirements: | ||
* [Node JS](https://nodejs.org/) 10.15.x or higher | ||
* NPM should be version 6.9.x or higher | ||
|
||
install all dependencies | ||
|
||
``` | ||
cp src/js/config.js.dist src/js/config.js | ||
npm install | ||
``` | ||
|
||
### Develop | ||
start development server (http://127.0.0.1:8080/) | ||
|
||
``` | ||
npm start | ||
``` | ||
|
||
### Publish | ||
build all files needed to run on a webserver, files willl be compileed into `dist/`): | ||
build all files needed to run on a webserver, files will be compiled into `dist/`): | ||
|
||
``` | ||
npm run build | ||
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)](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). | ||
|
||
```javascript | ||
"(Sensor)": { // key - original english translation | ||
"de": "Sensor", // nested key - value pair | ||
"fr": "Détecteur" // add new translation "iso-code": "translated word" | ||
}, | ||
"PM10 µg/m³": {}, | ||
"PM2.5 µg/m³": {}, | ||
"AQI US": {}, | ||
"Temperature °C": { // key - original english translation | ||
"de": "Temperatur °C", | ||
"fr": "Température °C" // add new translation "iso-code": "translated word" | ||
},... | ||
``` | ||
|
||
⚠ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters