-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Update to use Maplibre with Protomaps API (#988)
* Add MapUtils * Load map_utils pack with defer: false * Add new Map service for configuring default map configurations * Use default map configuration * feat: Use Protomaps API for Home map * Update maplibre-gl * feat: use Maplibre & Protomaps in Rails * Cleanup unused method & dependencies * Ensure Tileserver config is set to serve all fonts for appropriate fallback * Update .env.example with new keys * Add Protomaps API key and basemap style attributes to Theme * Update Theme form to update protomaps attrs * Update Map's to utilize protomaps API when provided Also update basemap style theme when provided, default to Contrast otherwise. * fix: Story show map should allow panning * Allow static map to have zoom nav controls * Update manage community specs w/ new Map service * Add default value for Mapbox marker colors * Add/update Theme specs --------- Co-authored-by: Laura Mosher <[email protected]>
- Loading branch information
1 parent
c59ca7a
commit 5abcfb6
Showing
33 changed files
with
1,215 additions
and
717 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,32 +1,45 @@ | ||
# This file is used to build your local dev or offline Terrastories server | ||
# in Docker Compose. | ||
################################## | ||
# Configure MapLibre [Recommended] | ||
# | ||
# By default, Terrastories is configured to serve maps using | ||
# Maplibre GL JS with Protomap's free API Tileserver. | ||
# | ||
# If you configure Mapbox, the settings in this section are ignored. | ||
|
||
# ==> CORS | ||
# CORS, or Cross Origin Request Sharing, allows external requests from allowed | ||
# sites to access the resources in this application. | ||
# The Public Community feature provides an API. For now, this API should only be available from | ||
# allowed origins. These can be configured via this ENV variable to be configurable | ||
# on servers without needing a code change. | ||
CORS_ORIGINS="localhost:1080,\Ahttps:\/\/[a-z0-9]{4}-[0-9]{2}-[0-9]{3}-[0-9]{3}-[0-9]{3}.ngrok.io\z" | ||
# ==> Protomaps Hosted API | ||
# | ||
# Protomaps also maintains a Tiles API - get a free API key. | ||
# It's free for non-commercial use, or commercial use paired with a GitHub sponsorship. | ||
# | ||
# Sign up at https://app.protomaps.com/signup and provide your API key: | ||
# PROTOMAPS_API_KEY= | ||
|
||
# ==> Tileserver (hosted or local) | ||
# | ||
# Previously, we provided a hosted Tileserver GL server along side | ||
# Terrastories to serve map tiles in offline mode. | ||
# | ||
# TILESERVER_URL=https://localhost:8080/styles/my-style/style.json | ||
|
||
# If you are setting up your own online production instance, please see this page | ||
# https://docs.terrastories.app/setting-up-a-terrastories-server/hosting-environments/hosting-terrastories-online | ||
# If you have any additional questions, reach out to the Terrastories Stewards team | ||
# for help. | ||
################## | ||
# Configure Mapbox | ||
# | ||
# For backwards compatibility, Terrastories still supports map rendering with | ||
# Mapbox and Mapbox styles when configured. | ||
|
||
# ==> Default Online Mapbox Configuration | ||
# Mapbox access token and style are required to run Terrastories in an internet- | ||
# connected environment, including local Development. These settings do not need | ||
# to be set here; however, each community must configure them in their Theme | ||
# settings for any mapping functionality to work. | ||
# Set your Mapbox Access Token (DEFAULT_MAPBOX_TOKEN works, but is deprecated) | ||
# MAPBOX_ACCESS_TOKEN=pk.ey | ||
|
||
# Configure a Mapbox personal access token to use the mapping functionality | ||
# of terrastories. This Access Token will be used by default across all | ||
# onboarded communities to this instance. | ||
# DEFAULT_MAPBOX_TOKEN=pk.set-your-key-here | ||
# Set your Mapbox Style (DEFAULT_MAP_STYLE works, but is deprecated) | ||
# If unset, Terrastories defaults to Mapbox's streets-v11 | ||
# MAPBOX_STYLE=mapbox://styles/mapbox/streets-v11 | ||
|
||
# Configure a custom Mapbox style. This can be any off-the-shelf style provided | ||
# by Mapbox, or a custom style associated with your personal access token. This | ||
# default map style will be used by default across all onboarded communities to | ||
# this instance. | ||
# DEFAULT_MAP_STYLE=mapbox://styles/mapbox/streets-v11 | ||
################## | ||
# Configure CORS | ||
# | ||
# CORS (Cross Origin Request Sharing) allows external requests from allowed | ||
# sites to access resources in this application. | ||
# | ||
# Default origins are provide for local development and ngrok. | ||
# Additional origins can be added with comma-separation. | ||
CORS_ORIGINS="localhost:1080,\Ahttps:\/\/[a-z0-9]{4}-[0-9]{2}-[0-9]{3}-[0-9]{3}-[0-9]{3}.ngrok.io\z" |
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
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
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
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
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
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
Oops, something went wrong.