Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for WMTS endpoints #25

Merged
merged 7 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
name: Build
name: Deploy to GitHub Pages
on:
push:
branches:
- main

jobs:
lint-test-build:
deploy:
name: Build app & deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node & NPM
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
node-version: '20'
cache: 'npm'

- name: Install lib dependencies
run: npm ci
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Quality Assurance
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, ready_for_review]

jobs:
format-typecheck-test:
name: Formatting, types and tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node & NPM
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'

- name: Install lib dependencies
run: npm ci

- name: Formatting
run: npm run format:check

- name: Type check
run: npm run typecheck

- name: Run tests
run: npm test
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@ The following standards are partially implemented:

- WMS - _Web Map Service_
- WFS - _Web Feature Service_
- WMTS - _Web Map Tile Service_
- OGC API (Records and Features)

Why no WMTS support? Because [OpenLayers](https://www.github.com/openlayers/openlayers) has an incredibly thorough and well-tested WMTS capabilities parser and you should just use it.
Reimplementing it in **ogc-client** currently does not bring any significant value.

## Why use it?

1. **ogc-client** will abstract the service version so you don't have to worry about it
2. **ogc-client** will handle XML so you only have to deal with native Javascript objects
3. **ogc-client** will hide the complexity of OGC standards behind straightforward APIs
4. **ogc-client** will run heavy tasks in a worker to avoid blocking the main thread
5. **ogc-client** will keep a persistent cache of operations to minimize requests and processing
6. **ogc-client** will handle errors in a graceful way and extract relevant messages for you
7. **ogc-client** will tell you if a service is not usable for [CORS-related issues](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
6. **ogc-client** will tell you if a service is not usable for [CORS-related issues](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)

## Instructions

Expand Down Expand Up @@ -59,7 +56,7 @@ To start it locally, clone the repository and run the following commands:
```bash
$ cd app
$ npm install
$ npm run serve
$ npm start
```

The app is based on [Vue.js](https://vuejs.org/) and will showcase most features implemented in the library.
Expand Down
5 changes: 5 additions & 0 deletions __mocks__/ol/proj.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
get: jest.fn(() => ({
code: '3857',
})),
};
1 change: 1 addition & 0 deletions __mocks__/ol/proj/proj4.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { fromEPSGCode: jest.fn(), register: jest.fn() };
1 change: 1 addition & 0 deletions __mocks__/ol/tilegrid/WMTS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { createFromCapabilitiesMatrixSet: jest.fn(() => {}) };
Loading
Loading