Remove unneeded platform checks

This commit is contained in:
Yury Bondarenko
2025-06-12 17:53:09 +02:00
parent c147354ee1
commit 6c3bbf617c
5 changed files with 16 additions and 15 deletions

View File

@@ -1,6 +1,5 @@
<div class="container">
<h1>{{ 'browse.metadata.map' | translate }}</h1>
@if (isPlatformBrowser(platformId)) {
@defer {
<ds-geospatial-map [facetValues]="facetValues$"
[currentScope]="this.scope$|async"
@@ -8,6 +7,5 @@
style="width: 100%;">
</ds-geospatial-map>
}
}
</div>

View File

@@ -6,9 +6,7 @@ import {
import {
ChangeDetectionStrategy,
Component,
Inject,
OnInit,
PLATFORM_ID,
} from '@angular/core';
import {
ActivatedRoute,
@@ -67,7 +65,6 @@ export class BrowseByGeospatialDataComponent implements OnInit {
public facetValues$: Observable<FacetValues> = of(null);
constructor(
@Inject(PLATFORM_ID) public platformId: string,
private searchConfigurationService: SearchConfigurationService,
private searchService: SearchService,
protected route: ActivatedRoute,

View File

@@ -37,6 +37,8 @@ import { GeospatialMapDetail } from './models/geospatial-map-detail.model';
* Component to draw points and polygons on a tiled map using leaflet.js
* This component can be used by item page fields, the browse-by geospatial component, and the geospatial search
* view mode to render related places of an item (e.g. metadata on a page), or items *as* places (e.g. browse / search)
*
* This component should be used in a `@defer` block to keep geospatial mapping libraries out of the main bundle!
*/
export class GeospatialMapComponent implements AfterViewInit, OnInit, OnDestroy {

View File

@@ -1,3 +1,5 @@
@if (isPlatformBrowser(platformId)) {
<ds-geospatial-map [mapInfo]="mapInfo"></ds-geospatial-map>
}
<!--
Note: ds-object-geospatial-map itself should be rendered in a @defer block, so we don't need one here.
https://angular.dev/guide/templates/defer#avoid-cascading-loads-with-nested-defer-blocks
-->
<ds-geospatial-map [mapInfo]="mapInfo"></ds-geospatial-map>

View File

@@ -41,7 +41,9 @@ import { parseGeoJsonFromMetadataValue } from '../utils/geospatial.functions';
/**
* This component is used with the GeospatialMap ViewMode in search or browse results, and
* prepares geospatial data collection for display on the GeospatialMapComponent
* prepares geospatial data collection for display on the GeospatialMapComponent.
*
* This component should be used in a `@defer` block to keep geospatial mapping libraries out of the main bundle!
*/
export class ObjectGeospatialMapComponent {