| | |
| | | |
| | | this._content = document.createElement('div'); |
| | | this._element.appendChild(this._content); |
| | | }; |
| | | } |
| | | Panel.prototype = { |
| | | _element: null, |
| | | _hide: null, |
| | |
| | | var query = this.input.value.toUpperCase(); |
| | | if(query === this.query) return; |
| | | this.query = query; |
| | | |
| | | if(query === '') { |
| | | deleteChildren(this.results); |
| | | return; |
| | | } |
| | | |
| | | var features = []; |
| | | stops_type.forEach(function(stop_type) { |
| | |
| | | if(vehicle_feature) { |
| | | vehicles_source[prefix].removeFeature(vehicle_feature); |
| | | if(feature_clicked && feature_clicked.getId() === vehicle_feature.getId()) { |
| | | featureClicked(); |
| | | panel.close(); |
| | | } |
| | | } |
| | | continue; |
| | |
| | | } |
| | | // Vehicle |
| | | else if(ttss_types.includes(type)) { |
| | | styleVehicle(feature, true); |
| | | |
| | | var span = displayVehicle(feature.get('vehicle_type')); |
| | | |
| | | additional = document.createElement('p'); |
| | |
| | | |
| | | vehicleTable(feature, tbody); |
| | | vehiclePath(feature); |
| | | |
| | | styleVehicle(feature, true); |
| | | } |
| | | // Stop or stop point |
| | | else if(['s', 'p'].includes(type)) { |
| | |
| | | function listFeatures(features) { |
| | | var div = document.createElement('div'); |
| | | |
| | | if(features.length === 0) { |
| | | addParaWithText(div, lang.no_results); |
| | | return div; |
| | | } |
| | | |
| | | addParaWithText(div, lang.select_feature); |
| | | |
| | | var feature, p, a, full_type, typeName; |
| | |
| | | var feature = features[0]; |
| | | |
| | | if(features.length > 1) { |
| | | featureClicked(); |
| | | panel.show(listFeatures(features)); |
| | | return; |
| | | } |