Skip to content

Commit

Permalink
Get popup text dynamically so that content is up-to-date with all loa…
Browse files Browse the repository at this point in the history
…ded data
  • Loading branch information
rogup committed Jun 4, 2024
1 parent 6340e77 commit 4312469
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/map-app/app/view/map/marker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 4312469

Please sign in to comment.