Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions airline-web/public/javascripts/airport.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,16 +1148,25 @@ function updateAirportBaseMarkers(newBaseAirports, relatedFlightPaths) {
marker.baseInfo = baseAirport
var originalOpacity = marker.getOpacity()
marker.addListener('mouseover', function(event) {
var primaryBaseInfo = this.baseInfo
var airlineIdsToHighlight = [primaryBaseInfo.airlineId]

// if a partner base's info is attached, add its airline ID too
if (primaryBaseInfo.alliancePartnerBaseInfo) {
airlineIdsToHighlight.push(primaryBaseInfo.alliancePartnerBaseInfo.airlineId)
}

$.each(relatedFlightPaths, function(linkId, pathEntry) {
var path = pathEntry.path
var link = pathEntry.path.link
if (!$(path).data("originalOpacity")) {
$(path).data("originalOpacity", path.strokeOpacity)
}
if (link.fromAirportId != baseAirport.airportId || link.airlineId != baseAirport.airlineId) {
path.setOptions({ strokeOpacity : 0.1 })
} else {

if (link.fromAirportId == primaryBaseInfo.airportId && airlineIdsToHighlight.includes(link.airlineId)) {
path.setOptions({ strokeOpacity : 0.8 })
} else {
path.setOptions({ strokeOpacity : 0.1 })
}
})
})
Expand Down
Loading