From 3e1122d34dcc5111a4c56d76113b2fbcb9c351c4 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Wed, 23 Feb 2022 23:22:51 +0000 Subject: [PATCH] Use overviewer hovertext as marker tooltip --- src/providers/OverviewerMapProvider.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/providers/OverviewerMapProvider.ts b/src/providers/OverviewerMapProvider.ts index b86ea2b..c006363 100644 --- a/src/providers/OverviewerMapProvider.ts +++ b/src/providers/OverviewerMapProvider.ts @@ -247,7 +247,7 @@ export default class OverviewerMapProvider extends MapProvider { (markers[set.groupName]?.raw || []).forEach((marker: any, index: number) => { const id = `marker_${index}`; - setContents.set(id, OverviewerMapProvider.buildMarker(id, marker, set.icon)); + setContents.set(id, OverviewerMapProvider.buildMarker(id, marker, set)); }); this.mapMarkers.get(map)!.set(set.groupName, setContents); @@ -255,11 +255,12 @@ export default class OverviewerMapProvider extends MapProvider { } } - private static buildMarker(id: string, data: any, defaultIcon: string): LiveAtlasMarker { + private static buildMarker(id: string, data: any, markerSet: any): LiveAtlasMarker { const marker: any = { id, - title: stripHTML(data.hovertext.trim()), - popup: data.text, + tooltip: stripHTML(data.hovertext.trim()), + tooltipHTML: data.hovertext.trim(), + popup: markerSet.createInfoWindow ? data.text : undefined, isPopupHTML: true, } @@ -275,7 +276,7 @@ export default class OverviewerMapProvider extends MapProvider { } else { marker.type = LiveAtlasMarkerType.POINT; marker.location = {x: data.x, y: data.y, z: data.z}; - marker.icon = data.icon || defaultIcon; + marker.icon = data.icon || markerSet.icon; } return marker as LiveAtlasMarker;