-
Notifications
You must be signed in to change notification settings - Fork 67
API Documentation
Creates a new Transitive instance. Options include:
-
data
(Object) - the Transitive data object to render (see example) -
styles
(Object) - styles to apply (see example) -
el
(Element) - the DOM element to render the main display to -
legendEl
(Element) - the DOM element to render the legend to -
drawGrid
(Boolean) - whether to draw a background grid (defaults to false) -
gridCellSize
(Number) - resolution of the grid in Spherical Mercator meters -
draggableTypes
(Array) - a list of network element types to enable dragging for -
initialBounds
(Array) - initial lon/lat bounds for the display expressed as[[west, south], [east, north]]
-
displayMargins
(Object) - padding to apply to the initial rendered network within the display. Expressed in pixels for top/bottom/left/right -
mapboxId
(String) - an Mapbox tileset id for rendering background tiles (Deprecated -- use Leaflet with Leaflet.TransitiveLayer) -
zoomEnabled
(Boolean) - whether to enable the display's built-in zoom/pan functionality (defaults to true) -
autoResize
(Boolean) - whether the display should listen for window resize events and update automatically (defaults to true) -
zoomFactors
(Object Array) - detailed control over zoom-sensitive rendering. See full documentation.
Sets/updates the main container DOM element, and (optionally), a separate element for the legend.
Updates the current Renderer used to draw the network. Current supported types are 'default' (the standard network renderer) and 'wireframe' (draws a simplified representation of the graph edges and vertices, useful for testing/debugging).
Creates and renders the transitive network for the currently loaded Transitive data object.
Sets the container element and renders the network in a single call.
Redraws a rendered network, e.g. on a pan/zoom action (calls render() first if network has not been rendered).
Clears the current Transitive data object.
Updates the current Transitive data object.
Highlights a specific journey (i.e. an individual path through the network) using the journey's id as defined in the Transitive data object.
Returns an object containing the display's current SVG styling for a given mode, as defined by an OTP mode identifier ("WALK", "BUS", etc.)
Sets the lon/lat bounding box for the display, expressed as [ [west, south], [east, north] ]
Returns the lon/lat bounding box for the currently loaded network, expressed as [ [west, south], [east, north] ]
Updates the dimensions of the display in pixels