@geogirafe/lib-geoportal 1.3.0-dev.3046054236 → 1.3.0-dev.3060317043
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/LICENSE +1 -0
- package/README.md +3 -2
- package/api/apigeogirafeapp.js +3 -1
- package/assets/i18n/de.json +34 -3
- package/assets/i18n/en.json +33 -2
- package/assets/i18n/fr.json +35 -4
- package/assets/i18n/it.json +37 -6
- package/assets/icons/edit.svg +1 -1
- package/assets/icons/lock.svg +1 -0
- package/assets/icons/streetview-marker-mapillary.svg +1 -0
- package/components/cross-section/cross-section-settings/component.js +1 -1
- package/components/edit/component.d.ts +52 -36
- package/components/edit/component.js +340 -292
- package/components/edit/editcomponentstate.d.ts +1 -0
- package/components/edit/editcomponentstate.js +1 -0
- package/components/edit/editform/component.d.ts +34 -4
- package/components/edit/editform/component.js +224 -37
- package/components/edit/editform/style.css +51 -16
- package/components/edit/geometryedithelper.d.ts +47 -0
- package/components/edit/geometryedithelper.js +324 -0
- package/components/edit/style.css +71 -28
- package/components/layout/component.d.ts +5 -0
- package/components/main.d.ts +1 -1
- package/components/main.js +1 -1
- package/components/map-grid/component.d.ts +4 -0
- package/components/map-grid/component.js +6 -0
- package/components/print/component.d.ts +1 -1
- package/components/streetview/component.d.ts +9 -2
- package/components/streetview/component.js +20 -8
- package/components/streetview/google.js +1 -1
- package/components/streetview/mapillary.d.ts +8 -0
- package/components/streetview/mapillary.js +20 -0
- package/components/streetview/style.css +16 -0
- package/components/streetview/tools/googleprovider.js +9 -2
- package/components/streetview/tools/mapillaryprovider.d.ts +70 -0
- package/components/streetview/tools/mapillaryprovider.js +150 -0
- package/components/treeview/tools/treeviewelement.d.ts +1 -0
- package/components/treeview/tools/treeviewelement.js +22 -0
- package/components/treeview/treeviewitem/component.js +7 -1
- package/models/gmf.d.ts +18 -2
- package/models/gmf.js +3 -1
- package/models/layers/editablelayer.d.ts +7 -0
- package/models/layers/editablelayer.js +7 -0
- package/models/layers/layerwms.d.ts +1 -2
- package/models/layers/layerwms.js +4 -8
- package/models/main.d.ts +9 -4
- package/models/main.js +6 -2
- package/models/oapiflayer.d.ts +25 -0
- package/models/oapiflayer.js +36 -0
- package/models/oapiftypes.d.ts +71 -0
- package/models/oapiftypes.js +29 -0
- package/models/serverogc.d.ts +5 -3
- package/models/serverogc.js +19 -6
- package/models/serverogcapi.d.ts +2 -0
- package/models/serverogcapi.js +2 -0
- package/models/serverogcapifeatures.d.ts +5 -62
- package/models/serverogcapifeatures.js +8 -4
- package/package.json +1 -1
- package/templates/iframe.html +1 -0
- package/templates/index.html +2 -0
- package/templates/mobile.html +1 -0
- package/templates/public/about.json +1 -1
- package/tools/app/geogirafeapp-mobile.js +2 -0
- package/tools/app/geogirafeapp.js +4 -2
- package/tools/configuration/girafeconfig.js +1 -8
- package/tools/configuration/streetviewconfig.d.ts +12 -1
- package/tools/configuration/streetviewconfig.js +26 -4
- package/tools/drawing/olDrawing.js +2 -22
- package/tools/drawing/shapeConstraints.d.ts +2 -1
- package/tools/drawing/shapeConstraints.js +18 -2
- package/tools/main.d.ts +9 -7
- package/tools/main.js +8 -6
- package/tools/ogcapi/ogcapiclient.d.ts +7 -3
- package/tools/ogcapi/ogcapiclient.js +49 -4
- package/tools/ogcapi/ogcapiconformance.d.ts +2 -2
- package/tools/ogcapi/ogcapiconformance.js +7 -13
- package/tools/ogcapi/ogcapifeaturesclient.d.ts +65 -30
- package/tools/ogcapi/ogcapifeaturesclient.js +265 -139
- package/tools/ogcapi/ogcapifeaturesclientgeorama.d.ts +0 -5
- package/tools/ogcapi/ogcapifeaturesclientgeorama.js +0 -11
- package/tools/ogcapi/ogcapifeaturesclientqgis.d.ts +8 -0
- package/tools/ogcapi/ogcapifeaturesclientqgis.js +13 -0
- package/tools/ogcapi/ogcapifeaturesmanager.d.ts +61 -8
- package/tools/ogcapi/ogcapifeaturesmanager.js +179 -30
- package/tools/ogcapi/ogcapifeaturesschema.d.ts +31 -13
- package/tools/ogcapi/ogcapifeaturesschema.js +69 -39
- package/tools/ogcapi/ogcapifeaturesschemaproperty.d.ts +44 -0
- package/tools/ogcapi/ogcapifeaturesschemaproperty.js +137 -0
- package/tools/ogcapi/ogcapifeaturesschemavalidator.d.ts +22 -0
- package/tools/ogcapi/ogcapifeaturesschemavalidator.js +121 -0
- package/tools/state/layout.d.ts +5 -0
- package/tools/state/layout.js +2 -1
- package/tools/state/state.d.ts +6 -0
- package/tools/state/state.js +4 -0
- package/tools/state/streetview.d.ts +1 -1
- package/tools/state/streetview.js +1 -1
- package/tools/themes/themesmanager.d.ts +10 -3
- package/tools/themes/themesmanager.js +29 -9
- package/tools/time/layertimeformatter.d.ts +0 -5
- package/tools/time/layertimeformatter.js +10 -19
- package/tools/utils/dateutils.d.ts +40 -0
- package/tools/utils/dateutils.js +111 -0
- package/tools/utils/utils.d.ts +4 -0
- package/tools/utils/utils.js +12 -0
- package/tools/wfs/wfsmanager.js +3 -0
- package/tools/wms/wmsclient.d.ts +1 -0
- package/tools/wms/wmsclient.js +4 -0
- package/tools/ogcapi/demolayers.d.ts +0 -1
- package/tools/ogcapi/demolayers.js +0 -99
- package/tools/ogcapi/ogcapifeaturesclientgmf.d.ts +0 -13
- package/tools/ogcapi/ogcapifeaturesclientgmf.js +0 -30
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getEpsgCodeFromCrsUri } from '../tools/ogcapi/ogcapifeaturesclient.js';
|
|
2
|
+
export class OapifLayer {
|
|
3
|
+
id;
|
|
4
|
+
title;
|
|
5
|
+
description;
|
|
6
|
+
server;
|
|
7
|
+
storageCrs;
|
|
8
|
+
geometryLayout;
|
|
9
|
+
schema;
|
|
10
|
+
permissions;
|
|
11
|
+
constructor(server, collection) {
|
|
12
|
+
this.id = collection.id;
|
|
13
|
+
this.title = collection.title;
|
|
14
|
+
this.description = collection.description;
|
|
15
|
+
this.storageCrs = collection.storageCrs ? getEpsgCodeFromCrsUri(collection.storageCrs) : undefined;
|
|
16
|
+
this.server = server;
|
|
17
|
+
}
|
|
18
|
+
get geometryType() {
|
|
19
|
+
return this.schema?.geometryType;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generates a unique layer name by combining the server name and collection id
|
|
23
|
+
*/
|
|
24
|
+
get uniqueLayerName() {
|
|
25
|
+
return this.server?.getUniqueLayerName(this.id) ?? '';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Validity decides if this layer can be used for editing
|
|
29
|
+
*/
|
|
30
|
+
get valid() {
|
|
31
|
+
return !!this.storageCrs && !!this.schema && !!this.geometryType && !!this.geometryLayout;
|
|
32
|
+
}
|
|
33
|
+
hasPermission(permission) {
|
|
34
|
+
return this.permissions?.includes(permission) ?? false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { OgcApiLinksResponse } from './serverogcapi.js';
|
|
2
|
+
import { Type as olGeometryType } from 'ol/geom/Geometry.js';
|
|
3
|
+
export type OapifPropertyTypes = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
|
|
4
|
+
export declare const oapifNumericFormats: string[];
|
|
5
|
+
export declare const oapifStringFormats: string[];
|
|
6
|
+
export declare const oapifTemporalFormats: string[];
|
|
7
|
+
export declare const oapifPropertyFormatList: readonly string[];
|
|
8
|
+
export type OapifPropertyFormats = (typeof oapifPropertyFormatList)[number];
|
|
9
|
+
export interface OapifSchemaResponse {
|
|
10
|
+
$id: string;
|
|
11
|
+
$schema: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
required?: string[];
|
|
16
|
+
properties: Record<string, OapifSchemaPropertyOptions>;
|
|
17
|
+
}
|
|
18
|
+
export interface OapifSchemaPropertyOptions {
|
|
19
|
+
'title'?: string;
|
|
20
|
+
'description'?: string;
|
|
21
|
+
'type'?: OapifPropertyTypes;
|
|
22
|
+
'format'?: OapifPropertyFormats;
|
|
23
|
+
'x-ogc-role'?: string;
|
|
24
|
+
'x-ogc-propertySeq'?: number;
|
|
25
|
+
'readOnly'?: boolean;
|
|
26
|
+
'pattern'?: string;
|
|
27
|
+
'minLength'?: number;
|
|
28
|
+
'maxLength'?: number;
|
|
29
|
+
'minimum'?: number;
|
|
30
|
+
'maximum'?: number;
|
|
31
|
+
'exclusiveMinimum'?: number;
|
|
32
|
+
'exclusiveMaximum'?: number;
|
|
33
|
+
'enum'?: string[] | number[];
|
|
34
|
+
'oneOf'?: {
|
|
35
|
+
const: string | number;
|
|
36
|
+
title?: string;
|
|
37
|
+
}[];
|
|
38
|
+
'x-ogc-collectionId'?: string;
|
|
39
|
+
'x-ogc-nullValues'?: Array<string | number>;
|
|
40
|
+
}
|
|
41
|
+
export interface OapifReferenceList {
|
|
42
|
+
value: string | number;
|
|
43
|
+
title: string;
|
|
44
|
+
}
|
|
45
|
+
export interface OapifCollection {
|
|
46
|
+
id: string;
|
|
47
|
+
title?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
links: OgcApiLinksResponse[];
|
|
50
|
+
itemType?: string;
|
|
51
|
+
extent?: {
|
|
52
|
+
spatial: {
|
|
53
|
+
bbox: number[][];
|
|
54
|
+
crs: string;
|
|
55
|
+
};
|
|
56
|
+
temporal?: {
|
|
57
|
+
interval: string[][];
|
|
58
|
+
trs: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
crs?: string[];
|
|
62
|
+
storageCrs?: string;
|
|
63
|
+
}
|
|
64
|
+
export declare const supportedGeometryTypesForEditing: olGeometryType[];
|
|
65
|
+
export declare const EditingOperations: {
|
|
66
|
+
readonly POST: "CREATE";
|
|
67
|
+
readonly PUT: "REPLACE";
|
|
68
|
+
readonly PATCH: "UPDATE";
|
|
69
|
+
readonly DELETE: "DELETE";
|
|
70
|
+
};
|
|
71
|
+
export type EditingPermission = 'CREATE' | 'REPLACE' | 'UPDATE' | 'DELETE';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const oapifNumericFormats = [
|
|
2
|
+
'integer',
|
|
3
|
+
'number',
|
|
4
|
+
'double',
|
|
5
|
+
'float',
|
|
6
|
+
'decimal',
|
|
7
|
+
'int',
|
|
8
|
+
'int32',
|
|
9
|
+
'int64',
|
|
10
|
+
'uint32',
|
|
11
|
+
'uint64'
|
|
12
|
+
];
|
|
13
|
+
export const oapifStringFormats = ['string', 'uuid', 'uri-template'];
|
|
14
|
+
export const oapifTemporalFormats = ['date', 'time', 'date-time', 'datetime'];
|
|
15
|
+
export const oapifPropertyFormatList = [
|
|
16
|
+
...oapifNumericFormats,
|
|
17
|
+
...oapifStringFormats,
|
|
18
|
+
...oapifTemporalFormats
|
|
19
|
+
];
|
|
20
|
+
export const supportedGeometryTypesForEditing = [
|
|
21
|
+
'Point',
|
|
22
|
+
'LineString',
|
|
23
|
+
'LinearRing',
|
|
24
|
+
'Polygon',
|
|
25
|
+
'MultiPoint',
|
|
26
|
+
'MultiLineString',
|
|
27
|
+
'MultiPolygon'
|
|
28
|
+
];
|
|
29
|
+
export const EditingOperations = { POST: 'CREATE', PUT: 'REPLACE', PATCH: 'UPDATE', DELETE: 'DELETE' };
|
package/models/serverogc.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { GMFServerOgc, GMFServerOgcType } from './gmf.js';
|
|
1
|
+
import { GMFServerOgc, GMFServerOgcServices, GMFServerOgcType } from './gmf.js';
|
|
2
2
|
export default class ServerOgc {
|
|
3
3
|
name: string;
|
|
4
4
|
url: string;
|
|
5
5
|
wfsSupport: boolean;
|
|
6
6
|
urlWfs?: string;
|
|
7
|
-
oapifSupport: boolean;
|
|
8
|
-
urlOapif?: string;
|
|
9
7
|
type: GMFServerOgcType;
|
|
10
8
|
imageType: string;
|
|
11
9
|
aliases: Record<string, string>;
|
|
10
|
+
services: GMFServerOgcServices;
|
|
12
11
|
constructor(name: string, elem: GMFServerOgc);
|
|
13
12
|
private getAliasKey;
|
|
14
13
|
private initializeAliases;
|
|
14
|
+
private initializeServices;
|
|
15
15
|
getAlias(table: string, column: string): string;
|
|
16
16
|
get uniqueWmsQueryId(): string;
|
|
17
|
+
getUniqueLayerName(layerName: string): string;
|
|
18
|
+
get hasEditService(): boolean;
|
|
17
19
|
}
|
package/models/serverogc.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { supportedOgcServicesForEdit } from './gmf.js';
|
|
1
3
|
export default class ServerOgc {
|
|
2
4
|
name;
|
|
3
5
|
url;
|
|
4
|
-
wfsSupport;
|
|
5
|
-
urlWfs;
|
|
6
|
-
oapifSupport;
|
|
7
|
-
urlOapif;
|
|
6
|
+
wfsSupport; // Deprecated for use in GeoGirafe since GMF version 2.10
|
|
7
|
+
urlWfs; // Deprecated for use in GeoGirafe since GMF version 2.10
|
|
8
8
|
type;
|
|
9
9
|
imageType;
|
|
10
10
|
aliases;
|
|
11
|
+
services;
|
|
11
12
|
constructor(name, elem) {
|
|
12
13
|
this.name = name;
|
|
13
14
|
this.url = elem.url;
|
|
14
15
|
this.wfsSupport = elem.wfsSupport;
|
|
15
16
|
this.urlWfs = elem.urlWfs;
|
|
16
|
-
this.oapifSupport = elem.oapifSupport ?? false;
|
|
17
|
-
this.urlOapif = elem.urlOapif;
|
|
18
17
|
this.type = elem.type;
|
|
19
18
|
this.imageType = elem.imageType;
|
|
20
19
|
this.aliases = this.initializeAliases(elem);
|
|
20
|
+
this.services = this.initializeServices(elem);
|
|
21
21
|
}
|
|
22
22
|
getAliasKey(table, column) {
|
|
23
23
|
return `${table}-${column}`;
|
|
@@ -35,6 +35,13 @@ export default class ServerOgc {
|
|
|
35
35
|
}
|
|
36
36
|
return aliases;
|
|
37
37
|
}
|
|
38
|
+
initializeServices(elem) {
|
|
39
|
+
if (elem.uses?.edit && !supportedOgcServicesForEdit.includes(elem.uses?.edit.protocol)) {
|
|
40
|
+
console.warn(`OgcServer - Unsupported protocol '${elem.uses.edit.protocol}' for edit service`);
|
|
41
|
+
delete elem.uses.edit;
|
|
42
|
+
}
|
|
43
|
+
return elem.uses ?? {};
|
|
44
|
+
}
|
|
38
45
|
getAlias(table, column) {
|
|
39
46
|
const key = this.getAliasKey(table, column);
|
|
40
47
|
return this.aliases[key];
|
|
@@ -42,4 +49,10 @@ export default class ServerOgc {
|
|
|
42
49
|
get uniqueWmsQueryId() {
|
|
43
50
|
return this.name + this.imageType;
|
|
44
51
|
}
|
|
52
|
+
getUniqueLayerName(layerName) {
|
|
53
|
+
return `${this.name}-${layerName}`;
|
|
54
|
+
}
|
|
55
|
+
get hasEditService() {
|
|
56
|
+
return !!this.services.edit && !!this.services.edit.url && this.services.edit.protocol === 'OGC API - Features';
|
|
57
|
+
}
|
|
45
58
|
}
|
package/models/serverogcapi.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export default class ServerOgcApi {
|
|
|
6
6
|
}
|
|
7
7
|
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS';
|
|
8
8
|
export declare const OgcApiDefaultEncoding = "application/json";
|
|
9
|
+
export declare const OgcApiGeoJsonEncoding = "application/geo+json";
|
|
10
|
+
export declare const OgcApiSchemaEncoding = "application/schema+json";
|
|
9
11
|
export type OgcApiLinksResponse = {
|
|
10
12
|
href: string;
|
|
11
13
|
rel: string;
|
package/models/serverogcapi.js
CHANGED
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
import ServerOgcApi
|
|
2
|
-
import
|
|
3
|
-
export declare const oapifNumericTypes: string[];
|
|
4
|
-
export declare const oapifTextTypes: string[];
|
|
5
|
-
export declare const oapifTemporalTypes: string[];
|
|
6
|
-
export declare const oapifPropertyTypesList: readonly string[];
|
|
7
|
-
export type oapifPropertyTypes = (typeof oapifPropertyTypesList)[number];
|
|
1
|
+
import ServerOgcApi from './serverogcapi.js';
|
|
2
|
+
import { OapifCollection } from './oapiftypes.js';
|
|
8
3
|
export default class ServerOgcApiFeatures extends ServerOgcApi {
|
|
4
|
+
collections: Map<string, OapifCollection>;
|
|
9
5
|
constructor(url: string);
|
|
6
|
+
addCollection(collection: OapifCollection): void;
|
|
7
|
+
get hasEditableLayers(): boolean;
|
|
10
8
|
}
|
|
11
|
-
export type OapifSchemaResponse = {
|
|
12
|
-
$id?: string;
|
|
13
|
-
$schema?: string;
|
|
14
|
-
title?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
type?: string;
|
|
17
|
-
properties: Record<string, OapifPropertySchema>;
|
|
18
|
-
};
|
|
19
|
-
export type OapifPropertySchema = {
|
|
20
|
-
'title'?: string;
|
|
21
|
-
'description'?: string;
|
|
22
|
-
'type'?: oapifPropertyTypes;
|
|
23
|
-
'format'?: string;
|
|
24
|
-
'x-ogc-role'?: string;
|
|
25
|
-
'x-ogc-propertySeq'?: number;
|
|
26
|
-
'readOnly'?: boolean;
|
|
27
|
-
'required'?: boolean;
|
|
28
|
-
'maxLength'?: number;
|
|
29
|
-
'minimum'?: number;
|
|
30
|
-
'maximum'?: number;
|
|
31
|
-
'enum'?: Array<string | number>;
|
|
32
|
-
'oneOf'?: {
|
|
33
|
-
const: string;
|
|
34
|
-
value: string;
|
|
35
|
-
}[];
|
|
36
|
-
'x-orc-codelistUri'?: string;
|
|
37
|
-
};
|
|
38
|
-
export type OapifCollection = {
|
|
39
|
-
id: string;
|
|
40
|
-
title: string;
|
|
41
|
-
description?: string;
|
|
42
|
-
links: OgcApiLinksResponse[];
|
|
43
|
-
itemType: string;
|
|
44
|
-
extent?: {
|
|
45
|
-
spatial: {
|
|
46
|
-
bbox: number[][];
|
|
47
|
-
crs: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
crs?: string[];
|
|
51
|
-
storageCrs?: string;
|
|
52
|
-
};
|
|
53
|
-
export type OapifLayer = {
|
|
54
|
-
url: string;
|
|
55
|
-
collectionId: string;
|
|
56
|
-
collectionTitle: string;
|
|
57
|
-
displayName: string;
|
|
58
|
-
crs: string;
|
|
59
|
-
credentials?: string;
|
|
60
|
-
geometryType: 'Point' | 'LineString' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon';
|
|
61
|
-
attributeName: string;
|
|
62
|
-
attributeType: string;
|
|
63
|
-
serverType: string;
|
|
64
|
-
server: ServerOgc;
|
|
65
|
-
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
import ServerOgcApi from './serverogcapi.js';
|
|
3
|
-
export const oapifNumericTypes = ['integer', 'number', 'double', 'float', 'decimal', 'int', 'int32', 'int64'];
|
|
4
|
-
export const oapifTextTypes = ['string', 'date', 'time', 'datetime', 'date-time', 'duration'];
|
|
5
|
-
export const oapifTemporalTypes = ['date', 'time', 'date-time', 'datetime'];
|
|
6
|
-
export const oapifPropertyTypesList = [...oapifNumericTypes, ...oapifTextTypes, ...oapifTemporalTypes];
|
|
7
3
|
export default class ServerOgcApiFeatures extends ServerOgcApi {
|
|
4
|
+
collections;
|
|
8
5
|
constructor(url) {
|
|
9
6
|
super(url);
|
|
7
|
+
this.collections = new Map();
|
|
8
|
+
}
|
|
9
|
+
addCollection(collection) {
|
|
10
|
+
this.collections.set(collection.id, collection);
|
|
11
|
+
}
|
|
12
|
+
get hasEditableLayers() {
|
|
13
|
+
return this.collections.size > 0;
|
|
10
14
|
}
|
|
11
15
|
}
|
package/package.json
CHANGED
package/templates/iframe.html
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
<girafe-map-2d></girafe-map-2d>
|
|
83
83
|
<girafe-map-3d></girafe-map-3d>
|
|
84
84
|
<girafe-streetview-google></girafe-streetview-google>
|
|
85
|
+
<girafe-streetview-mapillary></girafe-streetview-mapillary>
|
|
85
86
|
</girafe-map-grid>
|
|
86
87
|
<girafe-basemap></girafe-basemap>
|
|
87
88
|
<girafe-search id="search"></girafe-search>
|
package/templates/index.html
CHANGED
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
<girafe-map-2d></girafe-map-2d>
|
|
111
111
|
<girafe-map-3d></girafe-map-3d>
|
|
112
112
|
<girafe-streetview-google></girafe-streetview-google>
|
|
113
|
+
<girafe-streetview-mapillary></girafe-streetview-mapillary>
|
|
113
114
|
</girafe-map-grid>
|
|
114
115
|
<div class="info-area">
|
|
115
116
|
<girafe-basemap data-tour="basemap-selection"></girafe-basemap>
|
|
@@ -238,6 +239,7 @@
|
|
|
238
239
|
<button
|
|
239
240
|
tip="edit-panel"
|
|
240
241
|
slot="menu-content"
|
|
242
|
+
data-visibility-control="edit"
|
|
241
243
|
class="gg-icon-button gg-big"
|
|
242
244
|
onclick="
|
|
243
245
|
document.geogirafe.state.interface.editPanelVisible = !document.geogirafe.state.interface.editPanelVisible
|
package/templates/mobile.html
CHANGED
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
<girafe-map-2d></girafe-map-2d>
|
|
98
98
|
<girafe-map-3d></girafe-map-3d>
|
|
99
99
|
<girafe-streetview-google></girafe-streetview-google>
|
|
100
|
+
<girafe-streetview-mapillary></girafe-streetview-mapillary>
|
|
100
101
|
</girafe-map-grid>
|
|
101
102
|
<girafe-infobox></girafe-infobox>
|
|
102
103
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.3.0-dev.
|
|
1
|
+
{"version":"1.3.0-dev.3060317043", "build":"3060317043", "date":"12/11/2026"}
|
|
@@ -12,6 +12,7 @@ import Map2dComponent from '../../components/map-2d/component.js';
|
|
|
12
12
|
import DeprecatedMapComponent from '../../components/map-2d/deprecatedmapcomponent.js';
|
|
13
13
|
import Map3dComponent from '../../components/map-3d/component.js';
|
|
14
14
|
import GoogleStreetViewComponent from '../../components/streetview/google.js';
|
|
15
|
+
import MapillaryStreetViewComponent from '../../components/streetview/mapillary.js';
|
|
15
16
|
import MapGridComponent from '../../components/map-grid/component.js';
|
|
16
17
|
import MenuMobile3dButton from '../../components/menu-buttons-mobile/MenuMobile3dButton.js';
|
|
17
18
|
import MenuMobileDrawingButton from '../../components/menu-buttons-mobile/MenuMobileDrawingButton.js';
|
|
@@ -52,6 +53,7 @@ export default class GeoGirafeAppMobile extends GeoGirafeApp {
|
|
|
52
53
|
customElements.define('girafe-map-2d', Map2dComponent);
|
|
53
54
|
customElements.define('girafe-map-3d', Map3dComponent);
|
|
54
55
|
customElements.define('girafe-streetview-google', GoogleStreetViewComponent);
|
|
56
|
+
customElements.define('girafe-streetview-mapillary', MapillaryStreetViewComponent);
|
|
55
57
|
customElements.define('girafe-map-grid', MapGridComponent);
|
|
56
58
|
// Deprecated alias of <girafe-map-2d>, kept for the applications that were not migrated yet.
|
|
57
59
|
customElements.define('girafe-map', DeprecatedMapComponent);
|
|
@@ -11,7 +11,7 @@ import CrossSectionSettingsComponent from '../../components/cross-section/cross-
|
|
|
11
11
|
import CrossSectionViewComponent from '../../components/cross-section/cross-section-viewer/component.js';
|
|
12
12
|
import DrawingComponent, { DrawingStateLocation } from '../../components/drawing/component.js';
|
|
13
13
|
import EditComponent from '../../components/edit/component.js';
|
|
14
|
-
import
|
|
14
|
+
import EditFormComponent from '../../components/edit/editform/component.js';
|
|
15
15
|
import HelpComponent from '../../components/help/component.js';
|
|
16
16
|
import InfoboxComponent from '../../components/infobox/component.js';
|
|
17
17
|
import InfoWindowComponent from '../../components/infowindow/component.js';
|
|
@@ -21,6 +21,7 @@ import Map2dComponent from '../../components/map-2d/component.js';
|
|
|
21
21
|
import DeprecatedMapComponent from '../../components/map-2d/deprecatedmapcomponent.js';
|
|
22
22
|
import Map3dComponent from '../../components/map-3d/component.js';
|
|
23
23
|
import GoogleStreetViewComponent from '../../components/streetview/google.js';
|
|
24
|
+
import MapillaryStreetViewComponent from '../../components/streetview/mapillary.js';
|
|
24
25
|
import MapGridComponent from '../../components/map-grid/component.js';
|
|
25
26
|
import MenuButtonComponent from '../../components/menubutton/component.js';
|
|
26
27
|
import ModalsComponent from '../../components/modals/component.js';
|
|
@@ -126,6 +127,7 @@ export default class GeoGirafeApp {
|
|
|
126
127
|
customElements.define('girafe-map-2d', Map2dComponent);
|
|
127
128
|
customElements.define('girafe-map-3d', Map3dComponent);
|
|
128
129
|
customElements.define('girafe-streetview-google', GoogleStreetViewComponent);
|
|
130
|
+
customElements.define('girafe-streetview-mapillary', MapillaryStreetViewComponent);
|
|
129
131
|
customElements.define('girafe-map-grid', MapGridComponent);
|
|
130
132
|
// Deprecated alias of <girafe-map-2d>, kept for the applications that were not migrated yet.
|
|
131
133
|
customElements.define('girafe-map', DeprecatedMapComponent);
|
|
@@ -141,7 +143,7 @@ export default class GeoGirafeApp {
|
|
|
141
143
|
customElements.define('girafe-drawing', DrawingComponent);
|
|
142
144
|
customElements.define('girafe-drawing-toolbar', DrawingToolbarComponent);
|
|
143
145
|
customElements.define('girafe-edit', EditComponent);
|
|
144
|
-
customElements.define('girafe-edit-form',
|
|
146
|
+
customElements.define('girafe-edit-form', EditFormComponent);
|
|
145
147
|
customElements.define('girafe-scale', ScaleComponent);
|
|
146
148
|
customElements.define('girafe-search-filter', SearchFilterComponent);
|
|
147
149
|
customElements.define('girafe-search', SearchComponent);
|
|
@@ -117,14 +117,7 @@ class GirafeConfig {
|
|
|
117
117
|
// We just display a warning in the console
|
|
118
118
|
console.warn(e);
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
this.streetview = initConfigStreetView(config);
|
|
122
|
-
}
|
|
123
|
-
catch (e) {
|
|
124
|
-
// The application can be started even if the StreetView is not correctly configured
|
|
125
|
-
// We just display a warning in the console
|
|
126
|
-
console.warn(e);
|
|
127
|
-
}
|
|
120
|
+
this.streetview = initConfigStreetView(config);
|
|
128
121
|
try {
|
|
129
122
|
this.news = this.initConfigNews(config);
|
|
130
123
|
}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import type { StreetViewProvider } from '../state/streetview.js';
|
|
2
2
|
/** Maximal distance, in meters, between a click on the map and the footage displayed for it. */
|
|
3
3
|
export declare const DEFAULT_STREETVIEW_SEARCH_RADIUS = 100;
|
|
4
|
+
/** The Mapillary API does not search the images further than this distance, in meters. */
|
|
5
|
+
export declare const MAPILLARY_MAX_SEARCH_RADIUS = 50;
|
|
6
|
+
export type MapillaryConfig = {
|
|
7
|
+
accessToken: string;
|
|
8
|
+
searchRadius: number;
|
|
9
|
+
};
|
|
4
10
|
export type StreetViewConfig = {
|
|
5
11
|
searchRadius: number;
|
|
6
12
|
google?: {
|
|
7
13
|
apiKey: string;
|
|
8
14
|
};
|
|
15
|
+
mapillary?: MapillaryConfig;
|
|
16
|
+
};
|
|
17
|
+
type StreetViewConfigInput = Partial<Omit<StreetViewConfig, 'mapillary'>> & {
|
|
18
|
+
mapillary?: Partial<MapillaryConfig>;
|
|
9
19
|
};
|
|
10
20
|
export declare function initConfigStreetView(config: {
|
|
11
|
-
streetview?:
|
|
21
|
+
streetview?: StreetViewConfigInput;
|
|
12
22
|
}): StreetViewConfig | undefined;
|
|
13
23
|
export declare function isStreetViewProviderConfigured(config: StreetViewConfig | undefined, provider: StreetViewProvider): boolean;
|
|
24
|
+
export {};
|
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
/** Maximal distance, in meters, between a click on the map and the footage displayed for it. */
|
|
2
2
|
export const DEFAULT_STREETVIEW_SEARCH_RADIUS = 100;
|
|
3
|
+
/** The Mapillary API does not search the images further than this distance, in meters. */
|
|
4
|
+
export const MAPILLARY_MAX_SEARCH_RADIUS = 50;
|
|
5
|
+
function initConfigMapillary(mapillary) {
|
|
6
|
+
if (!mapillary) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
if (!mapillary.accessToken) {
|
|
10
|
+
console.warn(`Configuration for streetview.mapillary requires an accessToken. See https://doc.geogirafe.org/docs/configuration#streetview`);
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const searchRadius = mapillary.searchRadius ?? MAPILLARY_MAX_SEARCH_RADIUS;
|
|
14
|
+
if (searchRadius > MAPILLARY_MAX_SEARCH_RADIUS) {
|
|
15
|
+
console.warn(`Configuration for streetview.mapillary.searchRadius cannot exceed ${MAPILLARY_MAX_SEARCH_RADIUS} meters. See https://doc.geogirafe.org/docs/configuration#streetview`);
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return { accessToken: mapillary.accessToken, searchRadius: searchRadius };
|
|
19
|
+
}
|
|
20
|
+
function initConfigGoogle(google) {
|
|
21
|
+
if (google && !google.apiKey) {
|
|
22
|
+
console.warn(`Configuration for streetview.google requires an apiKey. See https://doc.geogirafe.org/docs/configuration#streetview`);
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return google;
|
|
26
|
+
}
|
|
3
27
|
export function initConfigStreetView(config) {
|
|
4
28
|
const streetview = config.streetview;
|
|
5
29
|
if (!streetview) {
|
|
6
30
|
return undefined;
|
|
7
31
|
}
|
|
8
|
-
if (streetview.google && !streetview.google.apiKey) {
|
|
9
|
-
throw new Error(`Configuration for streetview.google requires an apiKey. See https://doc.geogirafe.org/docs/configuration`);
|
|
10
|
-
}
|
|
11
32
|
return {
|
|
12
33
|
searchRadius: streetview.searchRadius ?? DEFAULT_STREETVIEW_SEARCH_RADIUS,
|
|
13
|
-
google: streetview.google
|
|
34
|
+
google: initConfigGoogle(streetview.google),
|
|
35
|
+
mapillary: initConfigMapillary(streetview.mapillary)
|
|
14
36
|
};
|
|
15
37
|
}
|
|
16
38
|
export function isStreetViewProviderConfigured(config, provider) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
import DrawingFeature, { DrawingShape } from './drawingFeature.js';
|
|
3
3
|
import { Collection, Feature } from 'ol';
|
|
4
|
-
import { Circle as CircleGeom, Geometry,
|
|
4
|
+
import { Circle as CircleGeom, Geometry, LineString, Point, Polygon } from 'ol/geom.js';
|
|
5
5
|
import { createBox, createRegularPolygon } from 'ol/interaction/Draw.js';
|
|
6
6
|
import { Circle, Fill, RegularShape, Stroke, Style, Text } from 'ol/style.js';
|
|
7
7
|
import { Draw, Modify, Snap, Translate } from 'ol/interaction.js';
|
|
@@ -15,7 +15,7 @@ import { ContextMenu, EntryInteractionType } from './contextmenu.js';
|
|
|
15
15
|
import { formatCoordinates } from '../geometrytools.js';
|
|
16
16
|
import { v4 as uuidv4 } from 'uuid';
|
|
17
17
|
import { isAlternateMouseClick, isPrimaryPointerAction } from '../state/userinteractionevent.js';
|
|
18
|
-
import { calculateCenterAndMinRadius, createScaledAndRotatedGeometry, getGeometryForRendering, shouldAllowVertexInsertionForShape } from './shapeConstraints.js';
|
|
18
|
+
import { calculateCenterAndMinRadius, createScaledAndRotatedGeometry, extractVerticesFromGeometry, getGeometryForRendering, shouldAllowVertexInsertionForShape } from './shapeConstraints.js';
|
|
19
19
|
import Transform from 'ol-ext/interaction/Transform.js';
|
|
20
20
|
function getLineStroke(strokeType, lineWidth) {
|
|
21
21
|
switch (strokeType) {
|
|
@@ -29,26 +29,6 @@ function getLineStroke(strokeType, lineWidth) {
|
|
|
29
29
|
return [0.01, 5 * lineWidth];
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function extractVerticesFromGeometry(geometry) {
|
|
33
|
-
let vertices = [];
|
|
34
|
-
// Extract coordinates depending on coordinate array depth
|
|
35
|
-
if (geometry instanceof Point) {
|
|
36
|
-
vertices = [geometry.getCoordinates()];
|
|
37
|
-
}
|
|
38
|
-
else if (geometry instanceof MultiPoint || geometry instanceof LineString || geometry instanceof LinearRing) {
|
|
39
|
-
vertices = geometry.getCoordinates();
|
|
40
|
-
}
|
|
41
|
-
else if (geometry instanceof Polygon || geometry instanceof MultiLineString) {
|
|
42
|
-
vertices = geometry.getCoordinates().flat();
|
|
43
|
-
}
|
|
44
|
-
else if (geometry instanceof MultiPolygon) {
|
|
45
|
-
vertices = geometry
|
|
46
|
-
.getCoordinates()
|
|
47
|
-
.flat()
|
|
48
|
-
.map((coordinateList) => coordinateList.flat());
|
|
49
|
-
}
|
|
50
|
-
return new MultiPoint(vertices);
|
|
51
|
-
}
|
|
52
32
|
export default class OlDrawing {
|
|
53
33
|
map;
|
|
54
34
|
// Writes drawn features into the specified location in the extended state
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Coordinate } from 'ol/coordinate.js';
|
|
2
|
-
import Geometry from 'ol/geom/Geometry.js';
|
|
3
2
|
import Feature from 'ol/Feature.js';
|
|
4
3
|
import { DrawingShape } from './drawingFeature.js';
|
|
4
|
+
import { Geometry, MultiPoint } from 'ol/geom.js';
|
|
5
5
|
export declare function calculateCenterAndMinRadius(geometry: Geometry): {
|
|
6
6
|
center: Coordinate;
|
|
7
7
|
minRadius: number;
|
|
@@ -9,3 +9,4 @@ export declare function calculateCenterAndMinRadius(geometry: Geometry): {
|
|
|
9
9
|
export declare function createScaledAndRotatedGeometry(geometry0: Geometry, center: Coordinate, minRadius: number, initialPoint: Coordinate, currentPoint: Coordinate): Geometry;
|
|
10
10
|
export declare function getGeometryForRendering(feature: Feature<Geometry>): Geometry | undefined;
|
|
11
11
|
export declare function shouldAllowVertexInsertionForShape(shapeType: DrawingShape | undefined): boolean;
|
|
12
|
+
export declare function extractVerticesFromGeometry(geometry: Geometry): MultiPoint;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
import { getCenter, getHeight, getWidth } from 'ol/extent.js';
|
|
3
|
-
import LineString from 'ol/geom/LineString.js';
|
|
4
|
-
import Polygon from 'ol/geom/Polygon.js';
|
|
5
3
|
import { DrawingShape } from './drawingFeature.js';
|
|
4
|
+
import { LinearRing, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from 'ol/geom.js';
|
|
6
5
|
const EPSILON = 1e-12;
|
|
7
6
|
function sqDistance(a, b) {
|
|
8
7
|
const dx = a[0] - b[0];
|
|
@@ -62,3 +61,20 @@ export function getGeometryForRendering(feature) {
|
|
|
62
61
|
export function shouldAllowVertexInsertionForShape(shapeType) {
|
|
63
62
|
return shapeType !== DrawingShape.Square && shapeType !== DrawingShape.Rectangle;
|
|
64
63
|
}
|
|
64
|
+
export function extractVerticesFromGeometry(geometry) {
|
|
65
|
+
let vertices = [];
|
|
66
|
+
// Extract coordinates depending on coordinate array depth
|
|
67
|
+
if (geometry instanceof Point) {
|
|
68
|
+
vertices = [geometry.getCoordinates()];
|
|
69
|
+
}
|
|
70
|
+
else if (geometry instanceof MultiPoint || geometry instanceof LineString || geometry instanceof LinearRing) {
|
|
71
|
+
vertices = geometry.getCoordinates();
|
|
72
|
+
}
|
|
73
|
+
else if (geometry instanceof Polygon || geometry instanceof MultiLineString) {
|
|
74
|
+
vertices = geometry.getCoordinates().flat();
|
|
75
|
+
}
|
|
76
|
+
else if (geometry instanceof MultiPolygon) {
|
|
77
|
+
vertices = geometry.getCoordinates().flat().flat();
|
|
78
|
+
}
|
|
79
|
+
return new MultiPoint(vertices);
|
|
80
|
+
}
|