L.Wrld.map.routes
Methods
map.routes.getRoute(viaPoints, onLoadHandler)
var _onRoutesLoaded = function(routes) {
// ... use the returned route options
};
var _onRoutesError = function(err) {
console.log(err);
};
// Get routes between the two provided points
map.routes.getRoute(
[
[-2.9786788,56.4602727, 2], // start point (indoors on 2nd level)
[-2.9783117,56.4600344], // end point (outside)
],
_onRoutesLoaded,
_onRoutesError
);
Get route options between the supplied indoor and/or outdoor points asynchronously, returning the results to the provided callback.
Argument | Type | Description |
---|---|---|
viaPoints | [lon, lat, <level>] | An array of [lon, lat] pairs specifying the coordinates the route should pass through, in the order they should be visited. A level can optionally be specified to indicate an indoor waypoint. This level parameter should match the level index of the indoor map floor that contains the waypoint. |
onLoadHandler | callback | A callback taking an array of returned routes, as arrays of [lon, lat]. This is only called if no errors occurred. |
onErrorHandler | callback | An optional callback taking some error JSON. This is only called if no routes could be acquired. |
v0.1.1335
- L.Wrld.themes
- Event objects
- WrldPoiApi
- L.Map
- L.Marker
- L.Popup
- L.TileLayer
- L.TileLayer.WMS
- L.TileLayer.Canvas
- L.ImageOverlay
- L.Path
- L.Polyline
- L.MultiPolyline
- L.Polygon
- L.MultiPolygon
- L.Rectangle
- L.Circle
- L.CircleMarker
- L.LayerGroup
- L.FeatureGroup
- L.GeoJson
- L.LatLng
- L.LatLngBounds
- L.Point
- L.Bounds
- L.Icon
- L.DivIcon
- L.Control
- L.Control.zoom
- L.Control.Attribution
- L.Control.Layers
- L.Control.Scale
- Events methods
- Event objects
- L.Class
- L.Browser
- L.Util
- L.Transformation
- L.LineUtil
- L.PolyUtil
- L.DomEvent
- L.DomUtil
- L.PosAnimation
- L.Draggable
- L.IHandler
- L.ILayer
- L.IControl
- L.IProjection
- L.ICRS
- Global Switches
- L.noConflict
- L.version
Themes
Events
Services (Optional)
Leaflet
Themes
L.Wrld.themes
Events
Event objects
Services (Optional)
WrldPoiApi
Leaflet
L.Map
L.Marker
L.Popup
L.TileLayer
L.TileLayer.WMS
L.TileLayer.Canvas
L.ImageOverlay
L.Path
L.Polyline
L.MultiPolyline
L.Polygon
L.MultiPolygon
L.Rectangle
L.Circle
L.CircleMarker
L.LayerGroup
L.FeatureGroup
L.GeoJson
L.LatLng
L.LatLngBounds
L.Point
L.Bounds
L.Icon
L.DivIcon
L.Control
L.Control.zoom
L.Control.Attribution
L.Control.Layers
L.Control.Scale
Events methods
Event objects
L.Class
L.Browser
L.Util
L.Transformation
L.LineUtil
L.PolyUtil
L.DomEvent
L.DomUtil
L.PosAnimation
L.Draggable
L.IHandler
L.ILayer
L.IControl
L.IProjection
L.ICRS
Global Switches
L.noConflict
L.version