Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 8 commits
  • 8 files changed
  • 0 comments
  • 2 contributors
5 opentripplanner-api-webapp/src/main/java/org/opentripplanner/api/common/RoutingResource.java
@@ -212,7 +212,10 @@ protected RoutingRequest buildRequest(int n) throws ParameterException {
212 212 boolean tripPlannedForNow = Math.abs(request.getDateTime().getTime() - new Date().getTime())
213 213 < NOW_THRESHOLD_MILLIS;
214 214 request.setUseBikeRentalAvailabilityInformation(tripPlannedForNow);
215   - if (intermediatePlaces != null && (request.getModes().isTransit() || request.getModes().getWalk() && request.getModes().getBicycle()))
  215 + if (request.getIntermediatePlaces() != null
  216 + && (request.getModes().isTransit() ||
  217 + (request.getModes().getWalk() &&
  218 + request.getModes().getBicycle())))
216 219 throw new UnsupportedOperationException("TSP is not supported for transit or bike share trips");
217 220 return request;
218 221 }
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) {
210 210 this(v1, v2);
211 211 this.intermediatePlaces = intermediates;
212 212 TravelingSalesmanPathService tsp = new TravelingSalesmanPathService();
213   - tsp.chainedPathService = Context.getInstance().pathService;
  213 + tsp.setChainedPathService(Context.getInstance().pathService);
214 214 tsp.graphService = Context.getInstance().graphService;
215 215 this.planGenerator.pathService = tsp;
216 216 }
2  opentripplanner-graph-builder/src/main/java/org/opentripplanner/graph_builder/model/GtfsBundle.java
@@ -40,7 +40,7 @@
40 40
41 41 private CsvInputSource csvInputSource;
42 42
43   - private Boolean defaultBikesAllowed = false;
  43 + private Boolean defaultBikesAllowed = true;
44 44
45 45 private boolean transfersTxtDefinesStationPaths = false;
46 46
22 opentripplanner-routing/src/main/java/org/opentripplanner/routing/impl/RetryingPathServiceImpl.java
@@ -14,33 +14,20 @@
14 14 package org.opentripplanner.routing.impl;
15 15
16 16 import java.util.ArrayList;
17   -import java.util.Arrays;
18 17 import java.util.Collections;
19   -import java.util.Date;
20 18 import java.util.LinkedList;
21 19 import java.util.List;
22 20 import java.util.Queue;
23 21
24 22 import org.onebusaway.gtfs.model.AgencyAndId;
25   -import org.opentripplanner.common.model.NamedPlace;
26   -import org.opentripplanner.routing.core.RoutingContext;
27   -import org.opentripplanner.routing.core.State;
28   -import org.opentripplanner.routing.core.StateEditor;
29   -import org.opentripplanner.routing.core.TraverseMode;
30 23 import org.opentripplanner.routing.core.RoutingRequest;
31   -import org.opentripplanner.routing.error.TransitTimesException;
32   -import org.opentripplanner.routing.error.VertexNotFoundException;
33   -import org.opentripplanner.routing.graph.Vertex;
34 24 import org.opentripplanner.routing.pathparser.BasicPathParser;
35 25 import org.opentripplanner.routing.pathparser.PathParser;
36 26 import org.opentripplanner.routing.services.GraphService;
37 27 import org.opentripplanner.routing.services.PathService;
38   -import org.opentripplanner.routing.services.RemainingWeightHeuristicFactory;
39   -import org.opentripplanner.routing.services.RoutingService;
40 28 import org.opentripplanner.routing.services.SPTService;
41 29 import org.opentripplanner.routing.spt.GraphPath;
42 30 import org.opentripplanner.routing.spt.ShortestPathTree;
43   -import org.opentripplanner.util.DateUtils;
44 31 import org.slf4j.Logger;
45 32 import org.slf4j.LoggerFactory;
46 33 import org.springframework.beans.factory.annotation.Autowired;
@@ -102,15 +89,6 @@ public void setMultiPathTimeout (double seconds) {
102 89 Queue<RoutingRequest> optionQueue = new LinkedList<RoutingRequest>();
103 90 optionQueue.add(options);
104 91
105   - /* if the user wants to travel by transit, create a bus-only set of options */
106   - if (options.getModes().getTrainish() && options.getModes().contains(TraverseMode.BUS)) {
107   - RoutingRequest busOnly = options.clone();
108   - busOnly.setModes(options.getModes().clone());
109   - busOnly.getModes().setTrainish(false);
110   - // Moved inside block to avoid double insertion in list ? (AMB)
111   - // optionQueue.add(busOnly);
112   - }
113   -
114 92 double maxWeight = Double.MAX_VALUE;
115 93 double maxWalk = options.getMaxWalkDistance();
116 94 long maxTime = options.isArriveBy() ? 0 : Long.MAX_VALUE;
11 opentripplanner-routing/src/main/java/org/opentripplanner/routing/impl/TravelingSalesmanPathService.java
@@ -44,7 +44,7 @@
44 44 @Autowired public GraphService graphService;
45 45 // @Resource("name") or @Qualifier
46 46 @Autowired public SPTService tspSptService;
47   - @Autowired public PathService chainedPathService;
  47 + private PathService chainedPathService;
48 48
49 49 @Override
50 50 public List<GraphPath> getPaths(RoutingRequest options) {
@@ -155,4 +155,13 @@ private GraphPath joinPaths(List<GraphPath> paths) {
155 155 return newPath;
156 156 }
157 157
  158 + public PathService getChainedPathService() {
  159 + return chainedPathService;
  160 + }
  161 +
  162 + @Autowired
  163 + public void setChainedPathService(PathService chainedPathService) {
  164 + this.chainedPathService = chainedPathService;
  165 + }
  166 +
158 167 }
1  opentripplanner-webapp/src/main/webapp/js/otp/application/Controller.js
@@ -46,6 +46,7 @@ otp.application.Controller = {
46 46 locale : this.config.locale,
47 47 routerId : this.config.routerId,
48 48 attribution : otp.util.ExtUtils.MAP_ATTRIBUTION,
  49 + showLayerSwitcher: this.config.planner.options.showLayerSwitcher,
49 50 options: {
50 51 controls: []
51 52 }
8 opentripplanner-webapp/src/main/webapp/js/otp/config.js
@@ -36,9 +36,10 @@ otp.config_defaults = {
36 36 showEditButton : true, // turn on/off itinerary edit button
37 37 showPrintButton : true, // turn on/off itinerary print button
38 38 showLinksButton : true, // turn on/off itinerary links button
  39 + showLayerSwitcher : true, // turn on/off OpenLayers layer switcher when more than 1 basemap exists (see map.baseLayer below)
39 40 useOptionDependencies : true, // trip form changes based on mode and optimize flags (e.g., bike mode has no wheelchair or walk distance forms etc...)
40 41 useRouteLongName : false, // format route name with both short-name and long-name...see / override Itinerary.makeRouteName() for different formatting options
41   - appendGeocodeName : true, // true = send string:lat,lon parameter format to OTP, else just lat,lon goes to OTP
  42 + appendGeocodeName : true, // true = send string:lat,lon parameter format to OTP, else just lat,lon goes to OTP
42 43 OPTIONS_NOTE: "THIS IS A STRUCTURE USED TO CUSTOMIZE THE TRIP FORMS AND OTHER BEHAVIORS"
43 44 },
44 45
@@ -127,7 +128,9 @@ otp.config_defaults = {
127 128 "by<a href='http://openstreetmap.org/' target='_blank'> OpenStreetMap.</a> " +
128 129 "Tiles from<a href='http://mapbox.com/about/maps' target='_blank'> MapBox Streets.</a>"
129 130 }
130   - ),
  131 + )
  132 + /* comment here to test single / multiple basemaps & layer switcher on/off */
  133 + ,
