@geospatial-sdk/openlayers 0.0.5-dev.34 → 0.0.5-dev.36

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,EACL,UAAU,EACV,eAAe,EACf,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAiCnC,wBAAsB,WAAW,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAgN7E;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CA+B3E;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,CAQd"}
1
+ {"version":3,"file":"create-map.d.ts","sourceRoot":"","sources":["../../lib/map/create-map.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAiCnC,wBAAsB,WAAW,CAAC,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,CAgN7E;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,CAQd"}
@@ -16,7 +16,7 @@ import TileWMS from "ol/source/TileWMS";
16
16
  import VectorLayer from "ol/layer/Vector";
17
17
  import VectorSource from "ol/source/Vector";
18
18
  import GeoJSON from "ol/format/GeoJSON";
19
- import { fromLonLat } from "ol/proj";
19
+ import { fromLonLat, transformExtent } from "ol/proj";
20
20
  import { bbox as bboxStrategy } from "ol/loadingstrategy";
21
21
  import { defaultStyle } from "./styles";
22
22
  import VectorTileLayer from "ol/layer/VectorTile";
@@ -239,7 +239,7 @@ export function createView(viewModel, map) {
239
239
  });
240
240
  }
241
241
  else if ("extent" in viewModel) {
242
- view.fit(viewModel.extent, {
242
+ view.fit(transformExtent(viewModel.extent, "EPSG:4326", view.getProjection()), {
243
243
  size: map.getSize(),
244
244
  });
245
245
  }
@@ -434,7 +434,7 @@ describe("MapContextService", () => {
434
434
  });
435
435
  it("set center", () => {
436
436
  const center = view.getCenter();
437
- expect(center).toEqual([324027.04834895337, 6438563.654151043]);
437
+ expect(center).toEqual([317260.5487608297, 6623200.647707232]);
438
438
  });
439
439
  it("set zoom", () => {
440
440
  const zoom = view.getZoom();
@@ -16,7 +16,7 @@ import GeoJSON from "ol/format/GeoJSON";
16
16
  import Feature from "ol/Feature";
17
17
  import Geometry from "ol/geom/Geometry";
18
18
  import SimpleGeometry from "ol/geom/SimpleGeometry";
19
- import { fromLonLat } from "ol/proj";
19
+ import { fromLonLat, transformExtent } from "ol/proj";
20
20
  import { bbox as bboxStrategy } from "ol/loadingstrategy";
21
21
  import { defaultStyle } from "./styles";
22
22
  import VectorTileLayer from "ol/layer/VectorTile";
@@ -268,9 +268,12 @@ export function createView(viewModel: MapContextView | null, map: Map): View {
268
268
  size: map.getSize(),
269
269
  });
270
270
  } else if ("extent" in viewModel) {
271
- view.fit(viewModel.extent, {
272
- size: map.getSize(),
273
- });
271
+ view.fit(
272
+ transformExtent(viewModel.extent, "EPSG:4326", view.getProjection()),
273
+ {
274
+ size: map.getSize(),
275
+ },
276
+ );
274
277
  } else {
275
278
  const { center: centerInViewProj, zoom } = viewModel;
276
279
  const center = centerInViewProj
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geospatial-sdk/openlayers",
3
- "version": "0.0.5-dev.34+fa36a68",
3
+ "version": "0.0.5-dev.36+94e0c1d",
4
4
  "description": "OpenLayers-related utilities",
5
5
  "keywords": [
6
6
  "ol",
@@ -31,16 +31,16 @@
31
31
  "@types/chroma-js": "^2.4.3",
32
32
  "@types/lodash.throttle": "^4.1.9",
33
33
  "ol": "^8.2.0",
34
- "ol-mapbox-style": "^12.3.5"
34
+ "ol-mapbox-style": "12.4.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "ol": ">6.x"
38
38
  },
39
39
  "dependencies": {
40
- "@geospatial-sdk/core": "^0.0.5-dev.34+fa36a68",
40
+ "@geospatial-sdk/core": "^0.0.5-dev.36+94e0c1d",
41
41
  "chroma-js": "^2.4.2",
42
42
  "lodash.throttle": "^4.1.1",
43
- "ol-mapbox-style": "^12.3.5"
43
+ "ol-mapbox-style": "12.4.0"
44
44
  },
45
- "gitHead": "fa36a68506520019014221820a92ce2ef8a10fd1"
45
+ "gitHead": "94e0c1d230f8bd942efb23957ae3b56e34f4228d"
46
46
  }