Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: yehudab/OpenTripPlanner
...
head fork: yehudab/OpenTripPlanner
Checking mergeability… Don't worry, you can still create the pull request.
  • 8 commits
  • 8 files changed
  • 0 commit comments
  • 2 contributors
View
5 opentripplanner-api-webapp/src/main/java/org/opentripplanner/api/common/RoutingResource.java
@@ -212,7 +212,10 @@ protected RoutingRequest buildRequest(int n) throws ParameterException {
boolean tripPlannedForNow = Math.abs(request.getDateTime().getTime() - new Date().getTime())
< NOW_THRESHOLD_MILLIS;
request.setUseBikeRentalAvailabilityInformation(tripPlannedForNow);
- if (intermediatePlaces != null && (request.getModes().isTransit() || request.getModes().getWalk() && request.getModes().getBicycle()))
+ if (request.getIntermediatePlaces() != null
+ && (request.getModes().isTransit() ||
+ (request.getModes().getWalk() &&
+ request.getModes().getBicycle())))
throw new UnsupportedOperationException("TSP is not supported for transit or bike share trips");
return request;
}
View
2  opentripplanner-api-webapp/src/test/java/org/opentripplanner/api/ws/TestRequest.java
@@ -210,7 +210,7 @@ public TestPlanner(String v1, String v2, List<String> intermediates) {
this(v1, v2);
this.intermediatePlaces = intermediates;
TravelingSalesmanPathService tsp = new TravelingSalesmanPathService();
- tsp.chainedPathService = Context.getInstance().pathService;
+ tsp.setChainedPathService(Context.getInstance().pathService);
tsp.graphService = Context.getInstance().graphService;
this.planGenerator.pathService = tsp;
}
View
2  opentripplanner-graph-builder/src/main/java/org/opentripplanner/graph_builder/model/GtfsBundle.java
@@ -40,7 +40,7 @@
private CsvInputSource csvInputSource;
- private Boolean defaultBikesAllowed = false;
+ private Boolean defaultBikesAllowed = true;
private boolean transfersTxtDefinesStationPaths = false;
View
22 opentripplanner-routing/src/main/java/org/opentripplanner/routing/impl/RetryingPathServiceImpl.java
@@ -14,33 +14,20 @@
package org.opentripplanner.routing.impl;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
-import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import org.onebusaway.gtfs.model.AgencyAndId;
-import org.opentripplanner.common.model.NamedPlace;
-import org.opentripplanner.routing.core.RoutingContext;
-import org.opentripplanner.routing.core.State;
-import org.opentripplanner.routing.core.StateEditor;
-import org.opentripplanner.routing.core.TraverseMode;
import org.opentripplanner.routing.core.RoutingRequest;
-import org.opentripplanner.routing.error.TransitTimesException;
-import org.opentripplanner.routing.error.VertexNotFoundException;
-import org.opentripplanner.routing.graph.Vertex;
import org.opentripplanner.routing.pathparser.BasicPathParser;
import org.opentripplanner.routing.pathparser.PathParser;
import org.opentripplanner.routing.services.GraphService;
import org.opentripplanner.routing.services.PathService;
-import org.opentripplanner.routing.services.RemainingWeightHeuristicFactory;
-import org.opentripplanner.routing.services.RoutingService;
import org.opentripplanner.routing.services.SPTService;
import org.opentripplanner.routing.spt.GraphPath;
import org.opentripplanner.routing.spt.ShortestPathTree;
-import org.opentripplanner.util.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -102,15 +89,6 @@ public void setMultiPathTimeout (double seconds) {
Queue<RoutingRequest> optionQueue = new LinkedList<RoutingRequest>();
optionQueue.add(options);
- /* if the user wants to travel by transit, create a bus-only set of options */
- if (options.getModes().getTrainish() && options.getModes().contains(TraverseMode.BUS)) {
- RoutingRequest busOnly = options.clone();
- busOnly.setModes(options.getModes().clone());
- busOnly.getModes().setTrainish(false);
- // Moved inside block to avoid double insertion in list ? (AMB)
- // optionQueue.add(busOnly);
- }
-
double maxWeight = Double.MAX_VALUE;
double maxWalk = options.getMaxWalkDistance();
long maxTime = options.isArriveBy() ? 0 : Long.MAX_VALUE;
View
11 opentripplanner-routing/src/main/java/org/opentripplanner/routing/impl/TravelingSalesmanPathService.java
@@ -44,7 +44,7 @@
@Autowired public GraphService graphService;
// @Resource("name") or @Qualifier
@Autowired public SPTService tspSptService;
- @Autowired public PathService chainedPathService;
+ private PathService chainedPathService;
@Override
public List<GraphPath> getPaths(RoutingRequest options) {
@@ -155,4 +155,13 @@ private GraphPath joinPaths(List<GraphPath> paths) {
return newPath;
}
+ public PathService getChainedPathService() {
+ return chainedPathService;
+ }
+
+ @Autowired
+ public void setChainedPathService(PathService chainedPathService) {
+ this.chainedPathService = chainedPathService;
+ }
+
}
View
1  opentripplanner-webapp/src/main/webapp/js/otp/application/Controller.js
@@ -46,6 +46,7 @@ otp.application.Controller = {
locale : this.config.locale,
routerId : this.config.routerId,
attribution : otp.util.ExtUtils.MAP_ATTRIBUTION,
+ showLayerSwitcher: this.config.planner.options.showLayerSwitcher,
options: {
controls: []
}
View
8 opentripplanner-webapp/src/main/webapp/js/otp/config.js
@@ -36,9 +36,10 @@ otp.config_defaults = {
showEditButton : true, // turn on/off itinerary edit button
showPrintButton : true, // turn on/off itinerary print button
showLinksButton : true, // turn on/off itinerary links button
+ showLayerSwitcher : true, // turn on/off OpenLayers layer switcher when more than 1 basemap exists (see map.baseLayer below)
useOptionDependencies : true, // trip form changes based on mode and optimize flags (e.g., bike mode has no wheelchair or walk distance forms etc...)
useRouteLongName : false, // format route name with both short-name and long-name...see / override Itinerary.makeRouteName() for different formatting options
- appendGeocodeName : true, // true = send string:lat,lon parameter format to OTP, else just lat,lon goes to OTP
+ appendGeocodeName : true, // true = send string:lat,lon parameter format to OTP, else just lat,lon goes to OTP
OPTIONS_NOTE: "THIS IS A STRUCTURE USED TO CUSTOMIZE THE TRIP FORMS AND OTHER BEHAVIORS"
},
@@ -127,7 +128,9 @@ otp.config_defaults = {
"by<a href='http://openstreetmap.org/' target='_blank'> OpenStreetMap.</a> " +
"Tiles from<a href='http://mapbox.com/about/maps' target='_blank'> MapBox Streets.</a>"
}
- ),
+ )
+ /* comment here to test single / multiple basemaps & layer switcher on/off */
+ ,
// Regular Open Street Map server
new OpenLayers.Layer.OSM(
"Open Street Map"
@@ -160,6 +163,7 @@ otp.config_defaults = {
+" Tiles courtesy of <a href='http://open.mapquest.com/' target='_blank'>MapQuest</a>"
}
)
+ /**/
],
// NOTE: this object is ignored if a baseLayer (which is an instance of OpenLayers.Layer)
View
9 opentripplanner-webapp/src/main/webapp/js/otp/core/Map.js
@@ -61,7 +61,7 @@ otp.core.MapStatic = {
permaLinkEnabled : false,
historyEnabled : true,
rightClickZoom : true,
- layerSwitchEnabled: false,
+ showLayerSwitcher : true,
/*
* Projections - neither should need changing. displayProjection is only
@@ -91,8 +91,9 @@ otp.core.MapStatic = {
this.baseLayer = otp.util.OpenLayersUtils.makeMapBaseLayer(this.map, this.baseLayerOptions);
} else {
this.map.addLayers(this.baseLayer);
- if (this.baseLayer.length > 1) {
- this.layerSwitchEnabled=true;
+ if (this.baseLayer && this.baseLayer.length <= 1)
+ {
+ this.showLayerSwitcher = false;
}
}
this.map.setBaseLayer(this.baseLayer, true);
@@ -104,7 +105,7 @@ otp.core.MapStatic = {
// if we have an empty array of controls, then add the defaults
if (this.options.controls != null && this.options.controls.length == 0)
{
- this.options.controls = otp.util.OpenLayersUtils.defaultControls(this.map, this.zoomWheelEnabled, this.handleRightClicks, this.permaLinkEnabled, this.attribution, this.historyEnabled, this.layerSwitchEnabled);
+ this.options.controls = otp.util.OpenLayersUtils.defaultControls(this.map, this.zoomWheelEnabled, this.handleRightClicks, this.permaLinkEnabled, this.attribution, this.historyEnabled, this.showLayerSwitcher);
}
var layerLoaded = false;

No commit comments for this range

Something went wrong with that request. Please try again.