-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build with openlayers 8 * add the stadia secret * render stadia optional * render stadia optional in the examples/tests * restore testing on all versions * update the ol8 snapshot * document * remove the stadia snapshot * update the changelog --------- Co-authored-by: Momtchil Momtchev <[email protected]>
- Loading branch information
Showing
19 changed files
with
136 additions
and
94 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 |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
branches: [main] | ||
workflow_dispatch: | ||
|
||
env: | ||
STADIA_MAPS_API_KEY: ${{ secrets.STADIA_MAPS_API_KEY }} | ||
|
||
jobs: | ||
default: | ||
runs-on: ubuntu-latest | ||
|
@@ -20,6 +23,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: npm i | ||
- run: npm run build --if-present | ||
- run: npm test | ||
|
@@ -45,13 +49,15 @@ jobs: | |
- '7.3.0' | ||
- '7.4.0' | ||
- '7.5.1' | ||
- '8.0.0' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: npm i | ||
- run: npm i --force ol@${{ matrix.ol-version }} | ||
- run: npm run build --if-present | ||
|
@@ -66,6 +72,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: | | ||
npm i [email protected] [email protected] [email protected] @types/react@16 @types/react-dom@16 @testing-library/react@11 | ||
- run: npm i | ||
|
@@ -82,6 +89,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: | | ||
npm i [email protected] [email protected] [email protected] @types/react@16 @types/react-dom@16 @testing-library/react@11 | ||
- run: npm i | ||
|
@@ -98,6 +106,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: | | ||
npm i react@17 react-dom@17 react-test-renderer@17 @types/react@17 @types/react-dom@17 @testing-library/react@11 | ||
- run: npm i | ||
|
@@ -114,6 +123,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: | | ||
npm i react@18 react-dom@18 react-test-renderer@18 @types/react@18 @types/react-dom@18 @testing-library/react@13 | ||
- run: npm i | ||
|
@@ -130,6 +140,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: | | ||
npm i [email protected] [email protected] [email protected] @types/react@18 @types/react-dom@18 @testing-library/react@13 | ||
- run: npm i | ||
|
@@ -146,6 +157,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: | | ||
npm i [email protected] [email protected] [email protected] @types/react@18 @types/react-dom@18 @testing-library/react@13 | ||
- run: npm i | ||
|
@@ -162,6 +174,7 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
- run: echo "::add-mask::${{ secrets.STADIA_MAPS_API_KEY }}" | ||
- run: npm i | ||
- run: npm run test | ||
env: | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import {Tile as LayerTile} from 'ol/layer'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
import {StadiaMaps} from 'ol/source'; | ||
|
||
import {RContextType} from '../context'; | ||
import {default as RLayerRaster, RLayerRasterProps} from './RLayerRaster'; | ||
|
||
/** | ||
* @propsfor RLayerStadia | ||
*/ | ||
export interface RLayerStadiaProps extends RLayerRasterProps { | ||
/** Stadia Maps layer name */ | ||
layer: string; | ||
/** API key */ | ||
apiKey?: string; | ||
/** Retina screen mode, @default false */ | ||
retina?: boolean; | ||
} | ||
|
||
/** | ||
* A ready to use interface for Stadia Maps's map service | ||
* | ||
* Requires OpenLayers 8.0 and must be imported separately | ||
* | ||
* `import RLayerStadia from 'rlayers/layer/RLayerStadia';` | ||
* | ||
* | ||
* Requires an `RMap` context | ||
*/ | ||
export default class RLayerStadia extends RLayerRaster<RLayerStadiaProps> { | ||
ol: LayerTile<StadiaMaps>; | ||
source: StadiaMaps; | ||
|
||
constructor(props: Readonly<RLayerStadiaProps>, context?: React.Context<RContextType>) { | ||
super(props, context); | ||
this.source = new StadiaMaps({ | ||
layer: this.props.layer, | ||
apiKey: this.props.apiKey, | ||
retina: this.props.retina ?? false | ||
}); | ||
this.ol = new LayerTile({source: this.source}); | ||
this.eventSources = [this.ol, this.source]; | ||
} | ||
} |
Oops, something went wrong.