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

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])

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 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 the code that uniquely identifies the feature.

feature.getPoint()

Returns the latitude/longitude position of the feature.

feature.getNotes()

Returns an array of notes attached to the feature.

feature.getPhotos()

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 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 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

wallBlob

wallSegment

zone

zonedIcon

Type Methods

Type methods are available on only some features. See Types.

feature.getDiagram()

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 of the feature.

feature.getIconTypes()

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 the diagram sign ref.

feature.getRotation()

Returns the diagram sign rotation.

feature.getRoomLabel()

Returns the room label.

feature.getZoneName()

Returns the zone name. Only meaningful if feature.getZoneType() returns identified.

feature.getZoneCategory()

Returns the zone category. Only meaningful if feature.getZoneType() returns identified.

feature.getZoneColor()

Returns the zone color (CSS color type). Only meaningful if feature.getZoneType() returns identified.

feature.getZoneType()

Returns the zone type, which must be one of the folllowing:

  • private
  • interior
  • common
  • tenanted
  • otherTenanted
  • identified
  • presentation

feature.isFireRated()

Returns true if the feature is Fire Rated.

feature.isSmokeRated()

Returns true if the feature is Smoke Rated.