hackoregon / civic

The frontend monorepo for the CIVIC platform.
http://civicplatform.org
MIT License
60 stars 26 forks source link

Offline tile server support for Earthquake Heroes #1096

Closed DingoEatingFuzz closed 5 years ago

DingoEatingFuzz commented 5 years ago

This adds conditional support for using a custom tileserver api.

It's implemented in a manner that is optional and non-breaking. After this merges, running the game locally or at http://disastergame.civicplatform.org/ will continue to work as it always has been.

However, if you run the game with TILESERVER set in your environment, this value will be appended to the index.html file via the express server and made accessible via a selector in state/settings.

Example for local use:

$ TILESERVER=http://localhost:3456/tiles yarn start

You can also see how this will be used on site at OMSI over here.