File

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

Implements

OnInit OnChanges OnDestroy AfterViewInit DynamicComponent

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(dashboardChild: DashboardChildComponent, dashboardContextComponent: ContextDashboardComponent, inventory: InventoryService)
Parameters :
Name Type Optional
dashboardChild DashboardChildComponent No
dashboardContextComponent ContextDashboardComponent No
inventory InventoryService No

Inputs

config
Type : MapWidgetConfig

Methods

ngAfterViewInit
ngAfterViewInit()
Returns : void
ngOnChanges
ngOnChanges(changes: SimpleChanges)
Parameters :
Name Type Optional
changes SimpleChanges No
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
Async ngOnInit
ngOnInit()
Returns : any
startFollow
startFollow(context)
Parameters :
Name Optional
context No
Returns : void
stopFollow
stopFollow()
Returns : void

Properties

alerts
Type : DynamicComponentAlertAggregator
clusterMap
Type : ClusterMapComponent
Decorators :
@ViewChild(ClusterMapComponent)
mapConfig
Type : ClusterMapConfig
Default value : { center: [0, 0] }
rootNode
Type : IManagedObject
<c8y-map-status
  [clusterMap]="mapWidget"
  [(config)]="mapConfig"
  (onUnfollow)="stopFollow()"
  [buttonsConfig]="config.widgetInstanceGlobalTimeContext ? { realtime: { show: false } } : null"
></c8y-map-status>
<c8y-cluster-map
  #mapWidget
  [rootNode]="rootNode"
  [config]="mapConfig"
>
  <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 ""