@panoramax/web-viewer 4.1.0-develop-c921ed43 → 4.1.0-develop-2b222b1c
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/CHANGELOG.md +1 -0
- package/build/index.js +4 -4
- package/build/index.js.map +1 -1
- package/build/photoviewer.css +36 -0
- package/build/photoviewer.css.map +1 -0
- package/build/photoviewer.js +2257 -0
- package/build/photoviewer.js.map +1 -0
- package/config/paths.js +1 -0
- package/config/webpack.config.js +44 -165
- package/docs/index.md +14 -3
- package/package.json +1 -1
- package/src/components/core/Basic.js +2 -2
- package/src/components/core/Viewer.js +0 -1
- package/src/components/index.js +2 -2
- package/src/components/index_photoviewer.js +8 -0
- package/src/components/menus/index_photoviewer.js +11 -0
- package/src/components/ui/index.js +1 -1
- package/src/components/ui/index_photoviewer.js +22 -0
- package/src/components/ui/widgets/Zoom.js +1 -1
- package/src/components/ui/widgets/index_photoviewer.js +9 -0
- package/src/index.js +2 -2
- package/src/index_photoviewer.js +6 -0
- package/src/utils/API.js +3 -1
- package/src/utils/geocoder.js +2 -5
- package/src/utils/index_photoviewer.js +15 -0
- package/src/utils/map.js +0 -1
- package/src/utils/services.js +8 -0
- package/tests/utils/__snapshots__/geocoder.test.js.snap +8 -8
package/config/paths.js
CHANGED
|
@@ -56,6 +56,7 @@ module.exports = {
|
|
|
56
56
|
appHtmlPhotoViewer: resolveApp('public/photo.html'),
|
|
57
57
|
appHtmlWidgets: resolveApp('public/widgets.html'),
|
|
58
58
|
appLibIndexJs: resolveModule(resolveApp, 'src/index'),
|
|
59
|
+
appLibPhotoViewerJs: resolveModule(resolveApp, 'src/index_photoviewer'),
|
|
59
60
|
appPackageJson: resolveApp('package.json'),
|
|
60
61
|
appSrc: resolveApp('src'),
|
|
61
62
|
appSrcLib: resolveApp('src'),
|
package/config/webpack.config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
1
2
|
const fs = require('fs');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
const webpack = require('webpack');
|
|
@@ -211,6 +212,34 @@ module.exports = function (webpackEnv) {
|
|
|
211
212
|
return loaders;
|
|
212
213
|
};
|
|
213
214
|
|
|
215
|
+
const getHtmlPlugin = (filename, template) => new HtmlWebpackPlugin(
|
|
216
|
+
Object.assign(
|
|
217
|
+
{},
|
|
218
|
+
{
|
|
219
|
+
inject: true,
|
|
220
|
+
filename: filename,
|
|
221
|
+
template: template,
|
|
222
|
+
chunks: ["index"],
|
|
223
|
+
},
|
|
224
|
+
isEnvProduction
|
|
225
|
+
? {
|
|
226
|
+
minify: {
|
|
227
|
+
removeComments: true,
|
|
228
|
+
collapseWhitespace: true,
|
|
229
|
+
removeRedundantAttributes: true,
|
|
230
|
+
useShortDoctype: true,
|
|
231
|
+
removeEmptyAttributes: true,
|
|
232
|
+
removeStyleLinkTypeAttributes: true,
|
|
233
|
+
keepClosingSlash: true,
|
|
234
|
+
minifyJS: true,
|
|
235
|
+
minifyCSS: true,
|
|
236
|
+
minifyURLs: true,
|
|
237
|
+
},
|
|
238
|
+
}
|
|
239
|
+
: undefined
|
|
240
|
+
)
|
|
241
|
+
);
|
|
242
|
+
|
|
214
243
|
return {
|
|
215
244
|
target: ['browserslist'],
|
|
216
245
|
mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
|
|
@@ -223,7 +252,10 @@ module.exports = function (webpackEnv) {
|
|
|
223
252
|
: isEnvDevelopment && 'cheap-module-source-map',
|
|
224
253
|
// These are the "entry points" to our application.
|
|
225
254
|
// This means they will be the "root" imports that are included in JS bundle.
|
|
226
|
-
entry:
|
|
255
|
+
entry: Object.assign(
|
|
256
|
+
{ index: paths.appLibIndexJs },
|
|
257
|
+
isEnvProduction ? { photoviewer: paths.appLibPhotoViewerJs } : {},
|
|
258
|
+
),
|
|
227
259
|
output: {
|
|
228
260
|
globalObject: 'this',
|
|
229
261
|
// The build folder.
|
|
@@ -233,7 +265,7 @@ module.exports = function (webpackEnv) {
|
|
|
233
265
|
// There will be one main bundle, and one file per asynchronous chunk.
|
|
234
266
|
// In development, it does not produce real files.
|
|
235
267
|
filename: isEnvProduction
|
|
236
|
-
? '
|
|
268
|
+
? '[name].js'
|
|
237
269
|
: isEnvDevelopment && 'static/js/bundle.js',
|
|
238
270
|
// There are also additional JS chunk files if you use code splitting.
|
|
239
271
|
chunkFilename: isEnvProduction
|
|
@@ -608,168 +640,15 @@ module.exports = function (webpackEnv) {
|
|
|
608
640
|
new webpack.DefinePlugin({
|
|
609
641
|
__COMMIT_HASH__: JSON.stringify(commitHash)
|
|
610
642
|
}),
|
|
611
|
-
|
|
612
|
-
//
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
isEnvProduction
|
|
621
|
-
? {
|
|
622
|
-
minify: {
|
|
623
|
-
removeComments: true,
|
|
624
|
-
collapseWhitespace: true,
|
|
625
|
-
removeRedundantAttributes: true,
|
|
626
|
-
useShortDoctype: true,
|
|
627
|
-
removeEmptyAttributes: true,
|
|
628
|
-
removeStyleLinkTypeAttributes: true,
|
|
629
|
-
keepClosingSlash: true,
|
|
630
|
-
minifyJS: true,
|
|
631
|
-
minifyCSS: true,
|
|
632
|
-
minifyURLs: true,
|
|
633
|
-
},
|
|
634
|
-
}
|
|
635
|
-
: undefined
|
|
636
|
-
)
|
|
637
|
-
),
|
|
638
|
-
// isEnvDevelopment &&
|
|
639
|
-
// Generates a `map.html` file with the <script> injected.
|
|
640
|
-
new HtmlWebpackPlugin(
|
|
641
|
-
Object.assign(
|
|
642
|
-
{},
|
|
643
|
-
{
|
|
644
|
-
inject: true,
|
|
645
|
-
filename: "map.html",
|
|
646
|
-
template: paths.appHtmlMap,
|
|
647
|
-
},
|
|
648
|
-
isEnvProduction
|
|
649
|
-
? {
|
|
650
|
-
minify: {
|
|
651
|
-
removeComments: true,
|
|
652
|
-
collapseWhitespace: true,
|
|
653
|
-
removeRedundantAttributes: true,
|
|
654
|
-
useShortDoctype: true,
|
|
655
|
-
removeEmptyAttributes: true,
|
|
656
|
-
removeStyleLinkTypeAttributes: true,
|
|
657
|
-
keepClosingSlash: true,
|
|
658
|
-
minifyJS: true,
|
|
659
|
-
minifyCSS: true,
|
|
660
|
-
minifyURLs: true,
|
|
661
|
-
},
|
|
662
|
-
}
|
|
663
|
-
: undefined
|
|
664
|
-
)
|
|
665
|
-
),
|
|
666
|
-
// isEnvDevelopment &&
|
|
667
|
-
// Generates a `map.html` file with the <script> injected.
|
|
668
|
-
new HtmlWebpackPlugin(
|
|
669
|
-
Object.assign(
|
|
670
|
-
{},
|
|
671
|
-
{
|
|
672
|
-
inject: true,
|
|
673
|
-
filename: "editor.html",
|
|
674
|
-
template: paths.appHtmlEditor,
|
|
675
|
-
},
|
|
676
|
-
isEnvProduction
|
|
677
|
-
? {
|
|
678
|
-
minify: {
|
|
679
|
-
removeComments: true,
|
|
680
|
-
collapseWhitespace: true,
|
|
681
|
-
removeRedundantAttributes: true,
|
|
682
|
-
useShortDoctype: true,
|
|
683
|
-
removeEmptyAttributes: true,
|
|
684
|
-
removeStyleLinkTypeAttributes: true,
|
|
685
|
-
keepClosingSlash: true,
|
|
686
|
-
minifyJS: true,
|
|
687
|
-
minifyCSS: true,
|
|
688
|
-
minifyURLs: true,
|
|
689
|
-
},
|
|
690
|
-
}
|
|
691
|
-
: undefined
|
|
692
|
-
)
|
|
693
|
-
),
|
|
694
|
-
// isEnvDevelopment &&
|
|
695
|
-
new HtmlWebpackPlugin(
|
|
696
|
-
Object.assign(
|
|
697
|
-
{},
|
|
698
|
-
{
|
|
699
|
-
inject: true,
|
|
700
|
-
filename: "viewer.html",
|
|
701
|
-
template: paths.appHtmlViewer,
|
|
702
|
-
},
|
|
703
|
-
isEnvProduction
|
|
704
|
-
? {
|
|
705
|
-
minify: {
|
|
706
|
-
removeComments: true,
|
|
707
|
-
collapseWhitespace: true,
|
|
708
|
-
removeRedundantAttributes: true,
|
|
709
|
-
useShortDoctype: true,
|
|
710
|
-
removeEmptyAttributes: true,
|
|
711
|
-
removeStyleLinkTypeAttributes: true,
|
|
712
|
-
keepClosingSlash: true,
|
|
713
|
-
minifyJS: true,
|
|
714
|
-
minifyCSS: true,
|
|
715
|
-
minifyURLs: true,
|
|
716
|
-
},
|
|
717
|
-
}
|
|
718
|
-
: undefined
|
|
719
|
-
)
|
|
720
|
-
),
|
|
721
|
-
new HtmlWebpackPlugin(
|
|
722
|
-
Object.assign(
|
|
723
|
-
{},
|
|
724
|
-
{
|
|
725
|
-
inject: true,
|
|
726
|
-
filename: "widgets.html",
|
|
727
|
-
template: paths.appHtmlWidgets,
|
|
728
|
-
},
|
|
729
|
-
isEnvProduction
|
|
730
|
-
? {
|
|
731
|
-
minify: {
|
|
732
|
-
removeComments: true,
|
|
733
|
-
collapseWhitespace: true,
|
|
734
|
-
removeRedundantAttributes: true,
|
|
735
|
-
useShortDoctype: true,
|
|
736
|
-
removeEmptyAttributes: true,
|
|
737
|
-
removeStyleLinkTypeAttributes: true,
|
|
738
|
-
keepClosingSlash: true,
|
|
739
|
-
minifyJS: true,
|
|
740
|
-
minifyCSS: true,
|
|
741
|
-
minifyURLs: true,
|
|
742
|
-
},
|
|
743
|
-
}
|
|
744
|
-
: undefined
|
|
745
|
-
)
|
|
746
|
-
),
|
|
747
|
-
new HtmlWebpackPlugin(
|
|
748
|
-
Object.assign(
|
|
749
|
-
{},
|
|
750
|
-
{
|
|
751
|
-
inject: true,
|
|
752
|
-
filename: "photo.html",
|
|
753
|
-
template: paths.appHtmlPhotoViewer,
|
|
754
|
-
},
|
|
755
|
-
isEnvProduction
|
|
756
|
-
? {
|
|
757
|
-
minify: {
|
|
758
|
-
removeComments: true,
|
|
759
|
-
collapseWhitespace: true,
|
|
760
|
-
removeRedundantAttributes: true,
|
|
761
|
-
useShortDoctype: true,
|
|
762
|
-
removeEmptyAttributes: true,
|
|
763
|
-
removeStyleLinkTypeAttributes: true,
|
|
764
|
-
keepClosingSlash: true,
|
|
765
|
-
minifyJS: true,
|
|
766
|
-
minifyCSS: true,
|
|
767
|
-
minifyURLs: true,
|
|
768
|
-
},
|
|
769
|
-
}
|
|
770
|
-
: undefined
|
|
771
|
-
)
|
|
772
|
-
),
|
|
643
|
+
|
|
644
|
+
// HTML demo pages
|
|
645
|
+
getHtmlPlugin("index.html", paths.appHtml),
|
|
646
|
+
getHtmlPlugin("map.html", paths.appHtmlMap),
|
|
647
|
+
getHtmlPlugin("editor.html", paths.appHtmlEditor),
|
|
648
|
+
getHtmlPlugin("viewer.html", paths.appHtmlViewer),
|
|
649
|
+
getHtmlPlugin("photo.html", paths.appHtmlPhotoViewer),
|
|
650
|
+
getHtmlPlugin("widgets.html", paths.appHtmlWidgets),
|
|
651
|
+
|
|
773
652
|
// Inlines the webpack runtime script. This script is too small to warrant
|
|
774
653
|
// a network request.
|
|
775
654
|
// https://github.com/facebook/create-react-app/issues/5358
|
|
@@ -807,7 +686,7 @@ module.exports = function (webpackEnv) {
|
|
|
807
686
|
new MiniCssExtractPlugin({
|
|
808
687
|
// Options similar to the same options in webpackOptions.output
|
|
809
688
|
// both options are optional
|
|
810
|
-
filename: '
|
|
689
|
+
filename: '[name].css',
|
|
811
690
|
chunkFilename: 'index.[contenthash:8].chunk.css',
|
|
812
691
|
}),
|
|
813
692
|
// Generate an asset manifest file with the following content:
|
package/docs/index.md
CHANGED
|
@@ -31,9 +31,9 @@ Many options are available for installing the viewer.
|
|
|
31
31
|
You can rely on various providers offering hosted NPM packages, for example JSDelivr.
|
|
32
32
|
|
|
33
33
|
```html
|
|
34
|
-
<!-- You may use another version than 4.
|
|
35
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@panoramax/web-viewer@4.
|
|
36
|
-
<script src="https://cdn.jsdelivr.net/npm/@panoramax/web-viewer@4.
|
|
34
|
+
<!-- You may use another version than 4.1.0, just change the release in URL -->
|
|
35
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@panoramax/web-viewer@4.1.0/build/index.css" />
|
|
36
|
+
<script src="https://cdn.jsdelivr.net/npm/@panoramax/web-viewer@4.1.0/build/index.js"></script>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
=== ":material-code-tags: Source code"
|
|
@@ -62,6 +62,10 @@ First, you need to import Panoramax code:
|
|
|
62
62
|
<!-- Change the actual path depending of where you installed the library -->
|
|
63
63
|
<link rel="stylesheet" type="text/css" href="web-viewer/build/index.css" />
|
|
64
64
|
<script src="web-viewer/build/index.js"></script>
|
|
65
|
+
|
|
66
|
+
<!-- You can use the lightweight version with only PhotoViewer as well -->
|
|
67
|
+
<link rel="stylesheet" type="text/css" href="web-viewer/build/photoviewer.css" />
|
|
68
|
+
<script src="web-viewer/build/photoviewer.js"></script>
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
=== ":fontawesome-brands-node-js: New-style JS"
|
|
@@ -73,6 +77,13 @@ First, you need to import Panoramax code:
|
|
|
73
77
|
import '@panoramax/web-viewer/build/index.css';
|
|
74
78
|
```
|
|
75
79
|
|
|
80
|
+
If you prefer the lightweight version, only containing PhotoViewer component:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import Panoramax from '@panoramax/web-viewer/build/photoviewer';
|
|
84
|
+
import '@panoramax/web-viewer/build/photoviewer.css';
|
|
85
|
+
```
|
|
86
|
+
|
|
76
87
|
Once ready, you can create for example a viewer. We use web components to do so, you can create it in HTML or in other web components:
|
|
77
88
|
|
|
78
89
|
```html
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import API from "../../utils/API";
|
|
3
3
|
import { getTranslations } from "../../utils/i18n";
|
|
4
|
-
import {
|
|
4
|
+
import { MapTiles } from "../../utils/services";
|
|
5
5
|
import { createWebComp } from "../../utils/widgets";
|
|
6
6
|
import { isInIframe, isInternetFast } from "../../utils/utils";
|
|
7
7
|
import JSON5 from "json5";
|
|
@@ -57,7 +57,7 @@ export default class Basic extends LitElement {
|
|
|
57
57
|
|
|
58
58
|
// Some defaults
|
|
59
59
|
this.users = ["geovisio"];
|
|
60
|
-
this.mapstyle = this.getAttribute("mapstyle") ||
|
|
60
|
+
this.mapstyle = this.getAttribute("mapstyle") || MapTiles();
|
|
61
61
|
this.lang = this.getAttribute("lang") || null;
|
|
62
62
|
this.endpoint = this.getAttribute("endpoint") || null; // No default
|
|
63
63
|
this.picture = this.getAttribute("picture") || null;
|
package/src/components/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* eslint-disable import/no-unused-modules */
|
|
2
|
+
|
|
3
|
+
// Lightweight export for PhotoViewer
|
|
4
|
+
export {default as AnnotationsList} from "./AnnotationsList";
|
|
5
|
+
export {default as PictureLegend} from "./PictureLegend";
|
|
6
|
+
export {default as PictureMetadata} from "./PictureMetadata";
|
|
7
|
+
export {default as PlayerOptions} from "./PlayerOptions";
|
|
8
|
+
export {default as QualityScoreDoc} from "./QualityScoreDoc";
|
|
9
|
+
export {default as ReportForm} from "./ReportForm";
|
|
10
|
+
export {default as SemanticsMetadata} from "./SemanticsMetadata";
|
|
11
|
+
export {default as Share} from "./Share";
|
|
@@ -22,5 +22,5 @@ export {default as SearchBar} from "./SearchBar";
|
|
|
22
22
|
export {default as SemanticsEditor} from "./SemanticsEditor";
|
|
23
23
|
export {default as SemanticsTable} from "./SemanticsTable";
|
|
24
24
|
export {default as TogglableGroup} from "./TogglableGroup";
|
|
25
|
-
import * as widgets from "./widgets";
|
|
25
|
+
import * as widgets from "./widgets/index";
|
|
26
26
|
export {widgets};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable import/no-unused-modules */
|
|
2
|
+
|
|
3
|
+
// Lightweight export for PhotoViewer
|
|
4
|
+
export {default as ButtonGroup} from "./ButtonGroup";
|
|
5
|
+
export {default as Button} from "./Button";
|
|
6
|
+
export {default as CopyButton} from "./CopyButton";
|
|
7
|
+
export {default as Grade} from "./Grade";
|
|
8
|
+
export {default as AnnotationsSwitch} from "./AnnotationsSwitch";
|
|
9
|
+
export {default as LinkButton} from "./LinkButton";
|
|
10
|
+
export {default as ListGroup} from "./ListGroup";
|
|
11
|
+
export {default as ListItem} from "./ListItem";
|
|
12
|
+
export {default as Loader} from "./Loader";
|
|
13
|
+
export {default as Photo} from "./Photo";
|
|
14
|
+
export {default as Popup} from "./Popup";
|
|
15
|
+
export {default as ProgressBar} from "./ProgressBar";
|
|
16
|
+
export {default as QualityScore} from "./QualityScore";
|
|
17
|
+
export {default as SearchBar} from "./SearchBar";
|
|
18
|
+
export {default as SemanticsEditor} from "./SemanticsEditor";
|
|
19
|
+
export {default as SemanticsTable} from "./SemanticsTable";
|
|
20
|
+
export {default as TogglableGroup} from "./TogglableGroup";
|
|
21
|
+
import * as widgets from "./widgets/index_photoviewer";
|
|
22
|
+
export {widgets};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { PSV_DEFAULT_ZOOM, PSV_ANIM_DURATION } from "../Photo";
|
|
3
|
-
import { PSV_ZOOM_DELTA } from "../../core/
|
|
3
|
+
import { PSV_ZOOM_DELTA } from "../../core/PhotoViewer";
|
|
4
4
|
import { fa, onceParentAvailable } from "../../../utils/widgets";
|
|
5
5
|
import { faPlus } from "@fortawesome/free-solid-svg-icons/faPlus";
|
|
6
6
|
import { faMinus } from "@fortawesome/free-solid-svg-icons/faMinus";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* eslint-disable import/no-unused-modules */
|
|
2
|
+
|
|
3
|
+
// Lightweight export for PhotoViewer
|
|
4
|
+
export {default as CopyCoordinates} from "./CopyCoordinates";
|
|
5
|
+
export {default as Legend} from "./Legend";
|
|
6
|
+
export {default as OSMEditors} from "./OSMEditors";
|
|
7
|
+
export {default as PictureLegendActions} from "./PictureLegendActions";
|
|
8
|
+
export {default as Player} from "./Player";
|
|
9
|
+
export {default as Zoom} from "./Zoom";
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable import/no-unused-modules */
|
|
2
2
|
|
|
3
|
-
export * as components from "./components";
|
|
4
|
-
export * as utils from "./utils";
|
|
3
|
+
export * as components from "./components/index";
|
|
4
|
+
export * as utils from "./utils/index";
|
|
5
5
|
export {default as Viewer} from "./components/core/Viewer";
|
|
6
6
|
export {default as CoverageMap} from "./components/core/CoverageMap";
|
|
7
7
|
export {default as Editor} from "./components/core/Editor";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* eslint-disable import/no-unused-modules */
|
|
2
|
+
|
|
3
|
+
// Lightweight export for PhotoViewer
|
|
4
|
+
export * as components from "./components/index_photoviewer";
|
|
5
|
+
export * as utils from "./utils/index_photoviewer";
|
|
6
|
+
export {default as PhotoViewer} from "./components/core/PhotoViewer";
|
package/src/utils/API.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { TILES_PICTURES_ZOOM } from "./map";
|
|
2
1
|
import { isNullId } from "./utils";
|
|
3
2
|
|
|
3
|
+
// Do not use ./map import to avoid bundling Maplibre for PhotoViewer
|
|
4
|
+
const TILES_PICTURES_ZOOM = 15;
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* API contains various utility functions to communicate with Panoramax/STAC API
|
|
6
8
|
*
|
package/src/utils/geocoder.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// DO NOT REMOVE THE "!": bundled builds breaks otherwise !!!
|
|
2
|
-
import maplibregl from "!maplibre-gl";
|
|
3
|
-
|
|
4
1
|
import { NominatimBaseUrl, AdresseDataGouvBaseURL } from "./services";
|
|
5
2
|
|
|
6
3
|
const PLACETYPE_ZOOM = {
|
|
@@ -58,7 +55,7 @@ export function forwardGeocodingNominatim(config) {
|
|
|
58
55
|
finalRes.features.push({
|
|
59
56
|
place_type: ["place"],
|
|
60
57
|
place_name: plname,
|
|
61
|
-
center:
|
|
58
|
+
center: f.geometry.coordinates,
|
|
62
59
|
zoom: PLACETYPE_ZOOM[f.properties?.geocoding?.type],
|
|
63
60
|
});
|
|
64
61
|
listedNames.push(plname);
|
|
@@ -195,7 +192,7 @@ export function forwardGeocodingStandard(config, endpoint) {
|
|
|
195
192
|
finalRes.features.push({
|
|
196
193
|
place_type: ["place"],
|
|
197
194
|
place_name: plname,
|
|
198
|
-
center:
|
|
195
|
+
center: f.geometry.coordinates,
|
|
199
196
|
zoom: PLACETYPE_ZOOM[f.properties.type],
|
|
200
197
|
});
|
|
201
198
|
listedNames.push(plname);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint-disable import/no-unused-modules */
|
|
2
|
+
|
|
3
|
+
// Lightweight export for PhotoViewer
|
|
4
|
+
import * as i18n from "./i18n";
|
|
5
|
+
import * as picture from "./picture";
|
|
6
|
+
import * as semantics from "./semantics";
|
|
7
|
+
import * as services from "./services";
|
|
8
|
+
import * as utils from "./utils";
|
|
9
|
+
import * as widgets from "./widgets";
|
|
10
|
+
|
|
11
|
+
export { i18n, picture, semantics, services, utils, widgets };
|
|
12
|
+
export {default as API} from "./API";
|
|
13
|
+
export {default as PhotoAdapter} from "./PhotoAdapter";
|
|
14
|
+
export {default as PresetsManager} from "./PresetsManager";
|
|
15
|
+
export {default as URLHandler} from "./URLHandler";
|
package/src/utils/map.js
CHANGED
|
@@ -3,7 +3,6 @@ import { COLORS, QUALITYSCORE_RES_FLAT_VALUES, QUALITYSCORE_RES_360_VALUES, QUAL
|
|
|
3
3
|
import { autoDetectLocale } from "./i18n";
|
|
4
4
|
import { isNullId } from "./utils";
|
|
5
5
|
|
|
6
|
-
export const DEFAULT_TILES = "https://panoramax.openstreetmap.fr/pmtiles/basic.json";
|
|
7
6
|
export const RASTER_LAYER_ID = "pnx-aerial";
|
|
8
7
|
|
|
9
8
|
export const TILES_PICTURES_ZOOM = 15;
|
package/src/utils/services.js
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Default map background tiles
|
|
9
|
+
* @returns {string} The website URL
|
|
10
|
+
*/
|
|
11
|
+
export function MapTiles() {
|
|
12
|
+
return "https://panoramax.openstreetmap.fr/pmtiles/basic.json";
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
/**
|
|
8
16
|
* Panoramax website URL
|
|
9
17
|
* @returns {string} The website URL
|
|
@@ -4,10 +4,10 @@ exports[`forwardGeocodingBAN works 1`] = `
|
|
|
4
4
|
Object {
|
|
5
5
|
"features": Array [
|
|
6
6
|
Object {
|
|
7
|
-
"center":
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
"center": Array [
|
|
8
|
+
2.290084,
|
|
9
|
+
49.897443,
|
|
10
|
+
],
|
|
11
11
|
"place_name": "8 Boulevard du Port, Amiens",
|
|
12
12
|
"place_type": Array [
|
|
13
13
|
"place",
|
|
@@ -22,10 +22,10 @@ exports[`forwardGeocodingNominatim works 1`] = `
|
|
|
22
22
|
Object {
|
|
23
23
|
"features": Array [
|
|
24
24
|
Object {
|
|
25
|
-
"center":
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"center": Array [
|
|
26
|
+
2.3483915,
|
|
27
|
+
48.8534951,
|
|
28
|
+
],
|
|
29
29
|
"place_name": "Paris, Île-de-France",
|
|
30
30
|
"place_type": Array [
|
|
31
31
|
"place",
|