-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hard failure on google maps error (#2184)
* Fixes a bug where if Google Maps failed to embed, the entire site would hard-fail * Move the embedGoogleMaps.ts helper scripts into a DI service * Lazy load google maps to only embed when we need it for the current page (improving performance) * Asyncronously embed google maps (embedding google maps is no longer a blocking operating, improving performance and reducing the scope for bugs) * Adds loading spinner when Google maps is loading * Adds failure state when Google maps fails to load * Re-enables map component tests Fixes: #2175
- Loading branch information
1 parent
90f66c3
commit d65f6a0
Showing
25 changed files
with
520 additions
and
269 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@if (hasMarkers && googleMapsLoaded === true) { | ||
<google-map | ||
height="100%" | ||
width="100%" | ||
[options]="mapOptions" | ||
(mapClick)="markerOptions?.draggable && newLocation.emit($event)" | ||
> | ||
<map-marker | ||
#markerRef="mapMarker" | ||
*ngFor="let individualMarkerOptions of validMarkersOptions" | ||
[options]="markerOptions" | ||
[position]="individualMarkerOptions.position" | ||
(mapDragend)="newLocation.emit($event)" | ||
(mapMouseover)="addMapMarkerInfo(individualMarkerOptions, markerRef)" | ||
(positionChanged)="focusMarkers()" | ||
(markerInitialized)="focusMarkers()" | ||
></map-marker> | ||
<map-info-window>{{ infoContent }}</map-info-window> | ||
</google-map> | ||
} @else { | ||
<div class="map-placeholder"> | ||
@if (googleMapsLoaded === false) { | ||
<p class="text-danger">Failure loading map</p> | ||
<p class="error-hint"> | ||
Please ensure your ad-block is not blocking Google Maps | ||
</p> | ||
} @else if (googleMapsLoaded === null) { | ||
<baw-loading></baw-loading> | ||
} @else if (!hasMarkers) { | ||
<p>No locations specified</p> | ||
} | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
.map-placeholder { | ||
border: 1px solid black; | ||
display: flex; | ||
height: 100%; | ||
min-height: 400px; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
border: 1px solid black; | ||
height: 100%; | ||
min-height: 400px; | ||
} | ||
|
||
.error-hint { | ||
text-align: center; | ||
} |
Oops, something went wrong.