adt-js-components 1.10.8 → 1.10.9
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 +1 -1
- package/src/Map/index.js +12 -5
package/package.json
CHANGED
package/src/Map/index.js
CHANGED
|
@@ -396,16 +396,23 @@ function checkAndApplyPreselection(map, markers, showSelectionOrder, onSelection
|
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
|
|
399
|
-
function applyPreselectedMarkersVisualOnly(map, markersData) {
|
|
399
|
+
async function applyPreselectedMarkersVisualOnly(map, markersData) {
|
|
400
400
|
const markerMap = markerInstances.get(map);
|
|
401
|
+
const settings = routeSettingsMap.get(map);
|
|
401
402
|
const preselected = markersData.filter(m => m.selected === true);
|
|
402
403
|
|
|
403
|
-
|
|
404
|
+
for (const markerData of preselected) {
|
|
404
405
|
const markerInstance = markerMap.get(markerData.id);
|
|
405
406
|
if (markerInstance && markerInstance._selectedIcon) {
|
|
406
|
-
|
|
407
|
+
if (settings && settings.color) {
|
|
408
|
+
const iconUrl = markerInstance._selectedIcon.options.iconUrl;
|
|
409
|
+
const newIcon = await createMarkerIcon(map, iconUrl, null);
|
|
410
|
+
markerInstance.setIcon(newIcon);
|
|
411
|
+
} else {
|
|
412
|
+
markerInstance.setIcon(markerInstance._selectedIcon);
|
|
413
|
+
}
|
|
407
414
|
}
|
|
408
|
-
}
|
|
415
|
+
}
|
|
409
416
|
}
|
|
410
417
|
|
|
411
418
|
function createMarker(marker, options, selectedOptions, cluster = null, selectable = false, onSelectionChange = null, map = null, showSelectionOrder = false, markerInfoCallback = null) {
|
|
@@ -570,7 +577,7 @@ async function updateMarkerOrderDisplay(map, marker, orderNumber, isSelected, co
|
|
|
570
577
|
async function createMarkerIcon(map, iconUrl, orderNumber, color = null) {
|
|
571
578
|
let inlineStyle = null;
|
|
572
579
|
const settings = routeSettingsMap.get(map);
|
|
573
|
-
if ((settings && settings.
|
|
580
|
+
if ((settings && settings.color) || color) {
|
|
574
581
|
inlineStyle = `--marker-fill: ${color ?? settings.color};`;
|
|
575
582
|
}
|
|
576
583
|
|