Don't show http-only routers to users on https

This commit is contained in:
Richard Fairhurst 2014-03-10 18:02:28 +00:00
parent 9d8ab7dbd1
commit 23ffdadb56
4 changed files with 11 additions and 8 deletions

View file

@ -18,7 +18,10 @@ var ROUTING_POLYLINE_HIGHLIGHT={
OSM.RoutingEngines={ OSM.RoutingEngines={
list: [] list: [],
add: function(supportsHTTPS,engine) {
if (document.location.protocol=="http:" || supportsHTTPS) this.list.push(engine);
}
}; };
OSM.Routing=function(map,name,jqSearch) { OSM.Routing=function(map,name,jqSearch) {

View file

@ -59,5 +59,5 @@ GraphHopperEngine.prototype.createConfig = function() {
}; };
}; };
OSM.RoutingEngines.list.push(new GraphHopperEngine("Bicycle", "vehicle=bike").createConfig()); OSM.RoutingEngines.add(false, new GraphHopperEngine("Bicycle", "vehicle=bike").createConfig());
OSM.RoutingEngines.list.push(new GraphHopperEngine("Foot", "vehicle=foot").createConfig()); OSM.RoutingEngines.add(false, new GraphHopperEngine("Foot", "vehicle=foot").createConfig());

View file

@ -40,7 +40,7 @@ MapQuestEngine.prototype.createConfig = function() {
18: 1 // straight fork 18: 1 // straight fork
}, },
getRoute: function(isFinal,points) { getRoute: function(isFinal,points) {
var url="http://open.mapquestapi.com/directions/v2/route?key=Fmjtd%7Cluur290anu%2Crl%3Do5-908a0y"; var url=document.location.protocol+"//open.mapquestapi.com/directions/v2/route?key=Fmjtd%7Cluur290anu%2Crl%3Do5-908a0y";
var from=points[0]; var to=points[points.length-1]; var from=points[0]; var to=points[points.length-1];
url+="&from="+from.join(','); url+="&from="+from.join(',');
url+="&to="+to.join(','); url+="&to="+to.join(',');
@ -88,7 +88,7 @@ MapQuestEngine.prototype.createConfig = function() {
}; };
}; };
OSM.RoutingEngines.list.push(new MapQuestEngine("Bicycle", "routeType=bicycle").createConfig()); OSM.RoutingEngines.add(true, new MapQuestEngine("Bicycle", "routeType=bicycle").createConfig());
OSM.RoutingEngines.list.push(new MapQuestEngine("Foot", "routeType=pedestrian").createConfig()); OSM.RoutingEngines.add(true, new MapQuestEngine("Foot", "routeType=pedestrian").createConfig());
OSM.RoutingEngines.list.push(new MapQuestEngine("Car", "routeType=fastest").createConfig()); OSM.RoutingEngines.add(true, new MapQuestEngine("Car", "routeType=fastest").createConfig());
// can be: routeType=fastest|shortest|pedestrian|multimodal|bicycle // can be: routeType=fastest|shortest|pedestrian|multimodal|bicycle

View file

@ -57,4 +57,4 @@ OSRMEngine.prototype.createConfig = function() {
}; };
}; };
OSM.RoutingEngines.list.push(new OSRMEngine("Car", "http://router.project-osrm.org/viaroute").createConfig()); OSM.RoutingEngines.add(false, new OSRMEngine("Car", "http://router.project-osrm.org/viaroute").createConfig());