File

widgets/implementations/map/map-widget.component.ts

Implements

OnInit OnDestroy AfterViewInit DynamicComponent

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(dashboardChild: DashboardChildComponent, dashboardContextComponent: ContextDashboardComponent, inventory: InventoryService, mapService: MapService, widgetsDashboardComponent: WidgetsDashboardComponent, dynamicComponentService: DynamicComponentService, widgetConfigMigrationService: WidgetConfigMigrationService)
Parameters :
Name Type Optional
dashboardChild DashboardChildComponent No
dashboardContextComponent ContextDashboardComponent No
inventory InventoryService No
mapService MapService No
widgetsDashboardComponent WidgetsDashboardComponent No
dynamicComponentService DynamicComponentService No
widgetConfigMigrationService WidgetConfigMigrationService No

Inputs

config
Type : MapWidgetConfig

Methods

Async fitToBounds
fitToBounds()
Returns : any
ngAfterViewInit
ngAfterViewInit()
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
Async ngOnInit
ngOnInit()
Returns : any
Async onGlobalContext
onGlobalContext(event: unknown)
Parameters :
Name Type Optional
event unknown No
Returns : any
startFollow
startFollow(context: unknown)
Parameters :
Name Type Optional
context unknown No
Returns : void
stopFollow
stopFollow()
Returns : void

Properties

alerts
Type : DynamicComponentAlertAggregator
assets
Type : PositionManagedObject[]
clusterMap
Type : ClusterMapComponent
Decorators :
@ViewChild(ClusterMapComponent)
controls
Type : WidgetControls
mapConfig
Type : ClusterMapConfig
Default value : { center: [0, 0] }
rootNode
Type : IIdentified
@if (mapConfig) {
  <c8y-map-status
    [clusterMap]="mapWidget"
    [(config)]="mapConfig"
    (onUnfollow)="stopFollow()"
    (fitAssetsToBounds)="fitToBounds()"
    [assets]="assets"
    [buttonsConfig]="{
      autoRefresh: { show: false },
      refresh: { show: false },
      realtime: { show: false },
      fitToBounds: { show: true }
    }"
  >
    <c8y-global-context-widget-wrapper
      *ngIf="controls"
      [widgetControls]="controls"
      [config]="config"
      [isLoading]="mapWidget.isLoading$ | async"
      (globalContextChange)="onGlobalContext($event)"
    ></c8y-global-context-widget-wrapper>
  </c8y-map-status>

  <c8y-cluster-map
    #mapWidget
    [rootNode]="rootNode"
    [config]="mapConfig"
    [asset]="assets"
  >
    <div
      class="map-marker"
      *c8yMapPopup="let context"
    >
      <a
        class="text-truncate deviceLink text-12"
        routerLink="{{ context | assetLink }}"
      >
        <strong>{{ context.name }}</strong>
      </a>
      <c8y-map-event-info [asset]="context">
        <button
          class="btn btn-default btn-xs btn-block m-t-8"
          [title]="'Activate realtime on this asset and follow it if it moves' | translate"
          type="button"
          (click)="startFollow(context)"
          *ngIf="!mapConfig.follow"
          translate
        >
          Follow
        </button>
        <button
          class="btn btn-default btn-xs btn-block m-t-8"
          [title]="'Stop following this asset.' | translate"
          type="button"
          (click)="stopFollow()"
          *ngIf="mapConfig.follow"
          translate
        >
          Unfollow
        </button>
      </c8y-map-event-info>
    </div>
  </c8y-cluster-map>
}

results matching ""

    No results matching ""