Feature
Feature instances are generated by the Viewer and Plan when calling methods that return features.
You cannot directly create feature instances, and you cannot modify any of their properties.
- Adding Features
- Base Methods
- Types
- Type Methods
feature.getDiagram()
feature.getFraming([loadedPlan])
feature.getGeoJSON()
feature.getIconTypes()
feature.getIconData(iconType)
feature.getSignRef()
feature.getRotation()
feature.getRoomLabel()
feature.getZoneName()
feature.getZoneCategory()
feature.getZoneColor()
feature.getZoneType()
feature.isFireRated()
feature.isSmokeRated()
Adding Features
Adds features to the plan.
Features added with this API are not immediately reflected in viewers; consider using viewer.reloadPlan() to have the changes reflect in the viewer.
The format of the feature
property is the same as documented for the ESAPI Push Features endpoint.
locatrix.plans.pushFeatures(viewerToken, features[, options])
viewerToken
: <string>features
: <Object[]>options
: <Object>- Returns: <Promise<void>>
Adds features to the plan.
planCode
must be provided if viewerToken
doesn’t contain its own Plan Code.
Base Methods
These methods are available on all features.
feature.getType()
- Returns: <string>
Returns the type of feature, which must be one of the following:
assemblyArea
evacSign
exitSign
foldingDoor
hingedDoor
rollerDoor
slidingDoorway
fixedIcon
leaderLineIcon
room
wallSegment
wallBlob
zone
zonedIcon
feature.getCode()
- Returns: <string>
Returns the code that uniquely identifies the feature.
feature.getPoint()
Returns the latitude/longitude position of the feature.
feature.getNotes()
- Returns: <Object[]>
text
: <string>
Returns an array of notes attached to the feature.
feature.getPhotos()
- Returns: <Promise<Object[]>>
imageUrl
: <string>
Returns a promise that will resolve to an array of photos attached to the feature.
The imageUrl
property includes authentication parameters that will be valid for 45 minutes from first load of the viewer, and from then onwards guaranteed to be valid for at least 10 minutes at any given time getPhotos()
is called.
The promise will reject if there are network errors when authentication parameters are being refreshed.
feature.getDocuments()
- Returns: <Object[]>
Returns an array of documents attached to the feature. The documentUrl
can be used to access the document for as long as the viewer token is valid. Do not store this URL remotely as it may change in future versions of the SDK.
feature.getData()
- Returns: <Object[]>
Returns an array of objects describing custom data attached to the feature.
To get data about icons, please use the feature.getIconData() method.
Types
Additional methods are available on features of certain types (checked via feature.getType()).
evacSign
foldingDoor
hingedDoor
rollerDoor
slidingDoorway
fixedIcon
leaderLineIcon
room
- feature.getRoomLabel()
- feature.getGeoJSON()
- Returns Geometry of type
Polygon
- Returns Geometry of type
wallBlob
wallSegment
zone
- feature.getGeoJSON()
- Returns Geometry of type
Polygon
- Returns Geometry of type
- feature.getZoneName()
- feature.getZoneCategory()
- feature.getZoneColor()
- feature.getZoneType()
zonedIcon
- feature.getGeoJSON()
- Returns Geometry of type
Polygon
- Returns Geometry of type
- feature.getIconTypes()
- feature.getIconData()
Type Methods
Type methods are available on only some features. See Types.
feature.getDiagram()
- Returns: <Promise<Diagram>> | <Promise<null>>
Returns a promise for a Diagram
.
If the diagram hasn’t been published in PlanStudio null
will be returned.
feature.getFraming([loadedPlan])
Returns Framing
objects from plan areas in the diagram. If loadedPlan
is not provided, the floor plan Framing is returned. If the site plan has been loaded in a separate viewer, its plan can be passed to get its Framing from the diagram.
If the Framing of the diagram wasn’t locked in PlanStudio null
will be returned.
feature.getGeoJSON()
- Returns: <GeoJSON Feature Object>
Returns GeoJSON of the feature.
feature.getIconTypes()
- Returns: <string[]>
Returns an array of all icon types contained within this feature.
feature.getIconData(iconType)
Returns an array of objects describing custom data for the given iconType
.
If the iconType
is not present in the feature or the IconLibrary, null
will be returned.
feature.getSignRef()
- Returns: <string>
Returns the diagram sign ref.
feature.getRotation()
- Returns: <number>
Returns the diagram sign rotation.
feature.getRoomLabel()
- Returns: <string>
Returns the room label.
feature.getZoneName()
- Returns: <string>
Returns the zone name. Only meaningful if feature.getZoneType() returns identified
.
feature.getZoneCategory()
- Returns: <string>
Returns the zone category. Only meaningful if feature.getZoneType() returns identified
.
feature.getZoneColor()
- Returns: <string>
Returns the zone color (CSS color type). Only meaningful if feature.getZoneType() returns identified
.
feature.getZoneType()
- Returns: <string>
Returns the zone type, which must be one of the folllowing:
private
interior
common
tenanted
otherTenanted
identified
presentation
feature.isFireRated()
- Returns: <boolean>
Returns true if the feature is Fire Rated.
feature.isSmokeRated()
- Returns: <boolean>
Returns true if the feature is Smoke Rated.