start new air quality pages and tiles (#22323)

This commit is contained in:
Frédéric Péters 2018-08-15 10:28:03 +02:00
parent defb533418
commit 5db2ed8ea9
2 changed files with 35 additions and 1 deletions

View File

@ -664,3 +664,12 @@ def gnm_place_map(lat, lng):
context['init_lat'] = lat
context['init_lng'] = lng
return context
@register.inclusion_tag('combo/gnm/airquality_map.html')
def gnm_airquality_map():
map_cell = Map()
map_cell.initial_zoom = '15'
map_cell.min_zoom = '10'
map_cell.max_zoom = '19'
context = map_cell.get_cell_extra_context({})
return context

27
debian/50gnm.py vendored
View File

@ -185,7 +185,32 @@ JSON_CELL_TYPES = {
"url": "[passerelle_url]airquality/atmo/details/fr/lyon/",
"cache_duration": 300,
"force_async": False,
"name": u"Qualité de l'air"
"name": u"Qualité de l'air",
"form": [
{
"varname": "lat",
"type": "string",
"label": "Latitude",
"required": False,
},
{
"varname": "lon",
"type": "string",
"label": "Longitude",
"required": False,
}
],
"additional-data": [
{
"key": "air2go",
"url": "{% if q_lat or lat %}http://api.atmo-aura.fr/air2go/indice_request?api_token=6df2b0b505cc73c5545467758827458e&longitude={% firstof q_lon lon %}&latitude={% firstof q_lat lat %}{% endif %}"
},
{
"key": "nominatim",
"url": "{% if q_lat or lat %}{{passerelle_url}}base-adresse/nominatim/reverse?lat={% firstof q_lat lat %}&lon={% firstof q_lon lon %}&format=json{% endif %}",
"cache_duration": 3600,
}
]
},
"pollen": {
"url": "https://download.data.grandlyon.com/ws/rdata/rnsa_reseau_aerobio.rnsabulletin/all.json",