sub-assets/location/asset-location.component.ts
OnInit
OnChanges
OnDestroy
selector | c8y-asset-location |
templateUrl | ./asset-location.component.html |
Properties |
Methods |
Inputs |
constructor(activatedRouter: ActivatedRoute, mapService: MapService)
|
|||||||||
Parameters :
|
form |
Type : FormGroup
|
isEdit |
Type : boolean
|
locationMO |
Type : IManagedObject
|
checkIfAnyValueIsMissing | ||||||||||||
checkIfAnyValueIsMissing(latitude: number, longitude: number)
|
||||||||||||
Checks if any one of the values i.e., latitude/longitude is undefined or null.
Parameters :
Returns :
boolean
returns true if any one of the values are both the values are missing else it returns false. |
enableFullscreen |
enableFullscreen()
|
Used to enable full screen of the map.
Returns :
void
|
ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
Parameters :
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
onClickOfMap | ||||||
onClickOfMap(event: L.LeafletMouseEvent)
|
||||||
This command is used to prefill the latitude and longitude values in the form on click of map.
Parameters :
Returns :
void
|
onMarkerDrag | ||||||
onMarkerDrag(event: L.LeafletEvent)
|
||||||
This command is used to prefill the latitude and longitude values in the form when the marker is dragged.
Parameters :
Returns :
void
|
setLatLngValues |
setLatLngValues(latitude: number, longitude: number)
|
setView | ||||||||||||
setView(latitude: number, longitude: number)
|
||||||||||||
Sets the view of the map based on the position of marker.
Parameters :
Returns :
void
|
updateMarker | ||||||||||||
updateMarker(latitude: number, longitude: number)
|
||||||||||||
This method is used to update the marker with the specified values and if any one of the values is not availble, sets showWarning to true.
Parameters :
Returns :
void
|
assets |
Type : PositionManagedObject
|
config |
Type : MapConfig
|
Default value : {
center: defaultMapConfig.center,
zoomLevel: 13,
color: 'green',
icon: 'c8y-icon-location'
}
|
dragListener |
Type : L.LeafletEventHandlerFn
|
formSubscription |
Type : Subscription
|
isMapClickable |
Default value : false
|
isMarkerDraggable |
Default value : false
|
mapView |
Type : MapComponent
|
Decorators :
@ViewChild(MapComponent)
|
showMap |
Default value : true
|
<div [hidden]="!showMap">
<div class="row">
<button
class="btn btn-link pull-right"
style="margin-right: 12px"
title="Full screen"
type="button"
data-cy="asset-location-full-screen"
(click)="enableFullscreen()"
>
<i c8yIcon="expand"></i>
</button>
</div>
<div style="width: 100%; height: 400px">
<c8y-map
#map
[assets]="assets"
[config]="config"
></c8y-map>
</div>
</div>