function MapzenEngine(id, costing) {
var MZ_INSTR_MAP = [
- 1, // kNone = 0;
- 14, // kStart = 1;
- 14, // kStartRight = 2;
- 14, // kStartLeft = 3;
- 15, // kDestination = 4;
- 15, // kDestinationRight = 5;
- 15, // kDestinationLeft = 6;
- 1, // kBecomes = 7;
- 1, // kContinue = 8;
- 2, // kSlightRight = 9;
- 3, // kRight = 10;
- 4, // kSharpRight = 11;
- 5, // kUturnRight = 12;
- 5, // kUturnLeft = 13;
- 6, // kSharpLeft = 14;
- 7, // kLeft = 15;
- 8, // kSlightLeft = 16;
- 1, // kRampStraight = 17;
- 2, // kRampRight = 18;
- 8, // kRampLeft = 19;
- 2, // kExitRight = 20;
- 8, // kExitLeft = 21;
- 1, // kStayStraight = 22;
- 2, // kStayRight = 23;
- 8, // kStayLeft = 24;
- 1, // kMerge = 25;
- 11, // kRoundaboutEnter = 26;
- 12, // kRoundaboutExit = 27;
- 1, // kFerryEnter = 28;
- 1 // kFerryExit = 29;
+ 0, // kNone = 0;
+ 8, // kStart = 1;
+ 8, // kStartRight = 2;
+ 8, // kStartLeft = 3;
+ 14, // kDestination = 4;
+ 14, // kDestinationRight = 5;
+ 14, // kDestinationLeft = 6;
+ 0, // kBecomes = 7;
+ 0, // kContinue = 8;
+ 1, // kSlightRight = 9;
+ 2, // kRight = 10;
+ 3, // kSharpRight = 11;
+ 4, // kUturnRight = 12;
+ 4, // kUturnLeft = 13;
+ 7, // kSharpLeft = 14;
+ 6, // kLeft = 15;
+ 5, // kSlightLeft = 16;
+ 0, // kRampStraight = 17;
+ 24, // kRampRight = 18;
+ 25, // kRampLeft = 19;
+ 24, // kExitRight = 20;
+ 25, // kExitLeft = 21;
+ 0, // kStayStraight = 22;
+ 1, // kStayRight = 23;
+ 5, // kStayLeft = 24;
+ 20, // kMerge = 25;
+ 10, // kRoundaboutEnter = 26;
+ 11, // kRoundaboutExit = 27;
+ 17, // kFerryEnter = 28;
+ 0 // kFerryExit = 29;
];
return {
getRoute: function (points, callback) {
return $.ajax({
- url: document.location.protocol + "//valhalla.mapzen.com/route",
+ url: document.location.protocol + OSM.MAPZEN_VALHALLA_URL,
data: {
api_key: OSM.MAPZEN_VALHALLA_KEY,
json: JSON.stringify({
} else {
callback(true);
}
+ },
+ error: function () {
+ callback(true);
}
});
}