Move routing API endpoint addresses to config file

This commit is contained in:
Tom Hughes 2016-01-11 19:03:47 +00:00
parent 409e99c6fc
commit e128e78408
5 changed files with 26 additions and 22 deletions

View file

@ -21,7 +21,7 @@ function GraphHopperEngine(id, vehicleType) {
// GraphHopper Directions API documentation
// https://github.com/graphhopper/directions-api/blob/master/docs-routing.md
return $.ajax({
url: document.location.protocol + "//graphhopper.com/api/1/route",
url: document.location.protocol + OSM.GRAPHHOPPER_URL,
data: {
vehicle: vehicleType,
locale: I18n.currentLocale(),

View file

@ -36,7 +36,7 @@ function MapQuestEngine(id, routeType) {
var to = points[points.length - 1];
return $.ajax({
url: document.location.protocol + "//open.mapquestapi.com/directions/v2/route",
url: document.location.protocol + OSM.MAPQUEST_DIRECTIONS_URL,
data: {
key: OSM.MAPQUEST_KEY,
from: from.lat + "," + from.lng,

View file

@ -39,7 +39,7 @@ function MapzenEngine(id, costing) {
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({

View file

@ -51,7 +51,7 @@ function OSRMEngine() {
}
return $.ajax({
url: document.location.protocol + "//router.project-osrm.org/viaroute",
url: document.location.protocol + OSM.OSRM_URL,
data: params,
dataType: "json",
success: function (data) {