-
Notifications
You must be signed in to change notification settings - Fork 58
Call with:
$('#myMaps').wayfinding();
The initialize call needs an object with at least 'maps'
, 'defaultMap'
, and startpoint
set in order to be useful. Technically these have defaults, but unless you map is named floorplan.svg
and your defaultMap name is map.1
and your startpoint is startpoint
you are going to need to provide some configuration.
an array of objects with path
and id
. The path, including filename, is the URI for the the svg file to use for either the floor or region. The id is used to change floors and as a part of the identifier for portals to indicate which other map the portal binds to.
'maps': [
{'path': 'demo_map_1.svg', 'id': 'floor1'},
{'path': 'demo_map_2.svg', 'id': 'floor2'}
],
If not supplied with default to:
'path': {
color: 'red',
radius: 10,
speed: 8,
width: 3
},
-
color
is any valid CSS color including #ff00ff notation. -
radius
is the turn radius in SVG integer units to use when smoothing the solution path for drawing it -
speed
controls the rate at which the solution path is animated to the screen -
width
controls the width of the solution path in pixels, but it may be scaled.
either a string or a function that will return the identifier of the point to start the routing from
Both
'startpoint': 'lcd.1',
and
'startpoint': function () {
return 'lcd.1';
},
are valid.
either a string or a function that will return the identifier of the destination. Formatting is similar to startpoint.
a Boolean that defaults to false; which will allow the route returned to take stairs
either a string or a function to return the id of the map that should be displayed by default. Formatting is similar to startpoint.
The string to display in the target div while waiting for the maps to load.
Sets the behavior for the use of dataStores.
- Defaults to null, which does not use datastores.
- An object if the datastore is being passed in.
- A string representing the base path from which datastores will be loaded.
Boolean. If set to true map pins will be shown for the startpoint and endpoint.
Styling for the map pins if displayed:
{
fill: 'red',
height: 40
}
Boolean that causes the map to be zoomed in to show just the region of travel.
integer
the function that will find the shortest route and display it
$('#myMaps').wayfinding('routeTo', 'destinationId');
If there is an existing solution it will redraw the solution.
$('#myMaps').wayfinding('startpoint', 'startingId');
$('#myMaps').wayfinding('currentMap', 'targetMapId');
to change to using accessible routes and avoiding stairs
$('#myMaps').wayfinding('accessibleRoute', true);
will return a representation of the parsed collection of all loaded maps
$('#myMaps').wayfinding('getDataStore');