@geospatial-sdk/openlayers 0.0.5-dev.59 → 0.0.5-dev.61

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.
@@ -1 +1 @@
1
- {"version":3,"file":"create-map.d.ts","sourceRoot":"","sources":["../../lib/map/create-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,KAAK,MAAM,mBAAmB,CAAC;AA0DtC,wBAAsB,WAAW,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAgR7E;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,eAAe,EAC3B,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,eAAe,GAClC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CAkC3E;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAC5B,OAAO,CAAC,GAAG,CAAC,CAKd;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,GAAG,CAAC,CAUd"}
1
+ {"version":3,"file":"create-map.d.ts","sourceRoot":"","sources":["../../lib/map/create-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,KAAK,MAAM,mBAAmB,CAAC;AA0DtC,wBAAsB,WAAW,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAiR7E;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,eAAe,EAC3B,aAAa,EAAE,MAAM,EACrB,kBAAkB,EAAE,eAAe,GAClC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CAkC3E;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,UAAU,EACnB,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,GAC5B,OAAO,CAAC,GAAG,CAAC,CAKd;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,GAAG,CAAC,CAUd"}
@@ -71,6 +71,7 @@ export async function createLayer(layerModel) {
71
71
  const url = removeSearchParams(layerModel.url, ["request", "service"]);
72
72
  const params = {
73
73
  LAYERS: layerModel.name,
74
+ ...(layerModel.format && { FORMAT: layerModel.format }),
74
75
  ...(layerModel.style && { STYLES: layerModel.style }),
75
76
  };
76
77
  if (layerModel.useTiles === false) {
@@ -193,6 +193,18 @@ describe("MapContextService", () => {
193
193
  TILED: true,
194
194
  });
195
195
  });
196
+ it("sets custom WMS FORMAT param when provided", async () => {
197
+ layerModel = { ...MAP_CTX_LAYER_WMS_FIXTURE, format: "image/jpeg" };
198
+ layer = await createLayer(layerModel);
199
+ const source = layer.getSource() as TileWMS;
200
+ const params = source.getParams();
201
+ expect(params).toEqual({
202
+ LAYERS: (layerModel as MapContextLayerWms).name,
203
+ FORMAT: "image/jpeg",
204
+ STYLES: (layerModel as MapContextLayerWms).style,
205
+ TILED: true,
206
+ });
207
+ });
196
208
  it("set correct url without existing REQUEST and SERVICE params", () => {
197
209
  const source = layer.getSource() as TileWMS;
198
210
  const urls = source.getUrls() || [];
@@ -266,6 +278,21 @@ describe("MapContextService", () => {
266
278
  STYLES: (layerModel as MapContextLayerWms).style,
267
279
  });
268
280
  });
281
+ it("sets custom WMS FORMAT param when provided", async () => {
282
+ layerModel = {
283
+ ...MAP_CTX_LAYER_WMS_FIXTURE,
284
+ useTiles: false,
285
+ format: "image/jpeg",
286
+ };
287
+ layer = await createLayer(layerModel);
288
+ const source = layer.getSource() as ImageWMS;
289
+ const params = source.getParams();
290
+ expect(params).toEqual({
291
+ LAYERS: (layerModel as MapContextLayerWms).name,
292
+ FORMAT: "image/jpeg",
293
+ STYLES: (layerModel as MapContextLayerWms).style,
294
+ });
295
+ });
269
296
  it("set correct url without existing REQUEST and SERVICE params", () => {
270
297
  const source = layer.getSource() as ImageWMS;
271
298
  const url = source.getUrl();
@@ -104,6 +104,7 @@ export async function createLayer(layerModel: MapContextLayer): Promise<Layer> {
104
104
  const url = removeSearchParams(layerModel.url, ["request", "service"]);
105
105
  const params = {
106
106
  LAYERS: layerModel.name,
107
+ ...(layerModel.format && { FORMAT: layerModel.format }),
107
108
  ...(layerModel.style && { STYLES: layerModel.style }),
108
109
  };
109
110
  if (layerModel.useTiles === false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geospatial-sdk/openlayers",
3
- "version": "0.0.5-dev.59+5f667ef",
3
+ "version": "0.0.5-dev.61+b43d731",
4
4
  "description": "OpenLayers-related utilities",
5
5
  "keywords": [
6
6
  "ol",
@@ -37,9 +37,9 @@
37
37
  "ol": ">9.x"
38
38
  },
39
39
  "dependencies": {
40
- "@geospatial-sdk/core": "^0.0.5-dev.59+5f667ef",
40
+ "@geospatial-sdk/core": "^0.0.5-dev.61+b43d731",
41
41
  "lodash.throttle": "^4.1.1",
42
42
  "ol-mapbox-style": "12.4.0"
43
43
  },
44
- "gitHead": "5f667ef9c6accc37b582e53e231cc7ca0563f9bc"
44
+ "gitHead": "b43d7316d5b41cb71ea775091457f1c215d9c5ee"
45
45
  }