@geospatial-sdk/maplibre 0.0.5-dev.43 → 0.0.5-dev.44
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,15 +1,13 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import {
|
|
2
|
+
import { MapContextDiff } from "@geospatial-sdk/core";
|
|
3
3
|
import {
|
|
4
|
-
SAMPLE_CONTEXT,
|
|
5
4
|
SAMPLE_LAYER1,
|
|
6
5
|
SAMPLE_LAYER2,
|
|
7
6
|
SAMPLE_LAYER3,
|
|
8
7
|
SAMPLE_LAYER4,
|
|
9
|
-
} from "@geospatial-sdk/core/fixtures/map-context.fixtures";
|
|
10
|
-
import { applyContextDiffToMap } from "./apply-context-diff";
|
|
11
|
-
import * as mapHelpers from "../helpers/map.helpers";
|
|
12
|
-
import { getBeforeId } from "../helpers/map.helpers";
|
|
8
|
+
} from "@geospatial-sdk/core/fixtures/map-context.fixtures.js";
|
|
9
|
+
import { applyContextDiffToMap } from "./apply-context-diff.js";
|
|
10
|
+
import * as mapHelpers from "../helpers/map.helpers.js";
|
|
13
11
|
|
|
14
12
|
// Helper to create a fresh mock Map instance for each test
|
|
15
13
|
function createMockMap() {
|
|
@@ -26,15 +24,10 @@ function createMockMap() {
|
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
describe("applyContextDiffToMap (mocked Map)", () => {
|
|
29
|
-
let context: MapContext;
|
|
30
27
|
let diff: MapContextDiff;
|
|
31
28
|
let map: ReturnType<typeof createMockMap>;
|
|
32
29
|
|
|
33
30
|
beforeEach(async () => {
|
|
34
|
-
context = {
|
|
35
|
-
...SAMPLE_CONTEXT,
|
|
36
|
-
layers: [SAMPLE_LAYER2, SAMPLE_LAYER1],
|
|
37
|
-
};
|
|
38
31
|
map = createMockMap();
|
|
39
32
|
map.getStyle.mockReturnValue({ layers: [], sources: {} });
|
|
40
33
|
});
|
|
@@ -90,9 +83,6 @@ describe("applyContextDiffToMap (mocked Map)", () => {
|
|
|
90
83
|
const generateLayerIdSpy = vi
|
|
91
84
|
.spyOn(mapHelpers, "generateLayerId")
|
|
92
85
|
.mockReturnValue("azreza");
|
|
93
|
-
const getBeforeId = vi
|
|
94
|
-
.spyOn(mapHelpers, "getBeforeId")
|
|
95
|
-
.mockReturnValue("azreza");
|
|
96
86
|
const removeLayersFromSourceSpy = vi.spyOn(
|
|
97
87
|
mapHelpers,
|
|
98
88
|
"removeLayersFromSource",
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
MAP_CTX_LAYER_OGCAPI_FIXTURE,
|
|
6
6
|
MAP_CTX_LAYER_WFS_FIXTURE,
|
|
7
7
|
MAP_CTX_LAYER_WMS_FIXTURE,
|
|
8
|
-
} from "@geospatial-sdk/core/fixtures/map-context.fixtures";
|
|
8
|
+
} from "@geospatial-sdk/core/fixtures/map-context.fixtures.js";
|
|
9
9
|
import { LayerGeojsonWithData, MapContextLayer } from "@geospatial-sdk/core";
|
|
10
|
-
import { createLayer } from "./create-map";
|
|
10
|
+
import { createLayer } from "./create-map.js";
|
|
11
11
|
import {
|
|
12
12
|
FillLayerSpecification,
|
|
13
13
|
GeoJSONSourceSpecification,
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
FEATURE_COLLECTION_LINESTRING_FIXTURE_4326,
|
|
18
18
|
FEATURE_COLLECTION_POLYGON_FIXTURE_4326,
|
|
19
|
-
} from "@geospatial-sdk/core/fixtures/geojson.fixtures";
|
|
20
|
-
import { PartialStyleSpecification } from "../maplibre.models";
|
|
19
|
+
} from "@geospatial-sdk/core/fixtures/geojson.fixtures.js";
|
|
20
|
+
import { PartialStyleSpecification } from "../maplibre.models.js";
|
|
21
21
|
import {
|
|
22
22
|
CircleLayerSpecification,
|
|
23
23
|
LayerSpecification,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geospatial-sdk/maplibre",
|
|
3
|
-
"version": "0.0.5-dev.
|
|
3
|
+
"version": "0.0.5-dev.44+44c94a2",
|
|
4
4
|
"description": "Maplibre-related utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maplibre",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"maplibre-gl": "^5.7.3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@geospatial-sdk/core": "^0.0.5-dev.
|
|
36
|
+
"@geospatial-sdk/core": "^0.0.5-dev.44+44c94a2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "44c94a2e3458beb7e3f3ffc98ed170c21a0fc460"
|
|
39
39
|
}
|