Class: MapStatusBarView

MapStatusBarView()

Combines the map's ScaleBarView with a LayerLoadingIndicatorView that expands beneath it while layers are loading. This view owns all of the timing/animation logic that decides *when* the loading row is shown, so that neither of its children need to know about delays, minimum open durations, or the "completed" message.

Screenshot

Constructor

new MapStatusBarView()

Since:
  • 2.41.0
Source:

Extends

  • Backbone.View

Members

className

Source:

collapseTimer :number|null

Timer id for the pending MapStatusBarView#handleLoadingFinished collapse, or null if none is pending.
Type:
  • number | null
Source:

expandedAt :number

Timestamp (ms) when the loading row was last expanded, or null if it is currently collapsed.
Type:
  • number
Source:

isCurrentlyLoading :boolean

Whether the map is currently reporting that layers are loading.
Type:
  • boolean
Source:

lastMessageUpdateAt :number

Timestamp (ms) of the last time the visible message was updated.
Type:
  • number
Source:

messageUpdateTimer :number|null

Timer id for the pending throttled MapStatusBarView#flushMessageUpdate call, or null if none is pending.
Type:
  • number | null
Source:

model :Map

The map model that provides the aggregate `isLoadingLayers`/ `loadingLayersMessage` loading state.
Type:
Source:

pendingMessage :string

The most recent message awaiting display, throttled by MESSAGE_UPDATE_INTERVAL_MS.
Type:
  • string
Source:

pointModel :GeoPoint

Passed through to the ScaleBarView.
Type:
Source:

revealTimer :number|null

Timer id for the pending MapStatusBarView#scheduleReveal expand, or null if none is pending.
Type:
  • number | null
Source:

scaleModel :GeoScale

Passed through to the ScaleBarView.
Type:
Source:

Methods

clearCollapseTimer()

Clear the pending collapse timer, if any.
Source:

clearMessageUpdateTimer()

Clear the pending message-update timer, if any.
Source:

clearRevealTimer()

Clear the pending reveal timer, if any.
Source:

collapse()

Collapse the status bar back down to just the scale bar.
Source:

expand()

Expand the status bar to reveal the loading row.
Source:

flushMessageUpdate()

Render the currently pending message and record the update time.
Source:

handleBarWidthChange(barWidth)

Mirror the scale bar's live pixel width onto this element's own style so this box's width (see `.map-status-bar` in map-view.css) can track it via a plain CSS calc(), growing/shrinking by the same amount.
Parameters:
Name Type Description
barWidth number The scale bar graphic's current width, in pixels.
Source:

handleLoadingFinished()

Handle loading having finished, whether or not the row ever opened. If it finished before it was ever revealed, this is a no-op (no flash). If it finished before the minimum open duration elapsed, show a brief "completed" message before collapsing; otherwise collapse right away.
Source:

handleLoadingStateChange()

React to changes in the map's aggregate layer-loading state.
Source:

initialize(options)

Parameters:
Name Type Description
options object The options for this view.
Properties
Name Type Description
model Map The map model that provides the aggregate `isLoadingLayers`/`loadingLayersMessage` loading state.
scaleModel GeoScale Passed through to the ScaleBarView.
pointModel GeoPoint Passed through to the ScaleBarView.
Source:

isExpanded() → {boolean}

Source:
Returns:
Whether the loading row is currently expanded.
Type
boolean

onClose()

Source:

render()

Source:

scheduleMessageUpdate(message)

Show the latest message, but no more than once every MESSAGE_UPDATE_INTERVAL_MS, so a burst of near-simultaneous layer status changes settles into a single visible update instead of flickering through every intermediate value. Always resolves to the most recent message once the interval has elapsed.
Parameters:
Name Type Description
message string The latest message to (eventually) display.
Source:

scheduleReveal()

Wait for REVEAL_DELAY_MS before expanding, so brief loads never cause the loading row to flash open then closed.
Source: