@masterportal/masterportalapi 2.19.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/layer/wmts.js +15 -6
- package/test/layer/wmts.test.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
### Removed
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
---
|
|
14
|
+
## 2.19.1 - 2023-06-02
|
|
15
|
+
### Added
|
|
16
|
+
### Changed
|
|
17
|
+
- Exports in src/layer/wmts.js changed to export default {} to provide ES-Syntax.
|
|
18
|
+
### Deprecated
|
|
19
|
+
### Removed
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
13
22
|
---
|
|
14
23
|
|
|
15
24
|
## 2.19.0 - 2023-05-26
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masterportal/masterportalapi",
|
|
3
3
|
"author": "Implementierungspartnerschaft Masterportal <info@masterportal.org> (https://www.masterportal.org)",
|
|
4
|
-
"version": "2.19.
|
|
4
|
+
"version": "2.19.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Basic functions of the Masterportal as api",
|
|
7
7
|
"repository": {
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {createMapView} from "./maps/mapView";
|
|
|
2
2
|
import crs from "./crs";
|
|
3
3
|
import rawLayerList from "./rawLayerList";
|
|
4
4
|
import * as wms from "./layer/wms";
|
|
5
|
-
import
|
|
5
|
+
import wmts from "./layer/wmts";
|
|
6
6
|
import * as wfs from "./layer/wfs";
|
|
7
7
|
import * as geojson from "./layer/geojson";
|
|
8
8
|
import * as vectorBase from "./layer/vectorBase";
|
package/src/layer/wmts.js
CHANGED
|
@@ -12,7 +12,7 @@ import {get as getProjection} from "ol/proj";
|
|
|
12
12
|
* @param {String} layerName layerName
|
|
13
13
|
* @returns {void}
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
function showErrorMessage (errorMessage, layerName) {
|
|
16
16
|
console.error("content: Layer " + layerName + ": " + errorMessage);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ export function showErrorMessage (errorMessage, layerName) {
|
|
|
24
24
|
* @param {Number} size The tileSize depending on the extent.
|
|
25
25
|
* @returns {void}
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
function generateArrays (resolutions, matrixIds, length, size) {
|
|
28
28
|
for (let i = 0; i < length; ++i) {
|
|
29
29
|
resolutions[i] = size / Math.pow(2, i);
|
|
30
30
|
matrixIds[i] = i;
|
|
@@ -37,7 +37,7 @@ export function generateArrays (resolutions, matrixIds, length, size) {
|
|
|
37
37
|
* @throws {Error} on unexpected return
|
|
38
38
|
* @returns {promise} promise resolves to parsed WMTS-GetCapabilities object
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
function getWMTSCapabilities (url) {
|
|
41
41
|
return fetch(url)
|
|
42
42
|
.then(response => {
|
|
43
43
|
if (response && response.status === 200) {
|
|
@@ -55,7 +55,7 @@ export function getWMTSCapabilities (url) {
|
|
|
55
55
|
* @param {WMTS} tileLayer layer object
|
|
56
56
|
* @returns {void}
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
function createLayerSourceByDefinitions (attrs, tileLayer) {
|
|
59
59
|
const projection = getProjection(attrs.coordinateSystem),
|
|
60
60
|
extent = projection.getExtent(),
|
|
61
61
|
style = attrs.style,
|
|
@@ -108,7 +108,7 @@ export function createLayerSourceByDefinitions (attrs, tileLayer) {
|
|
|
108
108
|
* @param {WMTS} tileLayer layer object
|
|
109
109
|
* @returns {void}
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
function createLayerSourceByCapabilities (attrs, tileLayer) {
|
|
112
112
|
const layerIdentifier = attrs.layers,
|
|
113
113
|
url = attrs.capabilitiesUrl,
|
|
114
114
|
matrixSet = attrs.tileMatrixSet,
|
|
@@ -169,7 +169,7 @@ export function createLayerSourceByCapabilities (attrs, tileLayer) {
|
|
|
169
169
|
* @param {object} layerParams - additional layer params
|
|
170
170
|
* @returns {void}
|
|
171
171
|
*/
|
|
172
|
-
|
|
172
|
+
function createLayer (rawLayer, layerParams = {}) {
|
|
173
173
|
const tileLayer = new TileLayer(Object.assign({
|
|
174
174
|
id: rawLayer.id,
|
|
175
175
|
source: new WMTS({}),
|
|
@@ -193,3 +193,12 @@ export function createLayer (rawLayer, layerParams = {}) {
|
|
|
193
193
|
|
|
194
194
|
return tileLayer;
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
export default {
|
|
198
|
+
createLayer,
|
|
199
|
+
createLayerSourceByCapabilities,
|
|
200
|
+
createLayerSourceByDefinitions,
|
|
201
|
+
getWMTSCapabilities,
|
|
202
|
+
generateArrays,
|
|
203
|
+
showErrorMessage
|
|
204
|
+
};
|
package/test/layer/wmts.test.js
CHANGED