Skip to content
David Emory edited this page Feb 12, 2015 · 6 revisions

API

.setElement(element, legendElement)

Sets/updates the main container DOM element, and (optionally), a separate element for the legend.

.render()

Creates and renders the transitive network for the currently loaded Transitive data object.

.renderTo(element)

Sets the container element and renders the network in a single call.

.refresh()

Redraws a rendered network, e.g. on a pan/zoom action (calls render() first if network has not been rendered).

.clearData()

Clears the current Transitive data object.

.updateData(data)

Updates the current Transitive data object.

.focusJourney(journeyId)

Highlights a specific journey (i.e. an individual path through the network) using the journey's id as defined in the Transitive data object.

.getModeStyles(mode)

Returns an object containing the display's current SVG styling for a given mode, as defined by an OTP mode identifier ("WALK", "BUS", etc.)

.setDisplayBounds(llBounds)

Sets the lon/lat bounding box for the display, expressed as [ [west, south], [east, north] ]

.getNetworkBounds()

Returns the lon/lat bounding box for the currently loaded network, expressed as [ [west, south], [east, north] ]

.resize(width, height)

Updates the dimensions of the display in pixels

Clone this wiki locally