mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-28 19:51:17 -07:00
Allow open source map with new API key (#1155)
* Allow open source map - create new getOSBaseMap function - set secret on GitHub actions - read secret into J40Map.tsx - add secret to gatsby-config - remove secret from .env.* * Fix typo on yml file * Add placeholder for API TOKEN - add placeholder in docker compose - add placeholder in .env.dev - remove console.log * Add Mapbox API Token to main deploy
This commit is contained in:
parent
18f299c5f8
commit
f4926376fa
10 changed files with 214 additions and 145 deletions
|
@ -29,7 +29,7 @@ import MapSearch from './MapSearch';
|
|||
import TerritoryFocusControl from './territoryFocusControl';
|
||||
|
||||
// Styles and constants
|
||||
// import {makeMapStyle} from '../data/mapStyle';
|
||||
import {getOSBaseMap} from '../data/getOSBaseMap';
|
||||
import 'maplibre-gl/dist/maplibre-gl.css';
|
||||
import * as constants from '../data/constants';
|
||||
import * as styles from './J40Map.module.scss';
|
||||
|
@ -258,14 +258,18 @@ const J40Map = ({location}: IJ40Interface) => {
|
|||
<ReactMapGL
|
||||
// Initialization props:
|
||||
// access token is j40StylesReadToken
|
||||
mapboxApiAccessToken={process.env.GATSBY_MAPBOX_STYLES_READ_TOKEN}
|
||||
mapboxApiAccessToken={
|
||||
process.env.MAPBOX_STYLES_READ_TOKEN ?
|
||||
process.env.MAPBOX_STYLES_READ_TOKEN : ''}
|
||||
|
||||
// Map state props:
|
||||
// http://visgl.github.io/react-map-gl/docs/api-reference/interactive-map#map-state
|
||||
{...viewport}
|
||||
mapStyle={`mapbox://styles/mapbox/streets-v11`}
|
||||
mapStyle={
|
||||
process.env.MAPBOX_STYLES_READ_TOKEN ? `mapbox://styles/mapbox/streets-v11` :
|
||||
getOSBaseMap()
|
||||
}
|
||||
// This styles will need to be enabled in some way when adding back the free map - #1133
|
||||
// mapStyle={makeMapStyle(flags)}
|
||||
width="100%"
|
||||
height={windowWidth < 1024 ? '44vh' : '100%'}
|
||||
mapOptions={{hash: true}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue