Location

A Location represents one of the waypoints of a Trip as rendered on the map. Locations can be made draggable to allow users to re-route a trip interactively.

map.nav().directions(waypoints, function (error, trip) {
  // Make the trip's locations draggable:
  trip.locations().draggable(true).cursor("grab");
});

Location.point()

Get the position of the Location in map space.

Returns

An [x, y] coordinates Array.

Location.floorId()

Get the id of the Floor the Location is on.

Returns

A String.

Location.properties()

Get any user-defined properties associated with the Location, sourced from the waypoint that produced it.

Returns

An object.

Location.draggable([value])

Enable or disable dragging of the Location when a value is provided. Otherwise returns the current draggable state.

// Enable dragging:
location.draggable(true);

// Read the current state:
console.log(location.draggable());

Arguments

ArgumentRequiredTypeDefault ValueDescription
valueNoBooleanundefinedWhether the Location may be dragged.

Returns

Either the current draggable Boolean or the object chain.

Location.locator()

Get the Locator used to render the Location on the map.

Returns

A new Locator instance.