@geops/rvf-mobility-web-component 0.1.60 → 0.1.62

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +1 -0
  3. package/docutils.js +103 -4
  4. package/fonts/source-sans-3/source-sans-3-v15-latin-500.ttf +0 -0
  5. package/fonts/source-sans-3/source-sans-3-v15-latin-500.woff2 +0 -0
  6. package/fonts/source-sans-3/source-sans-3-v15-latin-600.ttf +0 -0
  7. package/fonts/source-sans-3/source-sans-3-v15-latin-600.woff2 +0 -0
  8. package/fonts/source-sans-3/source-sans-3-v15-latin-700.ttf +0 -0
  9. package/fonts/source-sans-3/source-sans-3-v15-latin-700.woff2 +0 -0
  10. package/fonts/source-sans-3/source-sans-3-v15-latin-regular.ttf +0 -0
  11. package/fonts/source-sans-3/source-sans-3-v15-latin-regular.woff2 +0 -0
  12. package/index.html +28 -94
  13. package/index.js +235 -224
  14. package/notifications.html +144 -0
  15. package/package.json +2 -2
  16. package/search.html +24 -65
  17. package/src/FeatureDetails/FeatureDetails.tsx +20 -6
  18. package/src/FeaturesInfosListener/FeaturesInfosListener.tsx +2 -0
  19. package/src/LayerTree/TreeItem/TreeItem.tsx +2 -2
  20. package/src/LayerTreeMenu/LayerTreeMenu.tsx +19 -3
  21. package/src/LayoutState/LayoutState.tsx +17 -0
  22. package/src/LinesNetworkPlanDetails/LinesNetworkPlanDetails.tsx +34 -21
  23. package/src/LinesNetworkPlanLayer/LinesNetworkPlanLayer.tsx +3 -6
  24. package/src/LinesNetworkPlanLayerHighlight/LinesNetworkPlanLayerHighlight.tsx +88 -0
  25. package/src/LinesNetworkPlanLayerHighlight/index.tsx +1 -0
  26. package/src/MapDispatchEvents/MapDispatchEvents.tsx +6 -4
  27. package/src/MapLayout/MapLayout.tsx +2 -2
  28. package/src/MapsetLayer/MapsetLayer.tsx +116 -0
  29. package/src/MapsetLayer/index.tsx +1 -0
  30. package/src/MobilityMap/MobilityMap.tsx +27 -5
  31. package/src/MobilityMap/MobilityMapAttributes.test.ts +38 -0
  32. package/src/MobilityMap/MobilityMapAttributes.ts +99 -22
  33. package/src/MobilityMap/MobilityMapEvents.ts +53 -0
  34. package/src/MobilityNotifications/MobilityNotifications.tsx +93 -0
  35. package/src/MobilityNotifications/MobilityNotificationsAttributes.test.ts +21 -0
  36. package/src/MobilityNotifications/MobilityNotificationsAttributes.ts +46 -0
  37. package/src/MobilityNotifications/index.ts +2 -0
  38. package/src/MobilitySearch/MobilitySearchEvents.ts +21 -0
  39. package/src/NotificationDetails/NotificationDetails.tsx +74 -251
  40. package/src/OverlayContent/OverlayContent.tsx +1 -1
  41. package/src/OverlayDetails/OverlayDetails.tsx +4 -2
  42. package/src/OverlayFooter/OverlayFooter.tsx +3 -2
  43. package/src/RealtimeLayer/RealtimeLayer.tsx +36 -7
  44. package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -2
  45. package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +2 -2
  46. package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +2 -0
  47. package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +12 -453
  48. package/src/RvfFeatureDetails/RvfSellingPointDetails/RvfSellingPointDetails.tsx +20 -17
  49. package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +93 -36
  50. package/src/RvfLink/RvfLink.tsx +5 -2
  51. package/src/RvfMobilityMap/RvfMobilityMap.tsx +28 -11
  52. package/src/RvfSelectedFeatureHighlightLayer/RvfSelectedFeatureHighlightLayer.tsx +9 -5
  53. package/src/RvfSingleClickListener/RvfSingleClickListener.tsx +3 -1
  54. package/src/SituationDetails/SituationDetails.tsx +324 -0
  55. package/src/SituationDetails/index.ts +1 -0
  56. package/src/index.tsx +16 -0
  57. package/src/indexDoc.ts +25 -3
  58. package/src/ui/Checkbox/Checkbox.tsx +2 -2
  59. package/src/ui/Link/Link.tsx +49 -0
  60. package/src/ui/Link/index.tsx +1 -0
  61. package/src/ui/Select/Select.tsx +2 -2
  62. package/src/utils/constants.ts +37 -0
  63. package/src/utils/exportPdf.ts +3 -1
  64. package/src/utils/highlightLinesNetworkPlan.ts +25 -0
  65. package/src/utils/hooks/useI18n.tsx +6 -4
  66. package/src/utils/hooks/useInitialPermalink.tsx +9 -2
  67. package/src/utils/hooks/useMapContext.tsx +9 -0
  68. package/src/utils/sharingGraphqlUtils.ts +1 -1
  69. package/src/utils/translations.ts +12 -1
  70. package/tailwind.config.mjs +3 -1
  71. package/src/ShareMenu/PermalinkButton/PermalinkButton.tsx +0 -62
  72. package/src/ShareMenu/PermalinkButton/index.tsx +0 -1
  73. package/src/icons/Geolocation/airport-14-svgrepo-com.svg +0 -41
