Ranks points relative to a reference point in terms of routing. This answers such questions as “What point is closest if I am driving but don’t want to use toll roads?”.
{
points[]: {EMS.RankedPoint} // An array of results in order of "closest"
}| EMS. | Ranks points relative to a reference point in terms of routing. |
| Constructor | |
| EMS. | |
| Functions | |
| rank | |
| normalize | Turns a javascript query into one that can be used directly against the server. |
rank: function( query, callback )
var query = {
"start": {lon: 144.6534, lat: -36.5534},
"points":[{lon: 144.6424, lat: -37.5531}, {lon: 144.3383, lat: -36.3344}],
"method": EMS.RouteMethod.FASTEST,
"mode": EMS.RouteMode.FOOT,
"tolls": false
}
var service = new EMS.Service.Rank();
service.rank(query, function(response, status) {
if (status == EMS.Status.OK) {
// Success
} else {
// Failure
alert(response.message);
}
});| query | {Object} is a request object which must have at least an attribute “reference” and “points”, an non empty array. |
| callback | {Function} is the callback function. |
normalize: function( query )
Turns a javascript query into one that can be used directly against the server. This creates a new object with only the necessary attributes that the server requires, ensuring that rubbish is stripped off.
| query | {Object} is the query object to normalize. |
{Object} Returns a normalized query which can be sent directly to the server.
rank: function( query, callback )
Turns a javascript query into one that can be used directly against the server.
normalize: function( query )