Skip to content

Commit de419b1

Browse files
committed
panto stop
1 parent 270c13a commit de419b1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

public/javascripts/views/route-trippatterns-view.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,12 +1073,14 @@ var GtfsEditor = GtfsEditor || {};
10731073
// TODO: find the correct form control here
10741074
var selectedStopId = this.$('#trip-pattern-stop-select').val();
10751075

1076-
var selectedPatternStop = this.model.tripPatterns.get(selectedPatternId).getPatternStop(selectedStopId);
1076+
var selectedPatternStops = this.model.tripPatterns.get(selectedPatternId).getPatternStops(selectedStopId);
10771077

1078-
if(selectedPatternStop == undefined)
1078+
if(selectedPatternStops == undefined || selectedPatternStops.length == 0)
10791079
return;
10801080

1081-
this.map.setView(new L.LatLng(selectedPatternStop.stop.location.lat, selectedPatternStop.stop.location.lng), 15);
1081+
var stop = this.options.stops.get(selectedPatternStops[0].stopId);
1082+
1083+
this.map.panTo(new L.LatLng(stop.get("lat"), stop.get("lon")));
10821084
},
10831085

10841086
deletePatternButton: function(evt) {

0 commit comments

Comments
 (0)