File

sub-assets/location/asset-location.component.ts

Implements

OnInit OnChanges OnDestroy

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(activatedRouter: ActivatedRoute, mapService: MapService)
Parameters :
Name Type Optional
activatedRouter ActivatedRoute No
mapService MapService No

Inputs

form
Type : FormGroup
isEdit
Type : boolean
locationMO
Type : IManagedObject

Methods

checkIfAnyValueIsMissing
checkIfAnyValueIsMissing(latitude: number, longitude: number)

Checks if any one of the values i.e., latitude/longitude is undefined or null.

Parameters :
Name Type Optional Description
latitude number No

Latitude value of the position

longitude number No

Longitude value of the position

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 :
Name Type Optional
changes SimpleChanges No
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 :
Name Type Optional
event L.LeafletMouseEvent No
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 :
Name Type Optional
event L.LeafletEvent No
Returns : void
setLatLngValues
setLatLngValues(latitude: number, longitude: number)
Parameters :
Name Type Optional
latitude number No
longitude number No
setView
setView(latitude: number, longitude: number)

Sets the view of the map based on the position of marker.

Parameters :
Name Type Optional Description
latitude number No
  • Latitude of the marker
longitude number No

Longitude of the marker

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 :
Name Type Optional Description
latitude number No
  • The latitude of the marker
longitude number No
  • The longitude of the marker
Returns : void

Properties

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>

results matching ""

    No results matching ""