widgets/implementations/map/map-widget.component.ts
OnInit
OnChanges
OnDestroy
AfterViewInit
DynamicComponent
selector | c8y-map-widget |
standalone | true |
imports |
MapEventInfoComponent
NgCommonModule
NgFormsModule
CommonModule
FormsModule
IconSelectorModule
MapModule
AssetLinkPipe
TooltipModule
RouterLink
|
templateUrl | ./map-widget.component.html |
Properties |
Methods |
Inputs |
constructor(dashboardChild: DashboardChildComponent, dashboardContextComponent: ContextDashboardComponent, inventory: InventoryService)
|
||||||||||||
Parameters :
|
config |
Type : MapWidgetConfig
|
ngAfterViewInit |
ngAfterViewInit()
|
Returns :
void
|
ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
Parameters :
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
startFollow | ||||
startFollow(context)
|
||||
Parameters :
Returns :
void
|
stopFollow |
stopFollow()
|
Returns :
void
|
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>