From 4312469c273b6d8fd8aa3a173d700f1877f3643a Mon Sep 17 00:00:00 2001 From: rogup Date: Tue, 4 Jun 2024 13:43:14 +0100 Subject: [PATCH] Get popup text dynamically so that content is up-to-date with all loaded data --- src/map-app/app/view/map/marker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map-app/app/view/map/marker.ts b/src/map-app/app/view/map/marker.ts index 7108f7a6..3d730d07 100644 --- a/src/map-app/app/view/map/marker.ts +++ b/src/map-app/app/view/map/marker.ts @@ -22,7 +22,7 @@ export class MapMarkerView extends BaseView { // options argument overrides our default options: const opts = Object.assign(this.dfltOptions, { // icon: this.presenter.getIcon(initiative), - popuptext: this.presenter.getInitiativeContent(initiative) + getPopupText: () => this.presenter.getInitiativeContent(initiative) }); // For non-geo initiatives we don't need a marker but still want to get the initiativeContent @@ -47,7 +47,7 @@ export class MapMarkerView extends BaseView { initiative.__internal.marker = this.marker; - this.marker.bindPopup(opts.popuptext, { + this.marker.bindPopup(opts.getPopupText, { autoPan: false, minWidth: 472, maxWidth: 472, @@ -83,7 +83,7 @@ export class MapMarkerView extends BaseView { // maxWidth helps to accomodate big font, for presentation purpose, set up in CSS // maxWidth:800 is needed if the font-size is set to 200% in CSS: - this.marker.bindPopup(opts.popuptext, { + this.marker.bindPopup(opts.getPopupText, { autoPan: false, //minWidth: "472", //maxWidth: "800",