eegeo.js

L.eeGeo.map.routes

Methods

map.routes.getRoute([startPoint, endPoint], onLoadHandler)

var _onRoutesLoaded = function(routes) {
        // ... use the returned route options
    };

// 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    
    );

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].
v0.1.780