MapMore
Panoramax.components.ui.MapMore ⇐ Map
Kind: static class of Panoramax.components.ui
Extends: Map
Emits: background-changed
, users-changed
, sequence-hover
, sequence-click
, picture-click
, filters-changed
- .MapMore ⇐
Map
- new MapMore(parent, container, [options])
- .destroy()
- .waitForEnoughMapLoaded() ⇒
Promise
- .reloadVectorTiles()
- .hasTwoBackgrounds() ⇒
boolean
- .getBackground() ⇒
string
- .setBackground(bg)
- .getVisibleUsers() ⇒
Array.<string>
- .setVisibleUsers(visibleIds)
- .filterUserLayersContent(dataType, filter)
- .displayPictureMarker(lon, lat, heading, [skipCenter])
- .reloadLayersStyles()
- .addEventListener(type, listener)
- "filters-changed"
- "ready"
- "background-changed"
- "users-changed"
- "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 like themes, filters and more.
Note that all functions of MapLibre GL JS class Map are also available.
⚠️ 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.background] | string |
"streets" |
Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to streets. |
[options.theme] | string |
"default" |
The map theme (default, age, score, type) |
Example
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.hasTwoBackgrounds() ⇒ boolean
Check if map offers aerial imagery as well as streets rendering.
Kind: instance method of MapMore
Returns: boolean
- True if aerial imagery is available for display
mapMore.getBackground() ⇒ string
Get the currently selected map background
Kind: instance method of MapMore
Returns: string
- aerial or streets
mapMore.setBackground(bg)
Change the shown background in map.
Kind: instance method of MapMore
Throws:
Error
If not aerial imagery is available
Param | Type | Description |
---|---|---|
bg | string |
The new background to display (aerial or streets) |
mapMore.getVisibleUsers() ⇒ Array.<string>
Get the currently visible users
Kind: instance method of MapMore
Returns: Array.<string>
- List of visible users
mapMore.setVisibleUsers(visibleIds)
Make given user layers visible on map, and hide all others (if any)
Kind: instance method of MapMore
Param | Type | Description |
---|---|---|
visibleIds | string | Array.<string> |
The user layers IDs to display |
mapMore.filterUserLayersContent(dataType, filter)
Filter the visible data content in all visible map layers
Kind: instance method of MapMore
Param | Type | Description |
---|---|---|
dataType | string |
sequences or pictures |
filter | object |
The MapLibre GL filter rule to apply |
mapMore.displayPictureMarker(lon, lat, heading, [skipCenter])
Shows on map a picture position and heading.
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 |
mapMore.reloadLayersStyles()
Forces reload of pictures/sequences layer styles. This is useful after a map theme change.
Kind: instance method of MapMore
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. |
"filters-changed"
Event for filters changes
Kind: event emitted by MapMore
Properties
Name | Type | Description |
---|---|---|
[minDate] | string |
The minimum date in time range (ISO format) |
[maxDate] | string |
The maximum date in time range (ISO format) |
[pic_type] | string |
Camera type (equirectangular, flat, null/empty string for both) |
[camera] | string |
Camera make and model |
[theme] | string |
Map theme |
[qualityscore] | Array.<number> |
QualityScore values, as a list of 1 to 5 grades |
"ready"
Event when map is ready to display. This includes Maplibre initial load, enough map data display and styling.
Kind: event emitted by MapMore
"background-changed"
Event for map background changes
Kind: event emitted by MapMore
Properties
Name | Type | Description |
---|---|---|
[background] | string |
The new selected background (aerial, streets) |
"users-changed"
Event for visible users changes
Kind: event emitted by MapMore
Properties
Name | Type | Description |
---|---|---|
[usersIds] | Array.<string> |
The list of newly selected users |
"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 |