@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 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.0",
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 * as wmts from "./layer/wmts";
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
- export function showErrorMessage (errorMessage, layerName) {
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
- export function generateArrays (resolutions, matrixIds, length, size) {
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
- export function getWMTSCapabilities (url) {
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
- export function createLayerSourceByDefinitions (attrs, tileLayer) {
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
- export function createLayerSourceByCapabilities (attrs, tileLayer) {
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
- export function createLayer (rawLayer, layerParams = {}) {
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
+ };
@@ -1,7 +1,7 @@
1
1
  import {get as getProjection} from "ol/proj";
2
2
  import {getWidth} from "ol/extent";
3
3
 
4
- import * as wmts from "../../src/layer/wmts";
4
+ import wmts from "../../src/layer/wmts";
5
5
 
6
6
  describe("wmts.js", function () {
7
7
  describe("generateArrays", function () {