@geospatial-sdk/maplibre 0.0.5-dev.60 → 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.
@@ -24,7 +24,7 @@ export async function createLayer(layerModel) {
24
24
  widthPx: 256,
25
25
  heightPx: 256,
26
26
  extent: [0, 0, 0, 0], // will be replaced by maplibre-gl
27
- outputFormat: "image/png",
27
+ outputFormat: layerModel.format ?? "image/png",
28
28
  crs: "EPSG:3857",
29
29
  });
30
30
  url = removeSearchParams(url, ["bbox"]);
@@ -49,6 +49,14 @@ describe("MapContextService", () => {
49
49
  "https://www.datagrandest.fr/geoserver/region-grand-est/ows?REQUEST=GetMap&SERVICE=WMS&layers=commune_actuelle_3857&styles=&format=image%2Fpng&transparent=true&version=1.1.1&height=256&width=256&srs=EPSG%3A3857&BBOX={bbox-epsg-3857}",
50
50
  ]);
51
51
  });
52
+ it("uses the provided WMS output format", async () => {
53
+ layerModel = { ...MAP_CTX_LAYER_WMS_FIXTURE, format: "image/jpeg" };
54
+ style = (await createLayer(layerModel)) as PartialStyleSpecification;
55
+ const source = style.sources["123456"] as RasterSourceSpecification;
56
+ expect(source.tiles).toEqual([
57
+ "https://www.datagrandest.fr/geoserver/region-grand-est/ows?REQUEST=GetMap&SERVICE=WMS&layers=commune_actuelle_3857&styles=&format=image%2Fjpeg&transparent=true&version=1.1.1&height=256&width=256&srs=EPSG%3A3857&BBOX={bbox-epsg-3857}",
58
+ ]);
59
+ });
52
60
  it("create a layer", () => {
53
61
  expect(style.layers).toBeTruthy();
54
62
  expect(style.layers.length).toBe(1);
@@ -50,7 +50,7 @@ export async function createLayer(
50
50
  widthPx: 256,
51
51
  heightPx: 256,
52
52
  extent: [0, 0, 0, 0], // will be replaced by maplibre-gl
53
- outputFormat: "image/png",
53
+ outputFormat: layerModel.format ?? "image/png",
54
54
  crs: "EPSG:3857",
55
55
  });
56
56
  url = removeSearchParams(url, ["bbox"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geospatial-sdk/maplibre",
3
- "version": "0.0.5-dev.60+f826933",
3
+ "version": "0.0.5-dev.61+b43d731",
4
4
  "description": "Maplibre-related utilities",
5
5
  "keywords": [
6
6
  "maplibre",
@@ -33,8 +33,8 @@
33
33
  "maplibre-gl": "^5.19.0"
34
34
  },
35
35
  "dependencies": {
36
- "@geospatial-sdk/core": "^0.0.5-dev.60+f826933",
37
- "@geospatial-sdk/style": "^0.0.5-dev.60+f826933"
36
+ "@geospatial-sdk/core": "^0.0.5-dev.61+b43d731",
37
+ "@geospatial-sdk/style": "^0.0.5-dev.61+b43d731"
38
38
  },
39
- "gitHead": "f8269338a04fb473cb6a467a12d2cddad89e6b98"
39
+ "gitHead": "b43d7316d5b41cb71ea775091457f1c215d9c5ee"
40
40
  }