@panoramax/web-viewer 4.4.0-develop-3839b5a4 → 4.4.0-develop-f91f6758
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src → build}/components/core/Basic.js +22 -16
- package/{src → build}/components/core/CoverageMap.js +19 -14
- package/{src → build}/components/core/Editor.js +16 -16
- package/{src → build}/components/core/PhotoViewer.js +30 -29
- package/{src → build}/components/core/Viewer.js +21 -20
- package/build/components/core/index.js +10 -0
- package/build/components/index.js +11 -0
- package/build/components/index_photoviewer.js +6 -0
- package/{src → build}/components/layout/BottomDrawer.js +4 -4
- package/{src → build}/components/layout/CorneredGrid.js +1 -1
- package/{src → build}/components/layout/Mini.js +5 -4
- package/{src → build}/components/layout/Tabs.js +1 -1
- package/build/components/layout/index.js +9 -0
- package/{src → build}/components/menus/LocationPrecisionDoc.js +4 -6
- package/{src → build}/components/menus/MapBackground.js +4 -6
- package/{src → build}/components/menus/MapFilters.js +16 -21
- package/{src → build}/components/menus/MapLayers.js +20 -24
- package/{src → build}/components/menus/MapLegend.js +3 -4
- package/{src → build}/components/menus/MiniPictureLegend.js +3 -4
- package/{src → build}/components/menus/PictureLegend.js +10 -15
- package/{src → build}/components/menus/PictureMetadata.js +12 -19
- package/{src → build}/components/menus/PlayerOptions.js +5 -7
- package/{src → build}/components/menus/QualityScoreDoc.js +3 -4
- package/{src → build}/components/menus/ReportForm.js +8 -9
- package/{src → build}/components/menus/SemanticsDoc.js +3 -4
- package/{src → build}/components/menus/SemanticsDownload.js +3 -3
- package/{src → build}/components/menus/SemanticsFilters.js +7 -8
- package/{src → build}/components/menus/SemanticsList.js +11 -18
- package/{src → build}/components/menus/SemanticsMetadata.js +8 -11
- package/{src → build}/components/menus/Share.js +6 -7
- package/build/components/menus/index.js +22 -0
- package/build/components/menus/index_photoviewer.js +11 -0
- package/{src → build}/components/styles.js +0 -2
- package/{src → build}/components/ui/AnnotationsSwitch.js +6 -8
- package/{src → build}/components/ui/Button.js +1 -1
- package/{src → build}/components/ui/ButtonGroup.js +2 -1
- package/{src → build}/components/ui/CopyButton.js +4 -6
- package/{src → build}/components/ui/Grade.js +5 -5
- package/{src → build}/components/ui/GradeFilter.js +3 -3
- package/{src → build}/components/ui/IconSwitch.js +1 -1
- package/{src → build}/components/ui/LinkButton.js +1 -1
- package/{src → build}/components/ui/ListGroup.js +3 -3
- package/{src → build}/components/ui/ListItem.js +1 -1
- package/{src → build}/components/ui/Loader.js +8 -7
- package/{src → build}/components/ui/Map.js +38 -26
- package/{src → build}/components/ui/MapMore.js +7 -7
- package/{src → build}/components/ui/Photo.js +29 -27
- package/{src → build}/components/ui/Popup.js +4 -4
- package/{src → build}/components/ui/QualityScore.js +4 -4
- package/{src → build}/components/ui/SearchBar.js +6 -7
- package/{src → build}/components/ui/SemanticsEditor.js +14 -15
- package/{src → build}/components/ui/SemanticsTable.js +4 -5
- package/{src → build}/components/ui/Switch.js +1 -1
- package/{src → build}/components/ui/TogglableGroup.js +4 -4
- package/build/components/ui/index.js +29 -0
- package/build/components/ui/index_photoviewer.js +21 -0
- package/{src → build}/components/ui/widgets/CopyCoordinates.js +5 -5
- package/{src → build}/components/ui/widgets/GeoSearch.js +10 -10
- package/{src → build}/components/ui/widgets/Legend.js +9 -8
- package/{src → build}/components/ui/widgets/LevelSelect.js +9 -7
- package/{src → build}/components/ui/widgets/MapFiltersButton.js +5 -5
- package/{src → build}/components/ui/widgets/MapLayersButton.js +5 -5
- package/{src → build}/components/ui/widgets/OSMEditors.js +8 -8
- package/{src → build}/components/ui/widgets/PictureLegendActions.js +4 -4
- package/{src → build}/components/ui/widgets/Player.js +6 -7
- package/{src → build}/components/ui/widgets/SemanticsFiltersButton.js +6 -7
- package/{src → build}/components/ui/widgets/Zoom.js +6 -6
- package/build/components/ui/widgets/index.js +16 -0
- package/build/components/ui/widgets/index_photoviewer.js +7 -0
- package/build/editor.html +94 -10
- package/{src → build}/img/arrow_triangle.svg +0 -1
- package/{src → build}/img/arrow_turn.svg +0 -1
- package/build/index.html +111 -1
- package/build/index.js +6 -95
- package/build/index_photoviewer.js +4 -0
- package/build/map.html +97 -1
- package/build/package.json +141 -0
- package/build/photo.html +85 -1
- package/build/servers.js +3 -4
- package/{src → build}/utils/API.js +33 -33
- package/{src → build}/utils/InitParameters.js +11 -9
- package/{src → build}/utils/MapStyleComposer.js +39 -37
- package/{src → build}/utils/PhotoAdapter.js +1 -0
- package/{src → build}/utils/PresetsManager.js +4 -4
- package/{src → build}/utils/SemanticsMapProtocol.js +3 -4
- package/{src → build}/utils/URLHandler.js +16 -14
- package/{src → build}/utils/geocoder.js +5 -5
- package/{src → build}/utils/i18n.js +21 -20
- package/build/utils/index.js +17 -0
- package/build/utils/index_photoviewer.js +14 -0
- package/{src → build}/utils/indoor.js +9 -5
- package/{src → build}/utils/map.js +15 -11
- package/{src → build}/utils/picture.js +22 -17
- package/{src → build}/utils/semantics.js +9 -5
- package/{src → build}/utils/utils.js +8 -4
- package/{src → build}/utils/widgets.js +2 -2
- package/build/viewer.html +120 -35
- package/build/viewer_indoor.html +90 -8
- package/build/widgets.html +410 -1
- package/package.json +81 -204
- package/.dockerignore +0 -7
- package/.gitlab-ci.yml +0 -78
- package/CHANGELOG.md +0 -853
- package/CODE_OF_CONDUCT.md +0 -134
- package/Dockerfile +0 -14
- package/build/index.css +0 -36
- package/build/index.css.map +0 -1
- package/build/index.js.map +0 -1
- package/build/photoviewer.css +0 -36
- package/build/photoviewer.css.map +0 -1
- package/build/photoviewer.js +0 -86
- package/build/photoviewer.js.map +0 -1
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-400-normal..woff2 +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff +0 -0
- package/build/static/media/atkinson-hyperlegible-next-latin-ext-400-normal..woff2 +0 -0
- package/config/env.js +0 -104
- package/config/getHttpsConfig.js +0 -69
- package/config/getPackageJson.js +0 -25
- package/config/jest/babelTransform.js +0 -29
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -40
- package/config/jest/mocks.js +0 -230
- package/config/modules.js +0 -134
- package/config/paths.js +0 -76
- package/config/pnpTs.js +0 -35
- package/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
- package/config/webpack.config.js +0 -825
- package/config/webpackDevServer.config.js +0 -131
- package/docs/03_URL_settings.md +0 -218
- package/docs/05_Compatibility.md +0 -83
- package/docs/09_Develop.md +0 -141
- package/docs/90_Releases.md +0 -27
- package/docs/images/class_diagram.drawio +0 -144
- package/docs/images/class_diagram.jpg +0 -0
- package/docs/images/comparative_3drender.jpg +0 -0
- package/docs/images/indoor_level.png +0 -0
- package/docs/images/screenshot.jpg +0 -0
- package/docs/index.md +0 -159
- package/docs/reference/components/core/Basic.md +0 -211
- package/docs/reference/components/core/CoverageMap.md +0 -220
- package/docs/reference/components/core/Editor.md +0 -252
- package/docs/reference/components/core/PhotoViewer.md +0 -320
- package/docs/reference/components/core/Viewer.md +0 -398
- package/docs/reference/components/layout/BottomDrawer.md +0 -35
- package/docs/reference/components/layout/CorneredGrid.md +0 -29
- package/docs/reference/components/layout/Mini.md +0 -45
- package/docs/reference/components/layout/Tabs.md +0 -46
- package/docs/reference/components/menus/LocationPrecisionDoc.md +0 -15
- package/docs/reference/components/menus/MapBackground.md +0 -32
- package/docs/reference/components/menus/MapFilters.md +0 -37
- package/docs/reference/components/menus/MapLayers.md +0 -15
- package/docs/reference/components/menus/MapLegend.md +0 -32
- package/docs/reference/components/menus/MiniPictureLegend.md +0 -15
- package/docs/reference/components/menus/PictureLegend.md +0 -45
- package/docs/reference/components/menus/PictureMetadata.md +0 -32
- package/docs/reference/components/menus/PlayerOptions.md +0 -15
- package/docs/reference/components/menus/QualityScoreDoc.md +0 -15
- package/docs/reference/components/menus/ReportForm.md +0 -15
- package/docs/reference/components/menus/SemanticsDoc.md +0 -15
- package/docs/reference/components/menus/SemanticsDownload.md +0 -15
- package/docs/reference/components/menus/SemanticsFilters.md +0 -33
- package/docs/reference/components/menus/SemanticsList.md +0 -97
- package/docs/reference/components/menus/SemanticsMetadata.md +0 -15
- package/docs/reference/components/menus/ShareMenu.md +0 -32
- package/docs/reference/components/ui/AnnotationsSwitch.md +0 -32
- package/docs/reference/components/ui/Button.md +0 -40
- package/docs/reference/components/ui/ButtonGroup.md +0 -36
- package/docs/reference/components/ui/CopyButton.md +0 -41
- package/docs/reference/components/ui/Grade.md +0 -32
- package/docs/reference/components/ui/GradeFilter.md +0 -42
- package/docs/reference/components/ui/IconSwitch.md +0 -53
- package/docs/reference/components/ui/LinkButton.md +0 -45
- package/docs/reference/components/ui/ListGroup.md +0 -22
- package/docs/reference/components/ui/ListItem.md +0 -39
- package/docs/reference/components/ui/Loader.md +0 -56
- package/docs/reference/components/ui/Map.md +0 -150
- package/docs/reference/components/ui/MapMore.md +0 -150
- package/docs/reference/components/ui/Photo.md +0 -495
- package/docs/reference/components/ui/Popup.md +0 -56
- package/docs/reference/components/ui/ProgressBar.md +0 -32
- package/docs/reference/components/ui/QualityScore.md +0 -45
- package/docs/reference/components/ui/SearchBar.md +0 -63
- package/docs/reference/components/ui/SemanticsEditor.md +0 -113
- package/docs/reference/components/ui/SemanticsTable.md +0 -32
- package/docs/reference/components/ui/Switch.md +0 -49
- package/docs/reference/components/ui/TogglableGroup.md +0 -39
- package/docs/reference/components/ui/widgets/CopyCoordinates.md +0 -32
- package/docs/reference/components/ui/widgets/GeoSearch.md +0 -36
- package/docs/reference/components/ui/widgets/Legend.md +0 -58
- package/docs/reference/components/ui/widgets/LevelSelect.md +0 -16
- package/docs/reference/components/ui/widgets/MapFiltersButton.md +0 -37
- package/docs/reference/components/ui/widgets/MapLayersButton.md +0 -15
- package/docs/reference/components/ui/widgets/OSMEditors.md +0 -15
- package/docs/reference/components/ui/widgets/PictureLegendActions.md +0 -32
- package/docs/reference/components/ui/widgets/Player.md +0 -34
- package/docs/reference/components/ui/widgets/SemanticsFiltersButton.md +0 -15
- package/docs/reference/components/ui/widgets/Zoom.md +0 -15
- package/docs/reference/utils/API.md +0 -389
- package/docs/reference/utils/InitParameters.md +0 -68
- package/docs/reference/utils/MapStyleComposer.md +0 -408
- package/docs/reference/utils/PanoraMapProtocol.md +0 -28
- package/docs/reference/utils/PresetsManager.md +0 -43
- package/docs/reference/utils/SemanticsMapProtocol.md +0 -43
- package/docs/reference/utils/URLHandler.md +0 -114
- package/docs/reference.md +0 -99
- package/docs/shortcuts.md +0 -11
- package/docs/tutorials/aerial_imagery.md +0 -21
- package/docs/tutorials/authentication.md +0 -10
- package/docs/tutorials/custom_widgets.md +0 -59
- package/docs/tutorials/indoor_maps.md +0 -50
- package/docs/tutorials/map_style.md +0 -83
- package/docs/tutorials/migrate_v4.md +0 -153
- package/docs/tutorials/migrate_v5.md +0 -103
- package/docs/tutorials/semantics_overlays.md +0 -74
- package/docs/tutorials/synced_coverage.md +0 -43
- package/mkdocs.yml +0 -131
- package/public/editor.html +0 -53
- package/public/index.html +0 -70
- package/public/map.html +0 -55
- package/public/photo.html +0 -43
- package/public/servers.js +0 -15
- package/public/viewer.html +0 -79
- package/public/viewer_indoor.html +0 -48
- package/public/widgets.html +0 -366
- package/scripts/build.js +0 -217
- package/scripts/doc.js +0 -79
- package/scripts/start.js +0 -172
- package/scripts/test.js +0 -52
- package/src/components/core/index.js +0 -12
- package/src/components/index.js +0 -13
- package/src/components/index_photoviewer.js +0 -8
- package/src/components/layout/index.js +0 -9
- package/src/components/menus/index.js +0 -22
- package/src/components/menus/index_photoviewer.js +0 -13
- package/src/components/ui/index.js +0 -29
- package/src/components/ui/index_photoviewer.js +0 -23
- package/src/components/ui/widgets/index.js +0 -16
- package/src/components/ui/widgets/index_photoviewer.js +0 -9
- package/src/index.js +0 -8
- package/src/index_photoviewer.js +0 -6
- package/src/utils/index.js +0 -17
- package/src/utils/index_photoviewer.js +0 -16
- package/tests/components/core/Basic.test.js +0 -168
- package/tests/components/core/BasicMock.js +0 -25
- package/tests/components/core/CoverageMap.test.js +0 -20
- package/tests/components/core/Editor.test.js +0 -20
- package/tests/components/core/PhotoViewer.test.js +0 -57
- package/tests/components/core/Viewer.test.js +0 -85
- package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +0 -96
- package/tests/components/core/__snapshots__/Viewer.test.js.snap +0 -188
- package/tests/components/ui/CopyButton.test.js +0 -52
- package/tests/components/ui/Loader.test.js +0 -55
- package/tests/components/ui/Map.test.js +0 -145
- package/tests/components/ui/Photo.test.js +0 -437
- package/tests/components/ui/Popup.test.js +0 -26
- package/tests/components/ui/QualityScore.test.js +0 -18
- package/tests/components/ui/SearchBar.test.js +0 -110
- package/tests/components/ui/__snapshots__/CopyButton.test.js.snap +0 -33
- package/tests/components/ui/__snapshots__/Loader.test.js.snap +0 -56
- package/tests/components/ui/__snapshots__/Map.test.js.snap +0 -16
- package/tests/components/ui/__snapshots__/Photo.test.js.snap +0 -263
- package/tests/components/ui/__snapshots__/Popup.test.js.snap +0 -29
- package/tests/components/ui/__snapshots__/QualityScore.test.js.snap +0 -11
- package/tests/components/ui/__snapshots__/SearchBar.test.js.snap +0 -65
- package/tests/data/Map_geocoder_ban.json +0 -36
- package/tests/data/Map_geocoder_nominatim.json +0 -41
- package/tests/data/Viewer_pictures_1.json +0 -148
- package/tests/setupTests.js +0 -5
- package/tests/utils/API.test.js +0 -752
- package/tests/utils/InitParameters.test.js +0 -599
- package/tests/utils/MapStyleComposer.test.js +0 -697
- package/tests/utils/PresetsManager.test.js +0 -123
- package/tests/utils/URLHandler.test.js +0 -587
- package/tests/utils/__snapshots__/API.test.js.snap +0 -40
- package/tests/utils/__snapshots__/MapStyleComposer.test.js.snap +0 -767
- package/tests/utils/__snapshots__/URLHandler.test.js.snap +0 -21
- package/tests/utils/__snapshots__/geocoder.test.js.snap +0 -37
- package/tests/utils/__snapshots__/map.test.js.snap +0 -1249
- package/tests/utils/__snapshots__/picture.test.js.snap +0 -327
- package/tests/utils/__snapshots__/widgets.test.js.snap +0 -19
- package/tests/utils/geocoder.test.js +0 -37
- package/tests/utils/i18n.test.js +0 -111
- package/tests/utils/map.test.js +0 -200
- package/tests/utils/picture.test.js +0 -745
- package/tests/utils/semantics.test.js +0 -174
- package/tests/utils/utils.test.js +0 -358
- package/tests/utils/widgets.test.js +0 -31
- /package/{src → build}/components/core/Basic.css +0 -0
- /package/{src → build}/components/core/CoverageMap.css +0 -0
- /package/{src → build}/components/core/Editor.css +0 -0
- /package/{src → build}/components/core/PhotoViewer.css +0 -0
- /package/{src → build}/components/core/Viewer.css +0 -0
- /package/{src → build}/components/ui/ButtonGroup.css +0 -0
- /package/{src → build}/components/ui/Map.css +0 -0
- /package/{src → build}/components/ui/Photo.css +0 -0
- /package/{src → build}/components/ui/ProgressBar.js +0 -0
- /package/{src → build}/components/ui/widgets/GeoSearch.css +0 -0
- /package/{src → build}/components/ui/widgets/LevelSelect.css +0 -0
- /package/{src → build}/components/ui/widgets/Player.css +0 -0
- /package/{public → build}/favicon.ico +0 -0
- /package/{src → build}/img/arrow_360.svg +0 -0
- /package/{src → build}/img/arrow_flat.svg +0 -0
- /package/{src → build}/img/bg_aerial.jpg +0 -0
- /package/{src → build}/img/bg_streets.jpg +0 -0
- /package/{src → build}/img/loader_base.jpg +0 -0
- /package/{src → build}/img/logo_dead.svg +0 -0
- /package/{src → build}/img/marker.svg +0 -0
- /package/{src → build}/img/marker_blue.svg +0 -0
- /package/{src → build}/img/osm.svg +0 -0
- /package/{src → build}/img/panoramax.svg +0 -0
- /package/{src → build}/img/switch_big.svg +0 -0
- /package/{src → build}/img/switch_mini.svg +0 -0
- /package/{src → build}/img/wd.svg +0 -0
- /package/{src → build}/translations/ar.json +0 -0
- /package/{src → build}/translations/be.json +0 -0
- /package/{src → build}/translations/br.json +0 -0
- /package/{src → build}/translations/cy.json +0 -0
- /package/{src → build}/translations/da.json +0 -0
- /package/{src → build}/translations/de.json +0 -0
- /package/{src → build}/translations/en.json +0 -0
- /package/{src → build}/translations/eo.json +0 -0
- /package/{src → build}/translations/es.json +0 -0
- /package/{src → build}/translations/fi.json +0 -0
- /package/{src → build}/translations/fr.json +0 -0
- /package/{src → build}/translations/hu.json +0 -0
- /package/{src → build}/translations/it.json +0 -0
- /package/{src → build}/translations/ja.json +0 -0
- /package/{src → build}/translations/ko.json +0 -0
- /package/{src → build}/translations/nl.json +0 -0
- /package/{src → build}/translations/nn.json +0 -0
- /package/{src → build}/translations/pl.json +0 -0
- /package/{src → build}/translations/pt.json +0 -0
- /package/{src → build}/translations/pt_BR.json +0 -0
- /package/{src → build}/translations/sv.json +0 -0
- /package/{src → build}/translations/ti.json +0 -0
- /package/{src → build}/translations/tr.json +0 -0
- /package/{src → build}/translations/uk.json +0 -0
- /package/{src → build}/translations/zh_Hant.json +0 -0
- /package/{src → build}/utils/PanoraMapProtocol.js +0 -0
- /package/{src → build}/utils/services.js +0 -0
package/build/map.html
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
6
|
+
<title>Panoramax Coverage Map</title>
|
|
7
|
+
<style>
|
|
8
|
+
#coverage {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 95%;
|
|
11
|
+
margin: 2.5%;
|
|
12
|
+
height: 400px;
|
|
13
|
+
}
|
|
14
|
+
#coverage.fullpage {
|
|
15
|
+
position: fixed;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
height: unset;
|
|
21
|
+
width: unset;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/maplibre-gl@5.21.1/dist/maplibre-gl.css" />
|
|
27
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core@5.14.1/index.css" />
|
|
28
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/virtual-tour-plugin@5.14.1/index.css" />
|
|
29
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/gallery-plugin@5.14.1/index.css" />
|
|
30
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/markers-plugin@5.14.1/index.css" />
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/atkinson-hyperlegible-next/index.css" />
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<script type="importmap">
|
|
35
|
+
{
|
|
36
|
+
"imports": {
|
|
37
|
+
"@fortawesome/fontawesome-svg-core": "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-svg-core@6.7.2/index.mjs",
|
|
38
|
+
"@fortawesome/free-regular-svg-icons": "https://cdn.jsdelivr.net/npm/@fortawesome/free-regular-svg-icons@6.7.2/index.mjs",
|
|
39
|
+
"@fortawesome/free-solid-svg-icons": "https://cdn.jsdelivr.net/npm/@fortawesome/free-solid-svg-icons@6.7.2/index.mjs",
|
|
40
|
+
"@maplibre/vt-pbf": "https://cdn.jsdelivr.net/npm/@maplibre/vt-pbf@4.3.0/dist/index.es.js",
|
|
41
|
+
"@mapbox/vector-tile": "https://cdn.jsdelivr.net/npm/@mapbox/vector-tile@2.0.4/index.js",
|
|
42
|
+
"@photo-sphere-viewer/core": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core@5.14.1/index.module.js",
|
|
43
|
+
"@photo-sphere-viewer/equirectangular-tiles-adapter": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/equirectangular-tiles-adapter@5.14.1/index.module.js",
|
|
44
|
+
"@photo-sphere-viewer/gallery-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/gallery-plugin@5.14.1/index.module.js",
|
|
45
|
+
"@photo-sphere-viewer/markers-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/markers-plugin@5.14.1/index.module.js",
|
|
46
|
+
"@photo-sphere-viewer/compass-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/compass-plugin@5.14.1/index.module.js",
|
|
47
|
+
"@photo-sphere-viewer/virtual-tour-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/virtual-tour-plugin@5.14.1/index.module.js",
|
|
48
|
+
"geojson-vt": "https://cdn.jsdelivr.net/npm/geojson-vt@4.0.2/src/index.js",
|
|
49
|
+
"iconify-icon": "https://cdn.jsdelivr.net/npm/iconify-icon@3.0.2/dist/iconify-icon.mjs",
|
|
50
|
+
"json5": "https://cdn.jsdelivr.net/npm/json5@2.2.3/dist/index.min.mjs",
|
|
51
|
+
"lit": "https://cdn.jsdelivr.net/npm/lit@3.3.2/index.js",
|
|
52
|
+
"lit/": "https://cdn.jsdelivr.net/npm/lit@3.3.2/",
|
|
53
|
+
"lit-html": "https://cdn.jsdelivr.net/npm/lit-html@3.3.2/lit-html.js",
|
|
54
|
+
"lit-html/": "https://cdn.jsdelivr.net/npm/lit-html@3.3.2/",
|
|
55
|
+
"lit-element/": "https://cdn.jsdelivr.net/npm/lit-element@4.2.2/",
|
|
56
|
+
"maplibre-gl": "https://cdn.jsdelivr.net/npm/maplibre-gl@5.21.1/dist/maplibre-gl.js",
|
|
57
|
+
"pmtiles": "https://cdn.jsdelivr.net/npm/pmtiles@4.4.0/dist/esm/index.js",
|
|
58
|
+
"query-selector-shadow-dom": "https://cdn.jsdelivr.net/npm/query-selector-shadow-dom@1.0.0/dist/querySelectorShadowDom.js",
|
|
59
|
+
"@panoramax/web-viewer": "./src/index.js",
|
|
60
|
+
"@lit/reactive-element": "https://cdn.jsdelivr.net/npm/@lit/reactive-element@2.1.2/reactive-element.js",
|
|
61
|
+
"@mapbox/point-geometry": "https://cdn.jsdelivr.net/npm/@mapbox/point-geometry@1.1.0/index.js",
|
|
62
|
+
"fflate": "https://cdn.jsdelivr.net/npm/fflate@0.8.2/esm/browser.js",
|
|
63
|
+
"pbf": "https://cdn.jsdelivr.net/npm/pbf@4.0.1/index.js",
|
|
64
|
+
"three": "https://cdn.jsdelivr.net/npm/three@0.179.1/build/three.module.js"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
<noscript>
|
|
69
|
+
You need to enable JavaScript to run this app.
|
|
70
|
+
</noscript>
|
|
71
|
+
|
|
72
|
+
<pnx-coverage-map
|
|
73
|
+
id="coverage"
|
|
74
|
+
class="fullpage"
|
|
75
|
+
></pnx-coverage-map>
|
|
76
|
+
|
|
77
|
+
<script type="module" src="./index.js"></script>
|
|
78
|
+
<script src="./servers.js"></script>
|
|
79
|
+
<script>
|
|
80
|
+
// Retrieve component from DOM
|
|
81
|
+
var coverage = document.getElementById("coverage");
|
|
82
|
+
coverage.setAttribute("endpoint", server);
|
|
83
|
+
|
|
84
|
+
coverage.addEventListener("ready", () => {
|
|
85
|
+
// Listen to sequence hovered on map
|
|
86
|
+
coverage.map.on("sequence-hover", e => {
|
|
87
|
+
console.log("Hovered sequence", e.seqId);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Listen to user clicks on map
|
|
91
|
+
coverage.addEventListener("select", e => {
|
|
92
|
+
console.log("Selected sequence", e.detail.seqId, "picture", e.detail.picId);
|
|
93
|
+
});
|
|
94
|
+
}, {once: true});
|
|
95
|
+
</script>
|
|
96
|
+
</body>
|
|
97
|
+
</html>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@panoramax/web-viewer",
|
|
3
|
+
"version": "4.4.0",
|
|
4
|
+
"description": "Panoramax web viewer for geolocated pictures",
|
|
5
|
+
"main": "./build/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"build"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./build/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"author": "Panoramax team",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"start": "web-dev-server --config config/web-dev-server.config.mjs",
|
|
18
|
+
"build": "node scripts/build.js",
|
|
19
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
20
|
+
"lint": "npx eslint --fix src/",
|
|
21
|
+
"doc": "node scripts/doc.js",
|
|
22
|
+
"trypublish": "npm publish || true"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://gitlab.com/panoramax/clients/web-viewer"
|
|
27
|
+
},
|
|
28
|
+
"homepage": ".",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"library",
|
|
31
|
+
"panoramax",
|
|
32
|
+
"pictures",
|
|
33
|
+
"geolocated"
|
|
34
|
+
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.39.4",
|
|
41
|
+
"@web/dev-server": "^0.4.6",
|
|
42
|
+
"@web/dev-server-rollup": "^0.6.4",
|
|
43
|
+
"eslint": "^9.39.4",
|
|
44
|
+
"eslint-plugin-import": "^2.32.0",
|
|
45
|
+
"eslint-plugin-jest": "^29.15.2",
|
|
46
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
47
|
+
"globals": "^17.5.0",
|
|
48
|
+
"identity-obj-proxy": "^3.0.0",
|
|
49
|
+
"jest": "^30.3.0",
|
|
50
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
51
|
+
"jest-fixed-jsdom": "^0.0.11",
|
|
52
|
+
"jsdoc-to-markdown": "^9.1.1",
|
|
53
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
54
|
+
"whatwg-url": "^16.0.1"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@fontsource/atkinson-hyperlegible-next": "^5.2.2",
|
|
58
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
59
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
60
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
61
|
+
"@maplibre/vt-pbf": "^4.0.3",
|
|
62
|
+
"@photo-sphere-viewer/core": "5.14.1",
|
|
63
|
+
"@photo-sphere-viewer/equirectangular-tiles-adapter": "5.14.1",
|
|
64
|
+
"@photo-sphere-viewer/gallery-plugin": "5.14.1",
|
|
65
|
+
"@photo-sphere-viewer/markers-plugin": "5.14.1",
|
|
66
|
+
"@photo-sphere-viewer/virtual-tour-plugin": "5.14.1",
|
|
67
|
+
"geojson-vt": "^4.0.2",
|
|
68
|
+
"iconify-icon": "^3.0.0",
|
|
69
|
+
"json5": "^2.2.3",
|
|
70
|
+
"lit": "^3.2.1",
|
|
71
|
+
"maplibre-gl": "^5.17.0",
|
|
72
|
+
"pmtiles": "^4.3.0",
|
|
73
|
+
"query-selector-shadow-dom": "^1.0.1"
|
|
74
|
+
},
|
|
75
|
+
"panoramax": {
|
|
76
|
+
"importcss": [
|
|
77
|
+
"maplibre-gl@5.21.1/dist/maplibre-gl.css",
|
|
78
|
+
"@photo-sphere-viewer/core@5.14.1/index.css",
|
|
79
|
+
"@photo-sphere-viewer/virtual-tour-plugin@5.14.1/index.css",
|
|
80
|
+
"@photo-sphere-viewer/gallery-plugin@5.14.1/index.css",
|
|
81
|
+
"@photo-sphere-viewer/markers-plugin@5.14.1/index.css",
|
|
82
|
+
"@fontsource/atkinson-hyperlegible-next/index.css"
|
|
83
|
+
],
|
|
84
|
+
"importmap": {
|
|
85
|
+
"@fortawesome/fontawesome-svg-core": "@6.7.2/index.mjs",
|
|
86
|
+
"@fortawesome/free-regular-svg-icons": "@6.7.2/index.mjs",
|
|
87
|
+
"@fortawesome/free-solid-svg-icons": "@6.7.2/index.mjs",
|
|
88
|
+
"@maplibre/vt-pbf": "@4.3.0/dist/index.es.js",
|
|
89
|
+
"@mapbox/vector-tile": "@2.0.4/index.js",
|
|
90
|
+
"@photo-sphere-viewer/core": "@5.14.1/index.module.js",
|
|
91
|
+
"@photo-sphere-viewer/equirectangular-tiles-adapter": "@5.14.1/index.module.js",
|
|
92
|
+
"@photo-sphere-viewer/gallery-plugin": "@5.14.1/index.module.js",
|
|
93
|
+
"@photo-sphere-viewer/markers-plugin": "@5.14.1/index.module.js",
|
|
94
|
+
"@photo-sphere-viewer/compass-plugin": "@5.14.1/index.module.js",
|
|
95
|
+
"@photo-sphere-viewer/virtual-tour-plugin": "@5.14.1/index.module.js",
|
|
96
|
+
"geojson-vt": "@4.0.2/src/index.js",
|
|
97
|
+
"iconify-icon": "@3.0.2/dist/iconify-icon.mjs",
|
|
98
|
+
"json5": "@2.2.3/dist/index.min.mjs",
|
|
99
|
+
"lit": "@3.3.2/index.js",
|
|
100
|
+
"lit/": "@3.3.2/",
|
|
101
|
+
"lit-html": "@3.3.2/lit-html.js",
|
|
102
|
+
"lit-html/": "@3.3.2/",
|
|
103
|
+
"lit-element/": "@4.2.2/",
|
|
104
|
+
"maplibre-gl": "@5.21.1/dist/maplibre-gl.js",
|
|
105
|
+
"pmtiles": "@4.4.0/dist/esm/index.js",
|
|
106
|
+
"query-selector-shadow-dom": "@1.0.0/dist/querySelectorShadowDom.js",
|
|
107
|
+
"@panoramax/web-viewer": "./src/index.js",
|
|
108
|
+
"@lit/reactive-element": "@2.1.2/reactive-element.js",
|
|
109
|
+
"@mapbox/point-geometry": "@1.1.0/index.js",
|
|
110
|
+
"fflate": "@0.8.2/esm/browser.js",
|
|
111
|
+
"pbf": "@4.0.1/index.js",
|
|
112
|
+
"three": "@0.179.1/build/three.module.js"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"jest": {
|
|
116
|
+
"clearMocks": true,
|
|
117
|
+
"testPathIgnorePatterns": [
|
|
118
|
+
"<rootDir>/node_modules/",
|
|
119
|
+
"<rootDir>/build"
|
|
120
|
+
],
|
|
121
|
+
"transform": {},
|
|
122
|
+
"testEnvironment": "jest-fixed-jsdom",
|
|
123
|
+
"testEnvironmentOptions": {
|
|
124
|
+
"resources": "usable",
|
|
125
|
+
"runScripts": "dangerously"
|
|
126
|
+
},
|
|
127
|
+
"globals": {
|
|
128
|
+
"window": {}
|
|
129
|
+
},
|
|
130
|
+
"modulePaths": [
|
|
131
|
+
"<rootDir>"
|
|
132
|
+
],
|
|
133
|
+
"moduleNameMapper": {
|
|
134
|
+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/config/jest/fileMock.js",
|
|
135
|
+
"\\.css$": "identity-obj-proxy"
|
|
136
|
+
},
|
|
137
|
+
"setupFilesAfterEnv": [
|
|
138
|
+
"<rootDir>/config/jest/mocks.js"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
}
|
package/build/photo.html
CHANGED
|
@@ -1 +1,85 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
6
|
+
<title>Panoramax Photo Viewer</title>
|
|
7
|
+
<style>
|
|
8
|
+
#viewer {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 95%;
|
|
11
|
+
margin: 2.5%;
|
|
12
|
+
height: 400px;
|
|
13
|
+
}
|
|
14
|
+
#viewer.fullpage {
|
|
15
|
+
position: fixed;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
height: unset;
|
|
21
|
+
width: unset;
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
|
|
26
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/maplibre-gl@5.21.1/dist/maplibre-gl.css" />
|
|
27
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core@5.14.1/index.css" />
|
|
28
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/virtual-tour-plugin@5.14.1/index.css" />
|
|
29
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/gallery-plugin@5.14.1/index.css" />
|
|
30
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/markers-plugin@5.14.1/index.css" />
|
|
31
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/atkinson-hyperlegible-next/index.css" />
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<script type="importmap">
|
|
35
|
+
{
|
|
36
|
+
"imports": {
|
|
37
|
+
"@fortawesome/fontawesome-svg-core": "https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-svg-core@6.7.2/index.mjs",
|
|
38
|
+
"@fortawesome/free-regular-svg-icons": "https://cdn.jsdelivr.net/npm/@fortawesome/free-regular-svg-icons@6.7.2/index.mjs",
|
|
39
|
+
"@fortawesome/free-solid-svg-icons": "https://cdn.jsdelivr.net/npm/@fortawesome/free-solid-svg-icons@6.7.2/index.mjs",
|
|
40
|
+
"@maplibre/vt-pbf": "https://cdn.jsdelivr.net/npm/@maplibre/vt-pbf@4.3.0/dist/index.es.js",
|
|
41
|
+
"@mapbox/vector-tile": "https://cdn.jsdelivr.net/npm/@mapbox/vector-tile@2.0.4/index.js",
|
|
42
|
+
"@photo-sphere-viewer/core": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/core@5.14.1/index.module.js",
|
|
43
|
+
"@photo-sphere-viewer/equirectangular-tiles-adapter": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/equirectangular-tiles-adapter@5.14.1/index.module.js",
|
|
44
|
+
"@photo-sphere-viewer/gallery-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/gallery-plugin@5.14.1/index.module.js",
|
|
45
|
+
"@photo-sphere-viewer/markers-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/markers-plugin@5.14.1/index.module.js",
|
|
46
|
+
"@photo-sphere-viewer/compass-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/compass-plugin@5.14.1/index.module.js",
|
|
47
|
+
"@photo-sphere-viewer/virtual-tour-plugin": "https://cdn.jsdelivr.net/npm/@photo-sphere-viewer/virtual-tour-plugin@5.14.1/index.module.js",
|
|
48
|
+
"geojson-vt": "https://cdn.jsdelivr.net/npm/geojson-vt@4.0.2/src/index.js",
|
|
49
|
+
"iconify-icon": "https://cdn.jsdelivr.net/npm/iconify-icon@3.0.2/dist/iconify-icon.mjs",
|
|
50
|
+
"json5": "https://cdn.jsdelivr.net/npm/json5@2.2.3/dist/index.min.mjs",
|
|
51
|
+
"lit": "https://cdn.jsdelivr.net/npm/lit@3.3.2/index.js",
|
|
52
|
+
"lit/": "https://cdn.jsdelivr.net/npm/lit@3.3.2/",
|
|
53
|
+
"lit-html": "https://cdn.jsdelivr.net/npm/lit-html@3.3.2/lit-html.js",
|
|
54
|
+
"lit-html/": "https://cdn.jsdelivr.net/npm/lit-html@3.3.2/",
|
|
55
|
+
"lit-element/": "https://cdn.jsdelivr.net/npm/lit-element@4.2.2/",
|
|
56
|
+
"maplibre-gl": "https://cdn.jsdelivr.net/npm/maplibre-gl@5.21.1/dist/maplibre-gl.js",
|
|
57
|
+
"pmtiles": "https://cdn.jsdelivr.net/npm/pmtiles@4.4.0/dist/esm/index.js",
|
|
58
|
+
"query-selector-shadow-dom": "https://cdn.jsdelivr.net/npm/query-selector-shadow-dom@1.0.0/dist/querySelectorShadowDom.js",
|
|
59
|
+
"@panoramax/web-viewer": "./src/index.js",
|
|
60
|
+
"@lit/reactive-element": "https://cdn.jsdelivr.net/npm/@lit/reactive-element@2.1.2/reactive-element.js",
|
|
61
|
+
"@mapbox/point-geometry": "https://cdn.jsdelivr.net/npm/@mapbox/point-geometry@1.1.0/index.js",
|
|
62
|
+
"fflate": "https://cdn.jsdelivr.net/npm/fflate@0.8.2/esm/browser.js",
|
|
63
|
+
"pbf": "https://cdn.jsdelivr.net/npm/pbf@4.0.1/index.js",
|
|
64
|
+
"three": "https://cdn.jsdelivr.net/npm/three@0.179.1/build/three.module.js"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
<noscript>
|
|
69
|
+
You need to enable JavaScript to run this app.
|
|
70
|
+
</noscript>
|
|
71
|
+
|
|
72
|
+
<pnx-photo-viewer
|
|
73
|
+
id="viewer"
|
|
74
|
+
class="fullpage"
|
|
75
|
+
picture="329af5c6-4761-4a6d-9c1e-674fd6daa8b6"
|
|
76
|
+
></pnx-photo-viewer>
|
|
77
|
+
|
|
78
|
+
<script type="module" src="./index_photoviewer.js"></script>
|
|
79
|
+
<script src="./servers.js"></script>
|
|
80
|
+
<script>
|
|
81
|
+
var viewer = document.getElementById("viewer");
|
|
82
|
+
viewer.setAttribute("endpoint", server);
|
|
83
|
+
</script>
|
|
84
|
+
</body>
|
|
85
|
+
</html>
|
package/build/servers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
let servers = {
|
|
2
2
|
meta: "https://explore.panoramax.fr/api",
|
|
3
3
|
ign: "https://panoramax.ign.fr/api",
|
|
4
4
|
osmfr: "https://panoramax.openstreetmap.fr/api",
|
|
@@ -6,9 +6,8 @@ var servers = {
|
|
|
6
6
|
dev: "https://dev.panoramax.xyz/api",
|
|
7
7
|
cartocite: "https://panoramax.cartocite.fr/api",
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var server = servers[urlParams.get("server") || "meta"];
|
|
9
|
+
let urlParams = new URLSearchParams(window.location.search);
|
|
10
|
+
let server = servers[urlParams.get("server") || "meta"];
|
|
12
11
|
if(!server) {
|
|
13
12
|
console.error("Unrecognized server: "+urlParams.get("server"));
|
|
14
13
|
server = servers.meta;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNullId } from "./utils";
|
|
1
|
+
import { isNullId } from "./utils.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* API contains various utility functions to communicate with Panoramax/STAC API
|
|
@@ -16,7 +16,7 @@ import { isNullId } from "./utils";
|
|
|
16
16
|
export default class API extends EventTarget {
|
|
17
17
|
constructor(endpoint, options = {}) {
|
|
18
18
|
super();
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
if(endpoint === null || endpoint === undefined || typeof endpoint !== "string") {
|
|
21
21
|
const e = new Error("endpoint parameter is empty or not a valid string");
|
|
22
22
|
this.dispatchEvent(new CustomEvent("broken", {detail: {error: e}}));
|
|
@@ -84,10 +84,10 @@ export default class API extends EventTarget {
|
|
|
84
84
|
* @reject {string} Error message
|
|
85
85
|
*/
|
|
86
86
|
onceReady() {
|
|
87
|
-
if(this._isReady
|
|
87
|
+
if(this._isReady === -1) {
|
|
88
88
|
return Promise.reject("Viewer failed to communicate with API");
|
|
89
89
|
}
|
|
90
|
-
else if(this._isReady
|
|
90
|
+
else if(this._isReady === 1) {
|
|
91
91
|
return Promise.resolve("API is ready");
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
@@ -101,7 +101,7 @@ export default class API extends EventTarget {
|
|
|
101
101
|
* @returns {boolean} True if the API is ready, false otherwise.
|
|
102
102
|
*/
|
|
103
103
|
isReady() {
|
|
104
|
-
return this._isReady
|
|
104
|
+
return this._isReady === 1;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
@@ -233,7 +233,7 @@ export default class API extends EventTarget {
|
|
|
233
233
|
|
|
234
234
|
supportedLinks.forEach(sl => {
|
|
235
235
|
// Find link in landing
|
|
236
|
-
const ll = landing.links.find(ll => ll.rel
|
|
236
|
+
const ll = landing.links.find(ll => ll.rel === sl.rel && ll.type === sl.type);
|
|
237
237
|
|
|
238
238
|
// No link found
|
|
239
239
|
if(!ll) {
|
|
@@ -313,7 +313,7 @@ export default class API extends EventTarget {
|
|
|
313
313
|
return (url) => {
|
|
314
314
|
// As MapLibre will use this function for all its calls
|
|
315
315
|
// We must make sure fetch options are sent only for
|
|
316
|
-
//
|
|
316
|
+
// The STAC API calls, particularly the tiles endpoint
|
|
317
317
|
if(url.startsWith(this._endpoint)) {
|
|
318
318
|
if(Object.keys(fetchOpts).length > 0) {
|
|
319
319
|
return {
|
|
@@ -375,7 +375,7 @@ export default class API extends EventTarget {
|
|
|
375
375
|
if(!this.isReady()) { throw new Error("API is not ready to use"); }
|
|
376
376
|
try {
|
|
377
377
|
API.isIdValid(seqId);
|
|
378
|
-
return fetch(
|
|
378
|
+
return await fetch(
|
|
379
379
|
next || `${this._endpoints.collections}/${seqId}/items${limit ? "?limit="+limit : ""}`,
|
|
380
380
|
this._getFetchOptions(true)
|
|
381
381
|
)
|
|
@@ -392,7 +392,7 @@ export default class API extends EventTarget {
|
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
catch(e) {
|
|
395
|
-
return Promise.reject(e);
|
|
395
|
+
return await Promise.reject(e);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
|
|
@@ -406,7 +406,7 @@ export default class API extends EventTarget {
|
|
|
406
406
|
* @param {string} [seqId] The sequence ID to filter on (by default, no filter)
|
|
407
407
|
* @returns {string} The corresponding URL
|
|
408
408
|
*/
|
|
409
|
-
getPicturesAroundCoordinatesUrl(lat, lon, factor = 0.0005, limit, seqId) {
|
|
409
|
+
getPicturesAroundCoordinatesUrl(lat, lon, factor = 0.0005, limit = null, seqId = null) {
|
|
410
410
|
if(!this.isReady()) { throw new Error("API is not ready to use"); }
|
|
411
411
|
|
|
412
412
|
if(isNaN(parseFloat(lat)) || isNaN(parseFloat(lon))) {
|
|
@@ -466,10 +466,10 @@ export default class API extends EventTarget {
|
|
|
466
466
|
|
|
467
467
|
let visualFallback = null;
|
|
468
468
|
for(let a of Object.values(picture.assets)) {
|
|
469
|
-
if(a.roles.includes("thumbnail") && a.type
|
|
469
|
+
if(a.roles.includes("thumbnail") && a.type === "image/jpeg" && API.isValidHttpUrl(a.href)) {
|
|
470
470
|
return this.cleanResourceURL(a.href);
|
|
471
471
|
}
|
|
472
|
-
else if(a.roles.includes("visual") && a.type
|
|
472
|
+
else if(a.roles.includes("visual") && a.type === "image/jpeg" && API.isValidHttpUrl(a.href)) {
|
|
473
473
|
visualFallback = this.cleanResourceURL(a.href);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
@@ -507,7 +507,7 @@ export default class API extends EventTarget {
|
|
|
507
507
|
return fetch(url, this._getFetchOptions())
|
|
508
508
|
.then(res => res.json())
|
|
509
509
|
.then(res => {
|
|
510
|
-
if(!Array.isArray(res.features) || res.features.length
|
|
510
|
+
if(!Array.isArray(res.features) || res.features.length === 0) {
|
|
511
511
|
return null;
|
|
512
512
|
}
|
|
513
513
|
|
|
@@ -526,7 +526,7 @@ export default class API extends EventTarget {
|
|
|
526
526
|
*/
|
|
527
527
|
getPictureThumbnailURL(picId, seqId) {
|
|
528
528
|
if(!this.isReady()) { throw new Error("API is not ready to use"); }
|
|
529
|
-
|
|
529
|
+
|
|
530
530
|
if(!picId) { return Promise.resolve(null); }
|
|
531
531
|
|
|
532
532
|
// Look for a dedicated endpoint in API
|
|
@@ -547,7 +547,7 @@ export default class API extends EventTarget {
|
|
|
547
547
|
return fetch(`${this._endpoints.search}?ids=${picId}`, this._getFetchOptions())
|
|
548
548
|
.then(res => res.json())
|
|
549
549
|
.then(res => {
|
|
550
|
-
if(!res || !Array.isArray(res.features) || res.features.length
|
|
550
|
+
if(!res || !Array.isArray(res.features) || res.features.length === 0) { return null; }
|
|
551
551
|
return this.findThumbnailInPictureFeature(res.features.pop());
|
|
552
552
|
});
|
|
553
553
|
}
|
|
@@ -561,7 +561,7 @@ export default class API extends EventTarget {
|
|
|
561
561
|
*/
|
|
562
562
|
getRSSURL(bbox) {
|
|
563
563
|
if(!this.isReady()) { throw new Error("API is not ready to use"); }
|
|
564
|
-
|
|
564
|
+
|
|
565
565
|
if(this._endpoints.rss) {
|
|
566
566
|
let url = this._endpoints.rss;
|
|
567
567
|
if(bbox) {
|
|
@@ -676,7 +676,7 @@ export default class API extends EventTarget {
|
|
|
676
676
|
try {
|
|
677
677
|
txt = JSON.parse(txt)["message"];
|
|
678
678
|
}
|
|
679
|
-
catch(e) {}
|
|
679
|
+
catch(e) {}
|
|
680
680
|
return Promise.reject(txt);
|
|
681
681
|
}
|
|
682
682
|
return res.json();
|
|
@@ -693,12 +693,12 @@ export default class API extends EventTarget {
|
|
|
693
693
|
*/
|
|
694
694
|
sendPictureSemantics(picMeta, semanticsDiff) {
|
|
695
695
|
// Fake send version
|
|
696
|
-
//
|
|
697
|
-
//
|
|
698
|
-
//
|
|
696
|
+
// Const newMeta = Object.assign({}, picMeta);
|
|
697
|
+
// NewMeta.properties.semantics = newMeta.properties.semantics.concat(semanticsDiff).filter(t => (
|
|
698
|
+
// T.action != "delete"
|
|
699
699
|
// && !semanticsDiff.find(t2 => t.key == t2.key && t.value == t2.value && t2.action == "delete")
|
|
700
700
|
// ));
|
|
701
|
-
//
|
|
701
|
+
// Return Promise.resolve(newMeta);
|
|
702
702
|
|
|
703
703
|
if(!this.isReady()) { throw new Error("API is not ready to use"); }
|
|
704
704
|
if(!picMeta?.sequence?.id || !picMeta?.id) { throw new Error("Missing IDs from picture"); }
|
|
@@ -715,7 +715,7 @@ export default class API extends EventTarget {
|
|
|
715
715
|
body: JSON.stringify({ semantics: semanticsDiff }),
|
|
716
716
|
headers: { "Content-Type": "application/json" },
|
|
717
717
|
};
|
|
718
|
-
|
|
718
|
+
|
|
719
719
|
return fetch(picLink, opts)
|
|
720
720
|
.then(async res => {
|
|
721
721
|
if(res.status >= 400) {
|
|
@@ -723,7 +723,7 @@ export default class API extends EventTarget {
|
|
|
723
723
|
try {
|
|
724
724
|
txt = JSON.parse(txt)["message"];
|
|
725
725
|
}
|
|
726
|
-
catch(e) {}
|
|
726
|
+
catch(e) {}
|
|
727
727
|
return Promise.reject(txt);
|
|
728
728
|
}
|
|
729
729
|
return res.json();
|
|
@@ -741,7 +741,7 @@ export default class API extends EventTarget {
|
|
|
741
741
|
*/
|
|
742
742
|
createPictureAnnotation(picMeta, shape, semanticsDiff) {
|
|
743
743
|
// Fake send version
|
|
744
|
-
//
|
|
744
|
+
// Return Promise.resolve({
|
|
745
745
|
// "id": "fe298d59-a9c6-4680-8e76-6efe82d97f48",
|
|
746
746
|
// "semantics": semanticsDiff,
|
|
747
747
|
// "shape": { "type": "Polygon", "coordinates": [[
|
|
@@ -771,7 +771,7 @@ export default class API extends EventTarget {
|
|
|
771
771
|
}),
|
|
772
772
|
headers: { "Content-Type": "application/json" },
|
|
773
773
|
};
|
|
774
|
-
|
|
774
|
+
|
|
775
775
|
return fetch(picLink, opts)
|
|
776
776
|
.then(async res => {
|
|
777
777
|
if(res.status >= 400) {
|
|
@@ -779,7 +779,7 @@ export default class API extends EventTarget {
|
|
|
779
779
|
try {
|
|
780
780
|
txt = JSON.parse(txt)["message"];
|
|
781
781
|
}
|
|
782
|
-
catch(e) {}
|
|
782
|
+
catch(e) {}
|
|
783
783
|
return Promise.reject(txt);
|
|
784
784
|
}
|
|
785
785
|
return res.json();
|
|
@@ -796,7 +796,7 @@ export default class API extends EventTarget {
|
|
|
796
796
|
*/
|
|
797
797
|
editPictureAnnotation(annotationId, semanticsDiff) {
|
|
798
798
|
// Fake send version
|
|
799
|
-
//
|
|
799
|
+
// Return Promise.resolve({
|
|
800
800
|
// "id": annotationId,
|
|
801
801
|
// "semantics": semanticsDiff,
|
|
802
802
|
// "shape": {
|
|
@@ -814,7 +814,7 @@ export default class API extends EventTarget {
|
|
|
814
814
|
body: JSON.stringify({ semantics: semanticsDiff }),
|
|
815
815
|
headers: { "Content-Type": "application/json" },
|
|
816
816
|
};
|
|
817
|
-
|
|
817
|
+
|
|
818
818
|
return fetch(annotLink, opts)
|
|
819
819
|
.then(async res => {
|
|
820
820
|
if(res.status >= 400) {
|
|
@@ -822,7 +822,7 @@ export default class API extends EventTarget {
|
|
|
822
822
|
try {
|
|
823
823
|
txt = JSON.parse(txt)["message"];
|
|
824
824
|
}
|
|
825
|
-
catch(e) {}
|
|
825
|
+
catch(e) {}
|
|
826
826
|
return Promise.reject(txt);
|
|
827
827
|
}
|
|
828
828
|
return res.json();
|
|
@@ -838,8 +838,8 @@ export default class API extends EventTarget {
|
|
|
838
838
|
*/
|
|
839
839
|
deletePictureAnnotation(annotationId) {
|
|
840
840
|
// Fake send version
|
|
841
|
-
//
|
|
842
|
-
//
|
|
841
|
+
// Console.log("Delete", annotationId);
|
|
842
|
+
// Return Promise.resolve(true);
|
|
843
843
|
|
|
844
844
|
if(!this.isReady()) { throw new Error("API is not ready to use"); }
|
|
845
845
|
let annotLink = `${this._endpoint}/annotations/${annotationId}`;
|
|
@@ -848,7 +848,7 @@ export default class API extends EventTarget {
|
|
|
848
848
|
...this._getFetchOptions(),
|
|
849
849
|
method: "DELETE",
|
|
850
850
|
};
|
|
851
|
-
|
|
851
|
+
|
|
852
852
|
return fetch(annotLink, opts)
|
|
853
853
|
.then(async res => {
|
|
854
854
|
if(res.status >= 400) {
|
|
@@ -856,7 +856,7 @@ export default class API extends EventTarget {
|
|
|
856
856
|
try {
|
|
857
857
|
txt = JSON.parse(txt)["message"];
|
|
858
858
|
}
|
|
859
|
-
catch(e) {}
|
|
859
|
+
catch(e) {}
|
|
860
860
|
return Promise.reject(txt);
|
|
861
861
|
}
|
|
862
862
|
return true;
|