@geolonia/embed 5.2.1 → 5.2.2

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/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "5.2.1";
1
+ export declare const VERSION = "5.2.2";
package/e2e/basic.spec.ts CHANGED
@@ -53,5 +53,28 @@ test.describe('1. 基本的な地図表示', () => {
53
53
  await waitForMapLoad(page);
54
54
  expect(consoleErrors).toHaveLength(0);
55
55
  });
56
+
57
+ test('1.4 アトリビューションが表示されていること', async ({ page }) => {
58
+ await page.goto(`${TEST_URL}/basic.html`);
59
+ await waitForMapLoad(page);
60
+
61
+ // CustomAttributionControl は Shadow DOM 内にアトリビューションを描画する
62
+ const attributionText = await page.evaluate(() => {
63
+ const containers = document.querySelectorAll('.geolonia .maplibregl-control-container .maplibregl-ctrl-bottom-right > div');
64
+ for (const container of containers) {
65
+ const shadow = container.shadowRoot;
66
+ if (shadow) {
67
+ const inner = shadow.querySelector('.maplibregl-ctrl-attrib-inner');
68
+ if (inner) {
69
+ return inner.innerHTML;
70
+ }
71
+ }
72
+ }
73
+ return null;
74
+ });
75
+
76
+ expect(attributionText).not.toBeNull();
77
+ expect(attributionText).not.toBe('');
78
+ });
56
79
  });
57
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geolonia/embed",
3
- "version": "5.2.1",
3
+ "version": "5.2.2",
4
4
  "description": "Geolonia embed JS API",
5
5
  "main": "dist/embed.js",
6
6
  "types": "dist/src/embed.d.ts",
@@ -15,8 +15,6 @@
15
15
  }
16
16
  },
17
17
  "scripts": {
18
- "prestart": "npm run build:version",
19
- "prelint": "npm run build:version",
20
18
  "start": "MAP_PLATFORM_STAGE=v1 webpack serve --config ./docs/webpack.config.js",
21
19
  "build": "npm run build:version && npm run build:embed",
22
20
  "build:version": "node ./scripts/build-version.mjs",
@@ -311,11 +311,11 @@ class CustomAttributionControl implements IControl {
311
311
  this.styleId = stylesheet.id;
312
312
  }
313
313
 
314
- const sourceCaches = this._map.style.sourceCaches;
315
- for (const id in sourceCaches) {
316
- const sourceCache = sourceCaches[id];
317
- if (sourceCache.used || sourceCache.usedForTerrain) {
318
- const source = sourceCache.getSource();
314
+ const tileManagers = this._map.style.tileManagers;
315
+ for (const id in tileManagers) {
316
+ const tileManager = tileManagers[id];
317
+ if (tileManager.used || tileManager.usedForTerrain) {
318
+ const source = tileManager.getSource();
319
319
  if (
320
320
  source.attribution &&
321
321
  attributions.indexOf(source.attribution) < 0
package/src/version.ts ADDED
@@ -0,0 +1 @@
1
+ export const VERSION = '5.2.1';