mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Merge branch 'main' into fix/i18n-installations-note
# Conflicts: # scripts/package-boundaries.json # src/layers/installations/controls.js
This commit is contained in:
commit
93b091d082
2063 files changed
+322399
-46202
No files matched your search
@@ -118,7 +118,7 @@ export function createPanel({ state: layerState, parts }) {
|
||||
.slice(page, page + AWARENESS_PAGE_SIZE)
|
||||
.map((item, index) => {
|
||||
const label = formatAwarenessLabel(item);
|
||||
const targetId = item.icao24 || item.mmsi || item.id;
|
||||
const targetId = item.icao24 || item.id || item.mmsi;
|
||||
const distance = presentAwarenessDistance(item.distanceM);
|
||||
if (!targetId)
|
||||
return {
|
||||
@@ -183,15 +183,56 @@ export function createPanel({ state: layerState, parts }) {
|
||||
: null;
|
||||
}
|
||||
|
||||
/** The credit line: the photographer, and an open photo's licence. A
|
||||
* photo whose answer names no photographer shows no photographer. */
|
||||
function photoCredit(photo) {
|
||||
if (photo.licence)
|
||||
return photo.photographer
|
||||
? t('Photo: {photographer} · {licence}', {
|
||||
photographer: photo.photographer,
|
||||
licence: photo.licence,
|
||||
})
|
||||
: t('Photo · {licence}', { licence: photo.licence });
|
||||
return photo.photographer
|
||||
? t('Photo © {photographer}', { photographer: photo.photographer })
|
||||
: '';
|
||||
}
|
||||
|
||||
/** The subject's photo with its credit, or null. The subject
|
||||
* refresh resolves it; only the subject it was resolved for shows it. */
|
||||
function presentPhoto(subject) {
|
||||
const held = layerState.subjectPhoto;
|
||||
if (
|
||||
!held ||
|
||||
held.layerId !== subject.layerId ||
|
||||
String(held.id) !== String(subject.id)
|
||||
)
|
||||
return null;
|
||||
const { photo } = held;
|
||||
return {
|
||||
src: photo.src,
|
||||
width: photo.width ?? null,
|
||||
height: photo.height ?? null,
|
||||
link: photo.link,
|
||||
credit: photoCredit(photo),
|
||||
};
|
||||
}
|
||||
|
||||
function renderResults() {
|
||||
if (!layerState.enabled || !layerState.results) return hidePanel();
|
||||
ensurePanel();
|
||||
layerState.panelRenders += 1;
|
||||
const { subject, cohorts } = layerState.results;
|
||||
const windowLabel = t('{distance} FLIGHT / VESSEL WINDOW', {
|
||||
distance: presentAwarenessDistance(AWARENESS_RADIUS_M),
|
||||
});
|
||||
publish({
|
||||
kind: 'results',
|
||||
subject: `${subject.label} · ${t('{distance} FLIGHT / VESSEL WINDOW', { distance: presentAwarenessDistance(AWARENESS_RADIUS_M) })}`,
|
||||
subject: `${subject.label} · ${windowLabel}`,
|
||||
subjectIdentity: { layerId: subject.layerId, id: subject.id },
|
||||
subjectLabel: subject.label,
|
||||
subjectNames: presentNames(subject.memberNames),
|
||||
photo: presentPhoto(subject),
|
||||
navigation: presentNavigation(),
|
||||
rows: cohorts.map(presentRow),
|
||||
note: t(
|
||||
|
||||
Reference in new issue
Block a user