/*
  This file defines trainstations.
  Properties of train stations:
      longitude
      latitude
      isTransferStation
      description

   Interface methods (names must match method names in SegmentSections):
      getPoints()
      goTo()
*/
function TrainStation(latitude, longitude) {
   this.longitude = longitude;
   this.latitude = latitude;
}

TrainStation.prototype.description = "Missing description";
TrainStation.prototype.getPoints = function () {
    if ( !this.point ) {
        this.point = new GPoint(this.longitude, this.latitude);
    }
    return [this.point];
}

TrainStation.prototype.isTransferStation = false;
TrainStation.prototype.getMarker = function () {
    if ( !this.stationMarker ) {
        var point = this.getPoints()[0];
	this.stationMarker = new GMarker(point);
    }
    return this.stationMarker;
}

TrainStation.prototype.goTo = function () {
    var marker = this.getMarker();
    marker.showMapBlowup();
    return marker;
}