package/CHANGELOG.md CHANGED
@@ -2,6 +2,53 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.62](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.61...v0.1.62) (2025-10-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * add lines attribute ([#28](https://github.com/geops/rvf-mobility-web-component/issues/28)) ([3475b21](https://github.com/geops/rvf-mobility-web-component/commit/3475b2121f02997219821ea79fff71d289b37878))
11
+ * add lnp highlight and link component ([5cd87b6](https://github.com/geops/rvf-mobility-web-component/commit/5cd87b6f424f1440ffcc2c747e7ae6f89d1cfe0e))
12
+ * add new notifications list web component ([d782521](https://github.com/geops/rvf-mobility-web-component/commit/d7825217b90536cd281a57468fa83a498496bfd9))
13
+ * clear properly the state ([718dec6](https://github.com/geops/rvf-mobility-web-component/commit/718dec62f4db3ff6a9d03a6be6f5e03522c09a1d))
14
+ * **MapsetLayer:** add parameters to add a mapset layer ([35b9a67](https://github.com/geops/rvf-mobility-web-component/commit/35b9a67a2955099707db733170bee83521c0ecb1))
15
+ * **MapsetLayer:** add parameters to add a mapset layer ([0651c0e](https://github.com/geops/rvf-mobility-web-component/commit/0651c0e591a8460587dc8a127b4ff96c98a64a19))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add links and images ([b1402cb](https://github.com/geops/rvf-mobility-web-component/commit/b1402cba3923d425ffb6c1b63ea67ca5d3c9be4e))
21
+ * activate use of graph bbox parameter ([#25](https://github.com/geops/rvf-mobility-web-component/issues/25)) ([56960a1](https://github.com/geops/rvf-mobility-web-component/commit/56960a18c672e3ad7a7e76096222d4547a5d5ad2))
22
+ * add fonts of rvf ([7005f3b](https://github.com/geops/rvf-mobility-web-component/commit/7005f3b080a91aecdd258125160c1c414025ae22))
23
+ * add highlight lnp features ([93ed570](https://github.com/geops/rvf-mobility-web-component/commit/93ed5702733379c4059e45a63d23eb78fc11021a))
24
+ * add linksand fix dates display ([e0b1927](https://github.com/geops/rvf-mobility-web-component/commit/e0b1927b6d4abd2369a8c8c67f42f75db579c563))
25
+ * add missing html page ([75f7e1e](https://github.com/geops/rvf-mobility-web-component/commit/75f7e1e9f9ca9b75c0322d55d90e3f4a752d1d7c))
26
+ * add source-sans-3 ([2009840](https://github.com/geops/rvf-mobility-web-component/commit/20098404889fde0d463434de5b1b832a4ce70a3f))
27
+ * avoid empty array ([3732bbe](https://github.com/geops/rvf-mobility-web-component/commit/3732bbee22064135ef01866ea9870a0cf15f0fc3))
28
+ * avoid undefined layer comparaison ([60652b1](https://github.com/geops/rvf-mobility-web-component/commit/60652b196c3798e3a9fad049b6a9bade4ad31401))
29
+ * change notifications name ([93de3fd](https://github.com/geops/rvf-mobility-web-component/commit/93de3fd75682d86abcf64d137a1d3fd762336ba2))
30
+ * deactivate graphs ([24c96d0](https://github.com/geops/rvf-mobility-web-component/commit/24c96d0861c462508cc13e1c7f819059b9433ee7))
31
+ * fix click on features ([529b71c](https://github.com/geops/rvf-mobility-web-component/commit/529b71c799e6016b815cd2d1f3aeb6a36b3198b2))
32
+ * fix css ([6cec249](https://github.com/geops/rvf-mobility-web-component/commit/6cec249106447ba2095f1049edd0499e827f5d5f))
33
+ * fix highlight von mobility point ([4d7616c](https://github.com/geops/rvf-mobility-web-component/commit/4d7616c56dcbd4d759f626418bc7a20bf7b9c755))
34
+ * fix pointer events on menus ([f83ba3c](https://github.com/geops/rvf-mobility-web-component/commit/f83ba3c1674fa23515b68b4e6044623b5e902e41))
35
+ * fix pointer-events ([a81a1fc](https://github.com/geops/rvf-mobility-web-component/commit/a81a1fc18ae0b21238e726452f9a81488fecfaac))
36
+ * get more infos about station and cluster ([18cd22c](https://github.com/geops/rvf-mobility-web-component/commit/18cd22cdde580ba22c5a54a13d6644ae8a3ab497))
37
+ * load mor feature infos only when necessary ([1b7b4cb](https://github.com/geops/rvf-mobility-web-component/commit/1b7b4cb63fc9142ed873c9f3301e4fc05dd7396e))
38
+ * **MapsetLayer:** only fetch kmls if layer is visible ([d1272c0](https://github.com/geops/rvf-mobility-web-component/commit/d1272c054174ced5c6203d5e3ec43b6a1596bf82))
39
+ * **MapsetLayer:** reload plans on pan/zoom ([0a45a0c](https://github.com/geops/rvf-mobility-web-component/commit/0a45a0c93242450c9d5ec9d44ca7199f9f49dd9a))
40
+ * merge upstream and add tests for default values ([7cf94f1](https://github.com/geops/rvf-mobility-web-component/commit/7cf94f1d9a46d8d38a25bb1b4294bc0e530adcff))
41
+ * ordered the layer tree ([fbefac7](https://github.com/geops/rvf-mobility-web-component/commit/fbefac70df808b992f144b875e09a8d7ae8a6266))
42
+ * reduc copyright font size ([a0fa433](https://github.com/geops/rvf-mobility-web-component/commit/a0fa433d4c77786d26dbbdb446c5811a0ae004a8))
43
+ * reduc copyright font size ([8b3875c](https://github.com/geops/rvf-mobility-web-component/commit/8b3875c72c65251981dafb0293f6a61c2aabce67))
44
+ * use a fix layer order in layertree ([4a5fe10](https://github.com/geops/rvf-mobility-web-component/commit/4a5fe10f3dc8fb8bcb7d862b30199fb0a2634025))
45
+ * use good filter ([66840ef](https://github.com/geops/rvf-mobility-web-component/commit/66840efb733435dbc421fb7420d2761654b4d8e6))
46
+ * use proper filter ([ee26cb4](https://github.com/geops/rvf-mobility-web-component/commit/ee26cb46e785e279e51112f0361d0f54351b4fbb))
47
+ * use proper filter ([543d682](https://github.com/geops/rvf-mobility-web-component/commit/543d682436e42ea4b788b73b1634fe823b144d22))
48
+ * use proper template ([c5ea26b](https://github.com/geops/rvf-mobility-web-component/commit/c5ea26b7d0300fa26f24ace8ba146683bb471fa6))
49
+
50
+ ### [0.1.61](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.60...v0.1.61) (2025-10-07)
51
+
5
52
  ### [0.1.60](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.59...v0.1.60) (2025-10-07)
6
53
 
7
54
 
package/README.md CHANGED
@@ -19,6 +19,7 @@ Most components in RVF are mostly very generic and could be migrate to the main
19
19
  - [RVF design system](https://www.rvf.de/muster#c4523)
20
20
  - [Sketch file design system](https://www.sketch.com/s/71e4d120-f65f-4451-80c8-0a7e60e22265/p/22207D12-0F28-49D1-BCA4-1EDEF8B8BFE9/canvas)
21
21
  - [Sketch file design website](https://www.sketch.com/s/25c65997-d5d5-426f-b86c-a68c2de03524)
22
+ - [Adobe web project for fonts (user account in vault)](https://fonts.adobe.com/my_fonts#web_projects-section)
22
23
  - [VAG colors](https://www.vag-freiburg.de/fahrplan/linien-fahrplaene)
23
24
  - [Client test website](https://relaunch.rvf.de/geops-test)
24
25
  - [Netzplan on client production website](https://www.rvf.de/fahrtinfo/netzplan)
package/docutils.js CHANGED
@@ -1,4 +1,98 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
1
+ function onLoad(wc, attributes, events, pkgSrc) {
2
+ /* Show private attributes for dev purpose */
3
+ const showPrivate =
4
+ new URLSearchParams(window.location.search).get("private") === "true";
5
+
6
+ /* Attributes */
7
+ const attrs = Object.keys(attributes);
8
+ const booleanAttrs = Object.entries(attributes)
9
+ .filter(([, attr]) => attr.type === "boolean")
10
+ .map(([key]) => key);
11
+ const booleanTrueByDefault = booleanAttrs.filter(
12
+ (key) => attributes[key].defaultValue === "true",
13
+ );
14
+ const reloadAttrs = Object.entries(attributes)
15
+ .filter(([key, attr]) => !!attr.reload)
16
+ .map(([key]) => key);
17
+
18
+ const descriptionByAttr = Object.entries(attributes)
19
+ .filter(([key, attr]) => {
20
+ if (showPrivate) {
21
+ return true;
22
+ }
23
+ return attr.public;
24
+ })
25
+ .reduce((acc, [key, attr]) => {
26
+ acc[key] = attr.description;
27
+ return acc;
28
+ }, {});
29
+
30
+ const defaultValueByAttr = Object.entries(attributes).reduce(
31
+ (acc, [key, attr]) => {
32
+ acc[key] = attr.defaultValue;
33
+ return acc;
34
+ },
35
+ {},
36
+ );
37
+
38
+ /* Events */
39
+ const evts = Object.keys(events);
40
+ const descriptionByEvent = Object.entries(events)
41
+ .filter(([key, attr]) => {
42
+ if (showPrivate) {
43
+ return true;
44
+ }
45
+ return attr.public;
46
+ })
47
+ .reduce((acc, [key, attr]) => {
48
+ acc[key] = attr.description;
49
+ return acc;
50
+ }, {});
51
+
52
+ /* Build HTML */
53
+ const attrsContent = generateAttributesTable(
54
+ wc,
55
+ attrs,
56
+ booleanAttrs,
57
+ booleanTrueByDefault,
58
+ descriptionByAttr,
59
+ defaultValueByAttr,
60
+ reloadAttrs,
61
+ );
62
+ console.log(attrsContent);
63
+ if (attrsContent) {
64
+ document.querySelector("#attributes").innerHTML = attrsContent;
65
+ } else {
66
+ document.querySelector("#attributesDoc").remove();
67
+ }
68
+
69
+ const evtsContent = generateEventsTable(wc, evts, descriptionByEvent);
70
+ if (evtsContent) {
71
+ document.querySelector("#events").innerHTML = evtsContent;
72
+ } else {
73
+ document.querySelector("#eventsDoc").remove();
74
+ }
75
+
76
+ document.querySelector("#code").innerHTML = generateCodeText(
77
+ wc,
78
+ attrs,
79
+ pkgSrc,
80
+ );
81
+ wc.addEventListener("mwc:attribute", (event) => {
82
+ document.querySelector("#code").innerHTML = generateCodeText(
83
+ wc,
84
+ attrs,
85
+ pkgSrc,
86
+ );
87
+ });
88
+ applyPermalinkParameters(wc);
89
+ evts.forEach((eventName) => {
90
+ wc.addEventListener(eventName, (event) => {
91
+ console.log(`${eventName} event`, event);
92
+ });
93
+ });
94
+ }
95
+
2
96
  function applyPermalinkParameters(wc) {
3
97
  const params = new URLSearchParams(window.location.search);
4
98
 
@@ -68,6 +162,9 @@ function generateAttributesTable(
68
162
  defaultValueByAttr = {},
69
163
  reloadAttrs = [],
70
164
  ) {
165
+ if (!attrs.filter((key) => descriptionByAttr[key])?.length) {
166
+ return null;
167
+ }
71
168
  let innerHMTL = `<table class="table-auto w-full" >
72
169
  <thead>
73
170
  <tr>
@@ -112,8 +209,7 @@ function generateAttributesTable(
112
209
  type="text"
113
210
  class="border"
114
211
  name="${key}"
115
- value="${wc.getAttribute(key) || ""}"
116
- placeholder="${defaultValueByAttr[key] || ""}"
212
+ value="${wc.getAttribute(key) || defaultValueByAttr[key] || ""}"
117
213
  />
118
214
  <button class="border p-2 bg-black hover:bg-gray-700 text-white" onclick="document.querySelector('${wc.localName}').setAttribute('${key}', this.previousElementSibling.value);onAttributeUpdate(document.querySelector('${wc.localName}'),this.previousElementSibling.name, this.previousElementSibling.value, '${reloadAttrs.join(",")}');">Update</button>`
119
215
  }
@@ -139,7 +235,7 @@ function generateCodeText(
139
235
  let codeText = "";
140
236
  codeText = `&lt;script\n\ttype="module"\n\tsrc="${pkgSrc}"&gt;
141
237
  &lt;/script&gt;
142
- &lt;${wc.localName}\n\tid="map"\n\tstyle="display:block;width:100%;height:500px;border:1px solid #e5e7eb;border-radius:16px;"`;
238
+ &lt;${wc.localName}${wc.id ? '\n\tid="' + wc.id + '"' : ""}\n\tstyle="display:block;width:100%;height:500px;border:1px solid #e5e7eb;border-radius:16px;"`;
143
239
 
144
240
  attrs.forEach((key) => {
145
241
  const attributeValue = wc.getAttribute(key);
@@ -166,6 +262,9 @@ function generateCodeText(
166
262
 
167
263
  // Generates a HTML table with all events of a web component
168
264
  function generateEventsTable(wc, events, descriptionByEvent = {}) {
265
+ if (!events?.length) {
266
+ return null;
267
+ }
169
268
  let innerHMTL = `<table class="table-auto w-full" >
170
269
  <thead>
171
270
  <tr>
package/index.html CHANGED
@@ -37,6 +37,8 @@
37
37
  class="absolute inset-0 flex h-full w-full table-auto gap-4 flex-col border bg-black p-0 px-4 py-2 pt-2 text-white hover:bg-gray-700"
38
38
  style="display: none"
39
39
  ></div>
40
+ </script>
41
+ <!-- <button onclick="document.getElementById('map').setAttribute('center', '877430.64,6118377.18');document.getElementById('map').setAttribute('zoom','17.02');">Center and zoom to Denzligen</button> -->
40
42
  <div class="pt-2" style="display: none"></div>
41
43
  <div id="doc" style="display: none" class="mx-auto max-w-3xl space-y-4">
42
44
  <h1 class="flex gap-4"><img src="./Logo.svg">Mobility Web Component</h1>
@@ -48,27 +50,32 @@
48
50
  ></pre>
49
51
 
50
52
  <geops-mobility
51
- class="block h-128 w-full resize overflow-hidden rounded-2xl border"
53
+ id="map"
54
+ class="block h-128 w-full resize overflow-hidden rounded-[16px] border"
52
55
  ></geops-mobility>
53
56
 
54
57
  <br />
55
- <h2 class="text-xl font-bold">Attributes</h2>
56
- <div id="attributes"></div>
57
- <h2 class="text-xl font-bold">Events</h2>
58
- <pre id="code" class="rounded bg-slate-800 p-4 text-slate-200">
58
+ <div id="attributesDoc">
59
+ <h2 class="text-xl font-bold">Attributes</h2>
60
+ <div id="attributes"></div>
61
+ </div>
62
+ <div id="eventsDoc">
63
+ <h2 class="text-xl font-bold">Events</h2>
64
+ <pre class="rounded bg-slate-800 p-4 text-slate-200">
59
65
  document.getElementById('map').addEventListener('mwc:attribute', (event) => {
60
66
  console.log('Display last data received:', event.data);
61
67
  });</pre
62
- >
63
- <div id="events"></div>
68
+ >
69
+ <div id="events"></div>
70
+ </div>
64
71
  <br />
65
72
  <br />
66
- <!--h1 class="text-xl font-bold">More mobility web components</h1>
73
+ <h1 class="text-xl font-bold">More mobility web components</h1>
67
74
  <p>
68
- <a href="search.html" target="_blank"
69
- >&gt;&gt; Usage example Search Component</a
75
+ <a href="notifications.html" target="_blank"
76
+ >&gt;&gt; Usage example Notifications Web Component</a
70
77
  >
71
- </p> -->
78
+ </p>
72
79
  </div>
73
80
  <br />
74
81
  <br />
@@ -77,101 +84,28 @@ document.getElementById('map').addEventListener('mwc:attribute', (event) => {
77
84
  const wc = document.querySelector("geops-mobility");
78
85
 
79
86
  window.addEventListener("load", () => {
87
+ const attributes = window.MobilityMapAttributes;
88
+ const events = window.MobilityMapEvents;
80
89
 
81
- // Add special parameters
82
- window.MobilityMapAttributes.fullscreen = {
90
+ // Add page parameters
91
+ attributes.fullscreen = {
83
92
  type: "boolean",
84
93
  defaultValue: "false",
85
94
  description: `Load the page in fullscreen mode.`,
86
95
  reload: true,
96
+ public: false,
87
97
  };
88
98
 
89
- window.MobilityMapAttributes.debug = {
99
+ attributes.debug = {
90
100
  type: "boolean",
91
101
  defaultValue: "false",
92
- description: "Displays debug information for vehicles when true, use only for debugging.",
102
+ description:
103
+ "Displays debug information for vehicles when true, use only for debugging.",
93
104
  reload: true,
105
+ public: false,
94
106
  };
95
107
 
96
- /* Attributes */
97
- const attrs = Object.keys(MobilityMapAttributes);
98
- const booleanAttrs = Object.entries(MobilityMapAttributes)
99
- .filter(([, attr]) => attr.type === "boolean")
100
- .map(([key]) => key);
101
- const booleanTrueByDefault = booleanAttrs.filter(
102
- (key) => MobilityMapAttributes[key].defaultValue === "true",
103
- );
104
- const reloadAttrs = Object.entries(MobilityMapAttributes)
105
- .filter(([key, attr]) => !!attr.reload)
106
- .map(([key]) => key);
107
-
108
- const descriptionByAttr = Object.entries(MobilityMapAttributes).reduce((acc, [key, attr]) => {
109
- acc[key] = attr.description;
110
- return acc;
111
- }, {});
112
-
113
- const defaultValueByAttr = Object.entries(MobilityMapAttributes).reduce((acc, [key, attr]) => {
114
- acc[key] = attr.defaultValue;
115
- return acc;
116
- }, {});
117
-
118
- /* Events */
119
- const events = [
120
- "mwc:selectedfeature",
121
- // "mwc:stopssearchselect",
122
- // "mwc:attribute",
123
- // "mwc:singleclick",
124
- // "mwc:permalink",
125
- // "mwc:messageready",
126
- ];
127
- const descriptionByEvent = {
128
- "mwc:selectedfeature":
129
- "Event fired when a feature is selected on the map. The event data contains the selected feature in GeoJSON format.",
130
- "mwc:stopssearchselect":
131
- "Only when search attribute is 'true'. Event fired when a stop is selected in the stops search results. The event data contains the selected stop.",
132
- "mwc:attribute":
133
- "Event fired when an web component's attribute is changed. The event data contains the list of all attributes and their values.",
134
- "mwc:permalink":
135
- "Event fired when the map's state changes. The event data contains the permalink URL search parameters as string.",
136
- "mwc:messageready":
137
- "Only if the web-component is embedded in an iframe. Message event fired when the web component is ready to receive messages from parent window. ",
138
- "mwc:singleclick":
139
- "Event fired when the map is clicked. The event data contains the map coordinates in EPSG:3857 and the pixel coordinates.",
140
- };
141
-
142
- document.querySelector("#attributes").innerHTML =
143
- generateAttributesTable(
144
- wc,
145
- attrs,
146
- booleanAttrs,
147
- booleanTrueByDefault,
148
- descriptionByAttr,
149
- defaultValueByAttr,
150
- reloadAttrs,
151
- );
152
- document.querySelector("#events").innerHTML = generateEventsTable(
153
- wc,
154
- events,
155
- descriptionByEvent,
156
- );
157
- document.querySelector("#code").innerHTML = generateCodeText(
158
- wc,
159
- attrs,
160
- pkgSrc,
161
- );
162
- wc.addEventListener("mwc:attribute", (event) => {
163
- document.querySelector("#code").innerHTML = generateCodeText(
164
- wc,
165
- attrs,
166
- pkgSrc,
167
- );
168
- });
169
- applyPermalinkParameters(wc);
170
- events.forEach((eventName) => {
171
- wc.addEventListener(eventName, (event) => {
172
- console.log(`${eventName} event`, event);
173
- });
174
- });
108
+ onLoad(wc, attributes, events, pkgSrc);
175
109
  });
176
110
  </script>
177
111
  </body>