Skip to content

Commit 8399265

Browse files
Extended Component Library Teamcopybara-github
authored andcommitted
fix: hide route in Store Locator component when origin/dest is unknown
PiperOrigin-RevId: 609124340
1 parent fe71165 commit 8399265

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/store_locator/store_locator.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,15 @@ export class StoreLocator extends BaseComponent {
528528
}
529529

530530
private renderMapDirections() {
531-
if (this.featureSet === FeatureSet.ADVANCED) {
531+
const originLatLng = this.searchLocation?.location;
532+
const destinationLatLng = this.selectedListing?.position;
533+
if (this.featureSet === FeatureSet.ADVANCED && originLatLng &&
534+
destinationLatLng) {
532535
// clang-format off
533536
return html`
534537
<gmpx-route-overview no-pin
535-
.originLatLng=${this.searchLocation?.location}
536-
.destinationLatLng=${this.selectedListing?.position}>
538+
.originLatLng=${originLatLng}
539+
.destinationLatLng=${destinationLatLng}>
537540
</gmpx-route-overview>`;
538541
// clang-format on
539542
}

0 commit comments

Comments
 (0)