Skip to content

Commit

Permalink
Use the new InfoWindow API
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed May 30, 2024
1 parent c8b459b commit 8692971
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/fxc-front/src/app/components/2d/airspace-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class AirspaceElement extends connect(store)(LitElement) {
this.overlays.push(new AspZoomMapType(this.maxAltitude, common.MAX_AIRSPACE_TILE_ZOOM, zoom));
}
this.setOverlaysZoom();
this.info = new google.maps.InfoWindow({ disableAutoPan: true });
this.info = new google.maps.InfoWindow({ disableAutoPan: true, headerDisabled: false, headerContent: 'Airspaces' });
this.info.close();
}

Expand Down
5 changes: 3 additions & 2 deletions apps/fxc-front/src/app/components/2d/tracking-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class TrackingElement extends connect(store)(LitElement) {
}

private setupInfoWindow(map: google.maps.Map): void {
this.info = new google.maps.InfoWindow();
this.info = new google.maps.InfoWindow({ headerDisabled: false });
this.info.close();
this.info.addListener('closeclick', () => {
store.dispatch(setCurrentLiveId(undefined));
Expand Down Expand Up @@ -181,7 +181,8 @@ export class TrackingElement extends connect(store)(LitElement) {
}

if (this.info) {
this.info.setContent(`<strong>${popup.title}</strong><br>${popup.content}`);
this.info.setContent(`${popup.content}`);
(this.info as any).setHeaderContent(popup.title);
this.info.setPosition(event.latLng);
this.info.open(map);
store.dispatch(setCurrentLiveId(pilotId));
Expand Down

0 comments on commit 8692971

Please sign in to comment.