131 134 // Regular Open Street Map server
132 135 new OpenLayers.Layer.OSM(
133 136 "Open Street Map"
@@ -160,6 +163,7 @@ otp.config_defaults = {
160 163 +" Tiles courtesy of <a href='http://open.mapquest.com/' target='_blank'>MapQuest</a>"
161 164 }
162 165 )
  166 + /**/
163 167 ],
164 168
165 169 // NOTE: this object is ignored if a baseLayer (which is an instance of OpenLayers.Layer)
9 opentripplanner-webapp/src/main/webapp/js/otp/core/Map.js
@@ -61,7 +61,7 @@ otp.core.MapStatic = {
61 61 permaLinkEnabled : false,
62 62 historyEnabled : true,
63 63 rightClickZoom : true,
64   - layerSwitchEnabled: false,
  64 + showLayerSwitcher : true,
65 65
66 66 /*
67 67 * Projections - neither should need changing. displayProjection is only
@@ -91,8 +91,9 @@ otp.core.MapStatic = {
91 91 this.baseLayer = otp.util.OpenLayersUtils.makeMapBaseLayer(this.map, this.baseLayerOptions);
92 92 } else {
93 93 this.map.addLayers(this.baseLayer);
94   - if (this.baseLayer.length > 1) {
95   - this.layerSwitchEnabled=true;
  94 + if (this.baseLayer && this.baseLayer.length <= 1)
  95 + {
  96 + this.showLayerSwitcher = false;
96 97 }
97 98 }
98 99 this.map.setBaseLayer(this.baseLayer, true);
@@ -104,7 +105,7 @@ otp.core.MapStatic = {
104 105 // if we have an empty array of controls, then add the defaults
105 106 if (this.options.controls != null && this.options.controls.length == 0)
106 107 {
107   - this.options.controls = otp.util.OpenLayersUtils.defaultControls(this.map, this.zoomWheelEnabled, this.handleRightClicks, this.permaLinkEnabled, this.attribution, this.historyEnabled, this.layerSwitchEnabled);
  108 + this.options.controls = otp.util.OpenLayersUtils.defaultControls(this.map, this.zoomWheelEnabled, this.handleRightClicks, this.permaLinkEnabled, this.attribution, this.historyEnabled, this.showLayerSwitcher);
108 109 }
109 110
110 111 var layerLoaded = false;

No commit comments for this range

Something went wrong with that request. Please try again.