Skip to content

Commit

Permalink
panto stop
Browse files Browse the repository at this point in the history
  • Loading branch information
kpwebb committed Aug 4, 2015
1 parent 270c13a commit de419b1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/javascripts/views/route-trippatterns-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,12 +1073,14 @@ var GtfsEditor = GtfsEditor || {};
// TODO: find the correct form control here
var selectedStopId = this.$('#trip-pattern-stop-select').val();

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

if(selectedPatternStop == undefined)
if(selectedPatternStops == undefined || selectedPatternStops.length == 0)
return;

this.map.setView(new L.LatLng(selectedPatternStop.stop.location.lat, selectedPatternStop.stop.location.lng), 15);
var stop = this.options.stops.get(selectedPatternStops[0].stopId);

this.map.panTo(new L.LatLng(stop.get("lat"), stop.get("lon")));
},

deletePatternButton: function(evt) {
Expand Down

0 comments on commit de419b1

Please sign in to comment.