@maplat/ui 0.11.6 → 0.11.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maplat/ui",
3
- "version": "0.11.6",
3
+ "version": "0.11.8",
4
4
  "description": "Maplat is the cool Historical Map/Illustrated Map Viewer.\nIt can transform each map coordinates with nonlinear but homeomorphic projection and makes possible that the maps can collaborate with GPS/accurate maps, without distorting original maps.",
5
5
  "type": "module",
6
6
  "main": "dist/maplat-ui.umd.js",
package/src/ui_init.ts CHANGED
@@ -974,8 +974,12 @@ function initModalHandlers(ui: MaplatUi, appOption: MaplatAppOption) {
974
974
  const fileName = (val as string)
975
975
  .toLowerCase()
976
976
  .replace(/ /g, "_");
977
+
978
+ const iconUrl =
979
+ pointer[`${fileName}.png`] ||
980
+ `assets/parts/${fileName}.png`;
977
981
  (contentEl as HTMLElement).innerHTML =
978
- `<img src="assets/parts/${fileName}.png" class="license" />`;
982
+ `<img src="${iconUrl}" class="license" />`;
979
983
  } else {
980
984
  (contentEl as HTMLElement).innerHTML =
981
985
  ui.core!.translate(val) || "";
package/src/ui_marker.ts CHANGED
@@ -76,10 +76,14 @@ export function poiWebControl(
76
76
  } else {
77
77
  const slides: string[] = [];
78
78
  const mediaList = (data.media || data.image) as MediaSetting[] | undefined;
79
-
80
- if (mediaList) {
81
- const inputs = Array.isArray(mediaList) ? mediaList : [mediaList];
82
-
79
+ const inputs = mediaList
80
+ ? Array.isArray(mediaList)
81
+ ? mediaList
82
+ : [mediaList]
83
+ : [];
84
+ let swiperStr = "";
85
+
86
+ if (inputs.length > 0) {
83
87
  inputs.forEach((item: MediaSetting) => {
84
88
  let mediaObj: MediaObject;
85
89
  if (typeof item === "string") {
@@ -127,13 +131,15 @@ export function poiWebControl(
127
131
 
128
132
  slides.push(`<cc-swiper-slide ${slideAttrs}></cc-swiper-slide>`);
129
133
  });
134
+
135
+ swiperStr = ` <div class="col-xs-12 poi_img_swiper">
136
+ <cc-swiper>${slides.join("")}</cc-swiper>
137
+ </div>`;
130
138
  }
131
139
  // Logic for noimage skipped/simplified as requested in previous interactions
132
140
 
133
141
  const htmlDiv = createElement(`<div class="poi_data">
134
- <div class="col-xs-12 poi_img_swiper">
135
- <cc-swiper>${slides.join("")}</cc-swiper>
136
- </div>
142
+ ${swiperStr}
137
143
  <p class="recipient poi_address"></p>
138
144
  <p class="recipient poi_desc"></p>
139
145
  </div>`)[0] as HTMLElement;