Skip to content

Commit

Permalink
fix: hide route in Store Locator component when origin/dest is unknown
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 609124340
  • Loading branch information
Extended Component Library Team authored and copybara-github committed Feb 21, 2024
1 parent fe71165 commit 8399265
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/store_locator/store_locator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,15 @@ export class StoreLocator extends BaseComponent {
}

private renderMapDirections() {
if (this.featureSet === FeatureSet.ADVANCED) {
const originLatLng = this.searchLocation?.location;
const destinationLatLng = this.selectedListing?.position;
if (this.featureSet === FeatureSet.ADVANCED && originLatLng &&
destinationLatLng) {
// clang-format off
return html`
<gmpx-route-overview no-pin
.originLatLng=${this.searchLocation?.location}
.destinationLatLng=${this.selectedListing?.position}>
.originLatLng=${originLatLng}
.destinationLatLng=${destinationLatLng}>
</gmpx-route-overview>`;
// clang-format on
}
Expand Down

0 comments on commit 8399265

Please sign in to comment.