API Docs for: 2.2
Show:

MQ.Routing.Ribbon Class

Extends L.LayerGroup

Constructor

MQ.Routing.Ribbon

(
  • options
)

Parameters:

  • options Object
    • [draggable] Boolean default = true
    • [selectTime] Number default = 1000

      number of ms to tap & hold a route ribbon before firing the selected event

    • [dragMarker] Object optional
      • [weight] Number default = 1
      • [color] String default = "#000000"
      • [fill] Boolean default = true
      • [fillColor] String default = "#ffffff"
      • [opacity] Number default = 0.9
      • [fillOpacity] Number default = 0.9

Methods

_clearCancelInterval

() private

_onDrag

(
  • event
)
private

Parameters:

_onDragEnd

(
  • event
)
private

Parameters:

_onDragStart

(
  • event
)
private

Parameters:

_onMarkerMouseOut

(
  • event
)
private

Parameters:

_onMarkerMouseOver

(
  • event
)
private

Parameters:

_onPathMouseMove

(
  • event
)
private

Parameters:

_onPathMouseOut

(
  • event
)
private

Parameters:

_onPathMouseOver

(
  • event
)
private

Parameters:

_onTouchMove

(
  • event
)
private

Parameters:

bringToBack

()

When there are multiple route ribbons on the map, this method will draw this ribbon on bottom.

bringToFront

()

When there are multiple route ribbons on the map, this method will draw this ribbon on top.

closestLayerPoint

(
  • p
)
L.Point

Find the closest point on this route ribbon to the provided point

Parameters:

  • p L.Point

Returns <L.Point>

copyOrigRoute

() protected

getBounds

() L.Bounds

Get the bounds of the currently drawn ribbon. NOTE that the api optimizes ribbons to only draw on visible map, so this may not be the entire ribbon available, see getBounds of RouteLayer for entire route

Returns <L.Bounds>

hideDragMarker

()

Hide the drag marker.

initialize

(
  • options
)
protected

Parameters:

onAdd

(
  • map
)
protected

Parameters:

  • map L.Map

onRemove

(
  • map
)
protected

Parameters:

  • map L.Map

setHoverDisplay

(
  • opts
)

Parameters:

setHoverMessage

(
  • str
)

Parameters:

setLatLngs

(
  • latLngs
)

Parameters:

setPathStyle

(
  • options
)

Parameters:

setVisible

(
  • shouldBeVisible
)

Parameters:

Events

drag

Event Payload:

dragEnd

Event Payload:

dragStart

Event Payload:

selected

For mobile, this event is fired after tapping & holding the route ribbon for selectTime ms

Event Payload: