Skip to content

MapMore

Panoramax.components.ui.MapMore ⇐ Map

Kind: static class of Panoramax.components.ui
Extends: Map
Emits: sequence-hover, sequence-click, picture-click

new MapMore(parent, container, [options])

MapMore is a more complete version of Map UI component.

It offers advanced features filters and semantic overlays.

Note that all functions of MapLibre GL JS class Map are also available.

ℹ️ Many style management is done in MapStyleComposer, which is available as a property of parent component.

⚠️ This class doesn't inherit from EventTarget, so it doesn't have addEventListener and dispatchEvent functions. It uses instead on and fire functions from MapLibre Map class. fire function doesn't take directly Event objects, but a string and object data.

Param Type Default Description
parent Basic The parent view
container Element The DOM element to create into
[options] object The map options (any of MapLibre GL settings or any supplementary option defined here)
[options.raster] object The MapLibre raster source for aerial background. This must be a JSON object following MapLibre raster source definition.
[options.basemaps] object List of complementary basemaps, as { id: {MapLibre Style JSON or URL} }. Note that special IDs streets and aerial are reserved for default backgrounds.
[options.background] string "streets" Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to streets.
[options.attributionControl.customAttribution] string To override default map attribution.
[options.picMarkerDraggable] boolean To make the picture marker draggable, default to false.
[options.indoor] object The indoor= MapLibre plugin options. This must be a JSON object following IndoorEqual parameters. Note that this is only available if maplibre-gl-indoorequal plugin is loaded in your web page.
[options.indoor.level] string (only if indoor= plugin is enabled) The initial indoor level to display. Defaults to ground or disabled depending on indoor map availability.
[options.indoor.visible] boolean true (only if indoor= plugin is enabled) The initial indoor visibility. Set to false to avoid data loading before user explicitly enables indoor through widgets. If set to false, you may not set any level option in component.
[options.theme] string "default" The map theme (default, age, score, type)

Example

const map = new Panoramax.components.ui.MapMore(viewer, mapNode, {center: {lat: 48.7, lng: -1.7}});

mapMore.destroy()

Destroy any form of life in this component

Kind: instance method of MapMore

mapMore.waitForEnoughMapLoaded() ⇒ Promise

Helper to know when enough map background and Panoramax tiles are loaded for a proper display.

Kind: instance method of MapMore
Returns: Promise - Resolves when enough is loaded

mapMore.reloadVectorTiles()

Force refresh of vector tiles data

Kind: instance method of MapMore

mapMore.displayPictureMarker(lon, lat, heading, [skipCenter], [picId])

Shows on map a picture position and heading.

If no longitude & latitude are set, marker is removed from map.

Kind: instance method of MapMore

Param Type Default Description
lon number The longitude
lat number The latitude
heading number The heading
[skipCenter] boolean false Set to true to avoid map centering on marker
[picId] string null The picture Id

mapMore.addEventListener(type, listener)

Listen to map events. This is a binder to on and once MapLibre GL functions.

Kind: instance method of MapMore

Param Type Default Description
type string The event type to listen for
listener function The event handler
[options.once] boolean false Set to true to only listen to first event.

"ready"

Event when map is ready to display. This includes Maplibre initial load, enough map data display and styling.

Kind: event emitted by MapMore

"sequence-hover"

Event when a sequence on map is hovered (not selected)

Kind: event emitted by MapMore
Properties

Name Type Description
seqId string The hovered sequence ID

"sequence-click"

Event when a sequence on map is clicked

Kind: event emitted by MapMore
Properties

Name Type Description
seqId string The clicked sequence ID
coordinates maplibregl.LngLat The coordinates of user click

"picture-click"

Event when a picture on map is clicked

Kind: event emitted by MapMore
Properties

Name Type Description
picId string The clicked picture ID
seqId string The clicked picture's sequence ID
feature object The GeoJSON feature of the picture