Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Providers/Maps/Google/Marker/MarkerPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace Provider.Maps.Google.Marker {
export class MarkerPopup extends Marker implements OSFramework.Maps.Marker.IMarkerPopup {
private _contentString: string;
private _contentString: string = '';

protected _setMarkerEvents(): void {
super._setMarkerEvents();

// Open the popup when the user clicks on the Marker
// To close the Marker click on it and then use the ESC or the "x" on the top right corner of the popup
// Or use the API method - closePopup()
this._provider.addListener('click', () => {
this._provider.addListener(Constants.Marker.ProviderEventNames.click, () => {
this.refreshPopupContent();
Comment thread
rugoncalves marked this conversation as resolved.
this.openPopup();
});
Comment thread
rugoncalves marked this conversation as resolved.
Expand All @@ -36,9 +36,10 @@ namespace Provider.Maps.Google.Marker {
}

public refreshPopupContent(): void {
this._contentString = OSFramework.Maps.Helper.GetElementByUniqueId(this.uniqueId).querySelector(
OSFramework.Maps.Helper.Constants.markerPopup
).innerHTML;
this._contentString =
OSFramework.Maps.Helper.GetElementByUniqueId(this.uniqueId)?.querySelector(
Comment thread
rugoncalves marked this conversation as resolved.
OSFramework.Maps.Helper.Constants.markerPopup
)?.innerHTML ?? '';
this.map.features.infoWindow.setPopupContent(this._contentString);
}
}
Expand Down
Loading