Skip to content

Commit

Permalink
make basemaps configurable (#261) (#16)
Browse files Browse the repository at this point in the history
* Persist env variables where possible

* Make basemap configurable

Implements wmo-im/wis2box#261
  • Loading branch information
webb-ben authored Sep 23, 2022
1 parent c44e933 commit c1b8f41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/pygeoapi-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ server:
pretty_print: false
limit: 500
map:
url: https://tile.openstreetmap.org/{z}/{x}/{y}.png
attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
url: ${WIS2BOX_BASEMAP_URL}
attribution: ${WIS2BOX_BASEMAP_ATTRIBUTION}
templates:
path: /pygeoapi/pygeoapi/templates

Expand Down
5 changes: 5 additions & 0 deletions wis2box_api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def write_config(self, config):
# validate pygeoapi configuration
validate_config(config)

with open(self.PYGEOAPI_CONFIG, encoding='utf8') as fh:
conf = yaml.safe_load(fh)

config = json_merge_patch.merge(config, conf)

# write pygeoapi configuration
LOGGER.debug('Writing pygeoapi configutation')
self.yaml_dump(config, self.PYGEOAPI_CONFIG)
Expand Down

0 comments on commit c1b8f41

Please sign in to comment.