Class: module:Panoramax

module:Panoramax(map, options, lizmap3)

new module:Panoramax(map, options, lizmap3)

Create a Panoramax instance

Parameters:
Name Type Description
map object

OpenLayers map (mainLizmap.map)

options object

The Lizmap config options

lizmap3 object

The old lizmap object

Source:

Classes

Panoramax
Panoramax

Members

active :boolean

Whether the tool is currently active (dock open).

Type:
  • boolean
Source:

(static, constant) PNX_DATE_PALETTE

Date-based palette for the coverage layer (matches panoramax.openstreetmap.fr colours). Index: 0 = > 2 years (oldest), 1 = < 2 years, 2 = < 1 year, 3 = < 1 month (newest), 4 = no date field (BASE colour).

Source:

(inner, constant) ARROW_SVG

Arrow icon pointing to the North (heading 0). Rotated clockwise to match the heading (in radians) reported by the Panoramax photo viewer.

Source:

(inner, constant) DEFAULT_PANORAMAX_URL

Default Panoramax instance used when panoramaxUrl is not set in the config

Source:

(inner, constant) PNX_COLOR

Default (classic) colour for the coverage layer — matches COLORS.BASE on panoramax.openstreetmap.fr

Source:

(inner, constant) PNX_SELECTED_COLOR

Colour applied to the selected sequence — matches COLORS.SELECTED on panoramax.openstreetmap.fr

Source:

Methods

_belongsToSelectedSeq(feature, isPoint) → {boolean}

Return true if feature belongs to the currently selected sequence. Works for both sequence lines (id === seqId) and picture points (sequences array contains seqId).

Parameters:
Name Type Description
feature object
isPoint boolean
Source:
Returns:
Type
boolean

_close()

Close the tool: deactivate the map module (stops click handling, hides arrow).

Source:

_getDateColorIndex(dateStr) → {number}

Map a feature's date string to a PNX_DATE_PALETTE index.

Parameters:
Name Type Description
dateStr string | undefined

ISO date/datetime string, or falsy

Source:
Returns:

0–4 (4 = no date)

Type
number

_handleClick(evt)

Handle a click on the map: if a Panoramax feature is hit, ask the viewer to load the corresponding picture (by id) or the nearest one (by position).

Parameters:
Name Type Description
evt object

OpenLayers map browser event

Source:

(async) _open()

Open the tool: activate the map module, and lazy-load + render the viewer the first time.

Source:

_unwirePSV()

Remove the photo viewer event listeners.

Source:

Build and set the href of the "Open in Panoramax" link from the current viewer state (picture id, sequence id, position, heading/pitch/zoom).

Source:

_wirePSV()

Listen to the photo viewer events to drive the map arrow.

Source:

activate()

Activate the tool: show the coverage layer and start handling map clicks.

Source:

clearArrow()

Hide the orientation arrow and cancel any pending heading update.

Source:

deactivate()

Deactivate the tool: hide the coverage layer, stop handling map clicks and hide the arrow.

Source:

(async) searchAccounts(query, signalopt) → {Promise.<Array.<{id: string, name: string}>>}

Search for contributor accounts whose name matches the given query. Hits the Panoramax /users/search?q= endpoint. Returns an empty array on error or when the request is aborted.

Parameters:
Name Type Attributes Description
query string

search term (at least 1 character)

signal AbortSignal <optional>
Source:
Returns:
Type
Promise.<Array.<{id: string, name: string}>>

setAccountFilter(accountId)

Filter the coverage layer to only show features belonging to a given account.

Parameters:
Name Type Description
accountId string | null

account UUID, or null (no filter)

Source:

setDateFilter(startDate, endDate)

Filter the coverage layer to only show pictures/sequences in a date range. Either bound can be null to leave that side open.

Parameters:
Name Type Description
startDate string | null

ISO date string "YYYY-MM-DD", or null

endDate string | null

ISO date string "YYYY-MM-DD", or null

Source:

setSelectedSequence(seqId)

Highlight the given sequence on the coverage layer (blue, matching COLORS.SELECTED on panoramax.openstreetmap.fr). Called by the component whenever the viewer loads a picture so the map stays in sync.

Parameters:
Name Type Description
seqId string | null

sequence UUID, or null to clear the selection

Source:

setStyleMode(mode)

Switch the coverage layer style between 'classic' (uniform brand colour) and 'date' (colour-coded by capture date, matching panoramax.openstreetmap.fr).

Parameters:
Name Type Description
mode string

'classic' or 'date'

Source:

setTypeFilter(type)

Filter the coverage layer to only show features of a given type.

Parameters:
Name Type Description
type string | null

"flat", "equirectangular", or null (no filter)

Source:

updateArrow(lon, lat, headingDeg)

Move the arrow to the picture location and orient it. Called when a picture is loaded in the viewer.

Parameters:
Name Type Description
lon number

picture longitude (EPSG:4326)

lat number

picture latitude (EPSG:4326)

headingDeg number

heading in degrees (0 = North, clockwise)

Source:

updateHeading(headingDeg)

Update only the arrow heading (when the user rotates the view in the photo viewer). Updates are coalesced with requestAnimationFrame to avoid stutter.

Parameters:
Name Type Description
headingDeg number

heading in degrees (0 = North, clockwise)

Source: