Location

The "Location" class, part of the "pw" package, allows for creating, updating, destroying, manipulating, and retrieving information about various locations, including its name, coordinates (latitude, longitude, altitude), address, associated assets, and additional notes.

Logical Diagram

Attributes

  • name:string - Name of the Location
  • lat:number - Latitude of the Location
  • long:number - Longitude of the Location
  • alt:number - Altitude of the Location
  • address:string - Address of the Location
  • notes:string - Address of the Location

Associations

Name Cardinality Class Composition Owner Description
assets n Asset false true  

Users of the Model

Name Cardinality Class Composition Owner Description
location 1 PhysicalAsset false false  

Methods

Method Details

Action location addAsset

  • REST - location/addAsset?locationName=string&asset=Asset object
  • bin - location addAsset –locationName string –asset Asset object
  • js - location.addAsset({ locationName:string,asset:Asset object })

Description

To add an asset to the location

Parameters

Name Type Required Description
locationName string   Name of the location
asset Asset object   The asset to be added to the location

Action location getCoordinates

  • REST - location/getCoordinates?name=string
  • bin - location getCoordinates –name string
  • js - location.getCoordinates({ name:string })

Description

To get the latitude and longitude of the location

Parameters

Name Type Required Description
name string   Name of the location

Action location getLocationDetails

  • REST - location/getLocationDetails?name=string
  • bin - location getLocationDetails –name string
  • js - location.getLocationDetails({ name:string })

Description

To get all the details of a location

Parameters

Name Type Required Description
name string   Name of the location

Action location removeAsset

  • REST - location/removeAsset?locationName=string&asset=Asset object
  • bin - location removeAsset –locationName string –asset Asset object
  • js - location.removeAsset({ locationName:string,asset:Asset object })

Description

To remove an asset from the location

Parameters

Name Type Required Description
locationName string   Name of the location
asset Asset object   The asset to be removed from the location

Action location setCoordinates

  • REST - location/setCoordinates?name=string&lat=number&long=number
  • bin - location setCoordinates –name string –lat number –long number
  • js - location.setCoordinates({ name:string,lat:number,long:number })

Description

To set the latitude and longitude of the location

Parameters

Name Type Required Description
name string   Name of the location
lat number   New latitude of the location
long number   New longitude of the location