@geogirafe/lib-geoportal 1.2.0-dev.2736532702 → 1.2.0-dev.2751114005
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/assets/i18n/de.json +3 -0
- package/assets/i18n/en.json +3 -0
- package/assets/i18n/fr.json +3 -0
- package/assets/i18n/it.json +3 -0
- package/assets/icons/share-native.svg +1 -0
- package/assets/icons/text-font.svg +1 -0
- package/components/drawing/component-mobile.js +1 -1
- package/components/drawing/component.d.ts +8 -1
- package/components/drawing/component.js +61 -6
- package/components/main.d.ts +1 -0
- package/components/main.js +1 -0
- package/components/menu-buttons-mobile/MenuMobile3dButton.js +1 -1
- package/components/menu-buttons-mobile/MenuMobileDrawingButton.js +1 -1
- package/components/menu-buttons-mobile/MenuMobileOfflineButton.js +1 -1
- package/components/menu-buttons-mobile/MenuMobileShareButton.d.ts +11 -0
- package/components/menu-buttons-mobile/MenuMobileShareButton.js +32 -0
- package/components/menu-buttons-mobile/style.css +3 -0
- package/components/menu-mobile/component.js +1 -1
- package/components/menu-mobile/style.css +4 -0
- package/components/share/component.js +4 -4
- package/components/share-mobile/component.d.ts +28 -0
- package/components/share-mobile/component.js +121 -0
- package/components/share-mobile/style.css +56 -0
- package/components/treeview/treeviewitem/component.js +9 -2
- package/models/layers/layerdrawing.d.ts +1 -0
- package/models/layers/layerdrawing.js +2 -1
- package/package.json +1 -1
- package/templates/mobile.html +2 -0
- package/templates/public/about.json +1 -1
- package/tools/app/geogirafeapp-mobile.js +4 -0
- package/tools/drawing/cesiumDrawing.d.ts +7 -0
- package/tools/drawing/cesiumDrawing.js +24 -1
- package/tools/drawing/drawingFeature.d.ts +3 -2
- package/tools/drawing/drawingFeature.js +5 -2
- package/tools/drawing/olDrawing.d.ts +41 -0
- package/tools/drawing/olDrawing.js +170 -15
- package/tools/state/graphicalInterface.d.ts +1 -1
- /package/{components/share/images → assets/icons}/facebook.svg +0 -0
- /package/{components/share/images → assets/icons}/linkedin.svg +0 -0
- /package/{components/share/images/mail.svg → assets/icons/share-mail.svg} +0 -0
- /package/{components/share/images → assets/icons}/twitter.svg +0 -0
package/LICENSE
CHANGED
|
@@ -246,6 +246,7 @@ From:
|
|
|
246
246
|
- https://www.svgrepo.com/svg/310166/thumb-dislike
|
|
247
247
|
- https://www.svgrepo.com/svg/309871/photo-filter
|
|
248
248
|
- https://www.svgrepo.com/svg/309651/full-screen-zoom
|
|
249
|
+
- https://www.svgrepo.com/svg/310134/text-font
|
|
249
250
|
|
|
250
251
|
|
|
251
252
|
The MIT License (MIT)
|
package/assets/i18n/de.json
CHANGED
|
@@ -488,6 +488,7 @@
|
|
|
488
488
|
"Send message": "Nachricht senden",
|
|
489
489
|
"Settings": "Einstellungen",
|
|
490
490
|
"Shadows": "Schatten",
|
|
491
|
+
"Share map": "Karte teilen",
|
|
491
492
|
"Share this map": "Diese Karte teilen",
|
|
492
493
|
"share-panel": "Karte teilen oder einbetten",
|
|
493
494
|
"Show metadata": "Metadaten anzeigen",
|
|
@@ -523,6 +524,8 @@
|
|
|
523
524
|
"system": "System",
|
|
524
525
|
"Take measure": "Messen",
|
|
525
526
|
"Test for Translation": "Test für Übersetzung",
|
|
527
|
+
"Text": "Text",
|
|
528
|
+
"Text to draw": "Zu zeichnender Text",
|
|
526
529
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Vielen Dank für Ihre Nachricht. Falls erforderlich, wird sich so schnell wie möglich jemand mit Ihnen in Verbindung setzen.",
|
|
527
530
|
"The CSV export has been truncated to the maximum number of features allowed for download": "Der CSV-Export wurde auf die maximal zulässige Anzahl herunterladbarer Objekte begrenzt.",
|
|
528
531
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Der folgende Link wird mit Ihrer Nachricht gesendet. Er enthält Ihre aktuelle Konfiguration und hilft uns, Ihr Problem zu verstehen.",
|
package/assets/i18n/en.json
CHANGED
|
@@ -490,6 +490,7 @@
|
|
|
490
490
|
"Send message": "Send message",
|
|
491
491
|
"Settings": "Settings",
|
|
492
492
|
"Shadows": "Shadows",
|
|
493
|
+
"Share map": "Share map",
|
|
493
494
|
"Share this map": "Share this map",
|
|
494
495
|
"share-panel": "Share or embed map",
|
|
495
496
|
"Show metadata": "Show metadata",
|
|
@@ -526,6 +527,8 @@
|
|
|
526
527
|
"system": "System",
|
|
527
528
|
"Take measure": "Take measure",
|
|
528
529
|
"Test for Translation": "Test for Translation",
|
|
530
|
+
"Text": "Text",
|
|
531
|
+
"Text to draw": "Text to draw",
|
|
529
532
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Thanks for your message. If necessary, someone will get in touch with you as soon as possible.",
|
|
530
533
|
"The CSV export has been truncated to the maximum number of features allowed for download": "The CSV export has been truncated to the maximum number of features allowed for download.",
|
|
531
534
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.",
|
package/assets/i18n/fr.json
CHANGED
|
@@ -488,6 +488,7 @@
|
|
|
488
488
|
"Send message": "Envoyer un message",
|
|
489
489
|
"Settings": "Paramètres",
|
|
490
490
|
"Shadows": "Ombres",
|
|
491
|
+
"Share map": "Partager la carte",
|
|
491
492
|
"Share this map": "Partager cette carte",
|
|
492
493
|
"share-panel": "Partager ou intégrer la carte",
|
|
493
494
|
"Show metadata": "Afficher les métadonnées",
|
|
@@ -523,6 +524,8 @@
|
|
|
523
524
|
"system": "Système",
|
|
524
525
|
"Take measure": "Prendre une mesure",
|
|
525
526
|
"Test for Translation": "Test de traduction",
|
|
527
|
+
"Text": "Texte",
|
|
528
|
+
"Text to draw": "Texte à dessiner",
|
|
526
529
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Merci pour votre message. Si nécessaire, quelqu'un prendra contact avec vous dès que possible.",
|
|
527
530
|
"The CSV export has been truncated to the maximum number of features allowed for download": "L’export CSV a été limité au nombre maximal d’entités autorisées au téléchargement.",
|
|
528
531
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Le lien ci-dessous sera envoyé avec votre message. Il contient votre configuration courante et nous aidera à analyser votre demande.",
|
package/assets/i18n/it.json
CHANGED
|
@@ -488,6 +488,7 @@
|
|
|
488
488
|
"Send message": "Invia messaggio",
|
|
489
489
|
"Settings": "Impostazioni",
|
|
490
490
|
"Shadows": "Ombre",
|
|
491
|
+
"Share map": "Condividi la mappa",
|
|
491
492
|
"Share this map": "Condividi questa mappa",
|
|
492
493
|
"share-panel": "Condividi o incorpora la mappa",
|
|
493
494
|
"Show metadata": "Mostra metadati",
|
|
@@ -523,6 +524,8 @@
|
|
|
523
524
|
"system": "Sistema",
|
|
524
525
|
"Take measure": "Prendi misura",
|
|
525
526
|
"Test for Translation": "Test di traduzione",
|
|
527
|
+
"Text": "Testo",
|
|
528
|
+
"Text to draw": "Testo da disegnare",
|
|
526
529
|
"Thanks for your message. If necessary, somebody will enter in contact with you as soon as possible.": "Grazie per il tuo messaggio. Se necessario, qualcuno ti contatterà il prima possibile.",
|
|
527
530
|
"The CSV export has been truncated to the maximum number of features allowed for download": "L'esportazione CSV è stata limitata al numero massimo di elementi consentiti per il download.",
|
|
528
531
|
"The following link will be sent with your message. It contains your current configuration and will help us to understand your problem.": "Il seguente link verrà inviato con il tuo messaggio. Contiene la tua configurazione attuale e ci aiuterà a capire il problema.",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><mask id="a" width="24" height="24" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#d9d9d9" d="M0 0h24v24H0z"/></mask><g mask="url(#a)"><path fill="#1c1b1f" d="M18 22a2.9 2.9 0 0 1-2.125-.875A2.9 2.9 0 0 1 15 19q0-.175.025-.363.025-.187.075-.337l-7.05-4.1q-.425.375-.95.588T6 15a2.9 2.9 0 0 1-2.125-.875A2.9 2.9 0 0 1 3 12q0-1.25.875-2.125A2.9 2.9 0 0 1 6 9q.575 0 1.1.213.525.212.95.587l7.05-4.1a2 2 0 0 1-.075-.338A3 3 0 0 1 15 5q0-1.25.875-2.125A2.9 2.9 0 0 1 18 2q1.25 0 2.125.875T21 5t-.875 2.125A2.9 2.9 0 0 1 18 8q-.575 0-1.1-.213a3.3 3.3 0 0 1-.95-.587L8.9 11.3q.05.15.075.337a2.7 2.7 0 0 1 0 .726 2 2 0 0 1-.075.337l7.05 4.1q.425-.375.95-.588T18 16q1.25 0 2.125.875T21 19t-.875 2.125A2.9 2.9 0 0 1 18 22m0-16q.424 0 .712-.287A.97.97 0 0 0 19 5a.97.97 0 0 0-.288-.713A.97.97 0 0 0 18 4a.97.97 0 0 0-.712.287A.97.97 0 0 0 17 5q0 .424.288.713Q17.575 6 18 6M6 13q.424 0 .713-.287A.97.97 0 0 0 7 12a.97.97 0 0 0-.287-.713A.97.97 0 0 0 6 11a.97.97 0 0 0-.713.287A.97.97 0 0 0 5 12q0 .424.287.713Q5.576 13 6 13m12 7q.424 0 .712-.288A.97.97 0 0 0 19 19a.97.97 0 0 0-.288-.712A.97.97 0 0 0 18 18a.97.97 0 0 0-.712.288A.97.97 0 0 0 17 19q0 .424.288.712.287.288.712.288"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="800" viewBox="0 0 24 24"><title>ic_fluent_text_font_24_regular</title><path fill="#212121" fill-rule="nonzero" d="M14.503 6a.75.75 0 0 1 .697.474l5.555 14.03h.494a.75.75 0 0 1 0 1.5H18.75a.75.75 0 0 1 0-1.5h.392l-1.19-3.004h-6.91L9.85 20.504h.4a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h.486l5.57-14.03A.75.75 0 0 1 14.503 6m0 2.785L11.637 16h5.72zM7 2a.75.75 0 0 1 .703.49l3.187 8.619-.828 2.086-.627-1.694H4.564L3.45 14.51a.75.75 0 0 1-1.407-.521l4.253-11.5A.75.75 0 0 1 7 2m0 2.913L5.118 10h3.763z"/></svg>
|
|
@@ -14,7 +14,7 @@ input{border:1px solid var(--bkg-color-grad1);width:inherit;background-color:var
|
|
|
14
14
|
button.selected{background-color:#daebff!important;border:1px solid #54a4ff!important}#toolbar{box-sizing:border-box;grid-template-columns:repeat(5,1fr);gap:20px;width:100%;display:grid}#toolbar>button{box-sizing:border-box;filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;padding:10px}#toolbar>button>img{opacity:.7;width:100%}.icon{width:1.5rem;height:1.5rem}.gg-icon-button:hover{background-color:#0000}#panel{font-size:1.5em}#drawingList{gap:10px}#drawingList .girafe{filter:drop-shadow(0 4px 7px #0004381c);background:#fff;border:none;border-radius:8px;padding:10px}#optionsTitle{text-align:center;filter:drop-shadow(0 4px 7px #0004381c);color:#4553ff;border-radius:8px;width:100%;margin-bottom:20px;padding:10px;font-size:1.6rem}.gg-input:hover{filter:drop-shadow(0 4px 7px #4c58ff70);background-color:#fff}#optionsColorLine{flex-direction:column;display:flex}#optionsColorLine>div{text-align:end;width:100%}.selectable-label{font-size:1.3em}#optionsNameFontSize,#optionsMeasuresFontSize,#optionsStrokeWidth,#line-style,#arrow-style,#arrow-position{text-align:right;border:1px solid #e3e3e3;padding:1px;font-size:1em}.popup.popup_top{translate:15px -15px}#optionsExportLine{display:none}
|
|
15
15
|
</style>
|
|
16
16
|
<style>${this.customStyle}</style>
|
|
17
|
-
<link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="panel"><div><div id="toolbar"><button id="disable" tip="Disable drawing" class="gg-icon-button gg-medium"><img alt="select icon" src="icons/arrow.svg"></button> <button id="point" tip="Point" class="gg-icon-button gg-medium"><img alt="point icon" src="icons/point.svg"></button> <button id="line" tip="Line" class="gg-icon-button gg-medium"><img alt="polyline icon" src="icons/polyline.svg"></button> <button id="polygon" tip="Polygon" class="gg-icon-button gg-medium"><img alt="polygon icon" src="icons/polygon.svg"></button> <button id="square" tip="Square" class="gg-icon-button gg-medium"><img alt="square icon" src="icons/square.svg"></button> <button id="rectangle" tip="Rectangle" class="gg-icon-button gg-medium"><img alt="rectangle icon" src="icons/rectangle.svg"></button> <button id="circle" tip="Circle" class="gg-icon-button gg-medium"><img alt="circle icon" src="icons/circle.svg"></button> <button id="freeline" tip="Freehand line" class="gg-icon-button gg-medium"><img alt="polyline-free icon" src="icons/polyline-free.svg"></button> <button id="freepolygon" tip="Freehand polygon" class="gg-icon-button gg-medium"><img alt="polygon-free icon" src="icons/polygon-free.svg"></button></div><div id="toolParametersContainer"><span i18n="Settings" class="title"></span><div class="toolParameters" data-tool="Polyline,Polygon"><girafe-fixed-dimension dimensionname="length" dimension="length" id="fixedLineLength" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Square"><girafe-fixed-dimension dimensionname="side length" dimension="side" id="fixedSquareSide" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Rectangle"><girafe-fixed-dimension dimensionname="width" dimension="width" id="fixedRectangleWidth" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension><girafe-fixed-dimension dimensionname="height" dimension="height" id="fixedRectangleHeight" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div></div></div><div id="drawingListContainer"><div class="titleContainer"><span i18n="Drawing List" class="title"></span> <button class="gg-icon-button icon" tip="Delete all shapes" onclick="${() => this.deleteAllFeatures()}" ?disabled="${this.drawingState.features.length === 0}">${this.htmlUnsafe(this.trashIcon)}</button></div><div id="drawingList">${this.drawingState.features.map(feature => uHtmlFor(feature, feature.id) `<div id="${'f-' + feature.id}" class="girafe"><button id="${'f-select-' + feature.id}" class="gg-icon-button gg-small" tip="Select to change appearance" onclick="${() => this.onToggleFeatureSelection(feature)}"><div class="icon">${this.htmlUnsafe(feature.selected ? this.checkedIcon : this.noCheckedIcon)}</div></button><div class="label-container"><button class="${feature.selected ? 'selectable-label gg-icon-button gg-small gg-selected' : 'selectable-label gg-icon-button gg-small gg-opacity'}" onclick="${() => this.onToggleFeatureSelection(feature)}"><span id="${'f-name-' + feature.id}">${feature.name}</span></button></div><button class="gg-icon-button icon" tip="Center on shape" onclick="${() => this.olDrawing.centerViewOnFeature(feature)}">${this.htmlUnsafe(this.locateIcon)}</button> <button class="gg-icon-button icon" tip="Delete shape" onclick="${() => this.deleteFeature(feature)}">${this.htmlUnsafe(this.trashIcon)}</button></div>`)}</div></div><div id="options" class="${this.selectedFeatures.length > 0 ? '' : 'disabled'}"><fieldset class="field-wrapper" disabled="${this.selectedFeatures.length <= 0}"><input id="optionsTitle" value="${this.getOptionsTitle()}" class="gg-input" disabled="${this.selectedFeatures.length > 1}"><div id="optionsText"><div id="optionsTextLines"><span class="label first" i18n="Name">Name</span> <button class="gg-icon-button icon" id="visibleIconName" tip="Show or hide shape name" onclick="${() => this.toggleNameVisibility()}">${this.htmlUnsafe(this.isDisplayNameEnabled() ? this.visibleIcon : this.notVisibleIcon)}</button> <span class="label" i18n="Font">Font</span> <input id="optionsNameFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.nameFontSize}" oninput="${() => this.onOptionsChange()}"> <span class="unit">pt</span> <button class="icon colorPicker" id="nameColorPicker"></button> <span class="label first" i18n="Measures">Measures</span> <select id="measure-information" class="gg-select" tip="${this.measureInformationTooltip}" onchange="${() => this.onOptionsChange()}">${Object.entries(this.measureInformations).map((entry) => uHtml `<option selected="${this.selectedFeatureMeasureInformation === entry[0]}" value="${entry[0]}"><span i18n="${entry[1]}">${entry[0]}</span></option>`)}</select> <span class="label" i18n="Font">Font</span> <input id="optionsMeasuresFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.measureFontSize}" oninput="${() => this.onOptionsChange()}"> <span class="unit">pt</span> <button class="icon colorPicker" id="measureColorPicker"></button></div></div><hr><div id="optionsColor"><div id="optionsColorLine"><div><span class="text-end" i18n="Stroke color">Stroke color</span> <button class="icon colorPicker" id="strokePicker"></button></div><div><span class="${this.isFillColorEnabled() ? 'text-end' : 'text-end disabled'}" id="fillPickerSpan" i18n="Fill color">Fill color</span> <button class="icon colorPicker" disabled="${!this.isFillColorEnabled()}" id="fillPicker"></button></div></div></div><hr><div id="optionsLine"><div id="optionsLineLines"><span i18n="Line width">Line width</span> <input id="optionsStrokeWidth" type="number" class="gg-input" min="1" value="${this.selectedFeatures[0]?.strokeWidth}" oninput="${() => this.onOptionsChange()}"> <span class="unit">px</span> <select id="line-style" class="gg-select" onchange="${() => this.onOptionsChange()}">${Object.entries(this.lineStyles).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.lineStroke === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select></div></div><hr><div id="optionsArrow"><div class="${this.
|
|
17
|
+
<link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="panel"><div><div id="toolbar"><button id="disable" tip="Disable drawing" class="gg-icon-button gg-medium"><img alt="select icon" src="icons/arrow.svg"></button> <button id="point" tip="Point" class="gg-icon-button gg-medium"><img alt="point icon" src="icons/point.svg"></button> <button id="line" tip="Line" class="gg-icon-button gg-medium"><img alt="polyline icon" src="icons/polyline.svg"></button> <button id="polygon" tip="Polygon" class="gg-icon-button gg-medium"><img alt="polygon icon" src="icons/polygon.svg"></button> <button id="square" tip="Square" class="gg-icon-button gg-medium"><img alt="square icon" src="icons/square.svg"></button> <button id="rectangle" tip="Rectangle" class="gg-icon-button gg-medium"><img alt="rectangle icon" src="icons/rectangle.svg"></button> <button id="circle" tip="Circle" class="gg-icon-button gg-medium"><img alt="circle icon" src="icons/circle.svg"></button> <button id="freeline" tip="Freehand line" class="gg-icon-button gg-medium"><img alt="polyline-free icon" src="icons/polyline-free.svg"></button> <button id="freepolygon" tip="Freehand polygon" class="gg-icon-button gg-medium"><img alt="polygon-free icon" src="icons/polygon-free.svg"></button> <button id="text" tip="Text" class="gg-icon-button gg-medium"><img alt="text icon" src="icons/text-font.svg"></button></div><div id="toolParametersContainer"><span i18n="Settings" class="title"></span><div class="toolParameters" data-tool="Polyline,Polygon"><girafe-fixed-dimension dimensionname="length" dimension="length" id="fixedLineLength" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Square"><girafe-fixed-dimension dimensionname="side length" dimension="side" id="fixedSquareSide" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Rectangle"><girafe-fixed-dimension dimensionname="width" dimension="width" id="fixedRectangleWidth" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension><girafe-fixed-dimension dimensionname="height" dimension="height" id="fixedRectangleHeight" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Text"><label class="gg-label" for="drawingText" i18n="Text to draw">Text to draw</label> <input id="drawingText" class="gg-input" value="${this.drawingText}" oninput="${(e) => this.drawingTextChangedHandler(e)}"></div></div></div><div id="drawingListContainer"><div class="titleContainer"><span i18n="Drawing List" class="title"></span> <button class="gg-icon-button icon" tip="Delete all shapes" onclick="${() => this.deleteAllFeatures()}" ?disabled="${this.drawingState.features.length === 0}">${this.htmlUnsafe(this.trashIcon)}</button></div><div id="drawingList">${this.drawingState.features.map(feature => uHtmlFor(feature, feature.id) `<div id="${'f-' + feature.id}" class="girafe"><button id="${'f-select-' + feature.id}" class="gg-icon-button gg-small" tip="Select to change appearance" onclick="${() => this.onToggleFeatureSelection(feature)}"><div class="icon">${this.htmlUnsafe(feature.selected ? this.checkedIcon : this.noCheckedIcon)}</div></button><div class="label-container"><button class="${feature.selected ? 'selectable-label gg-icon-button gg-small gg-selected' : 'selectable-label gg-icon-button gg-small gg-opacity'}" onclick="${() => this.onToggleFeatureSelection(feature)}"><span id="${'f-name-' + feature.id}">${feature.name}</span></button></div><button class="gg-icon-button icon" tip="Center on shape" onclick="${() => this.olDrawing.centerViewOnFeature(feature)}">${this.htmlUnsafe(this.locateIcon)}</button> <button class="gg-icon-button icon" tip="Delete shape" onclick="${() => this.deleteFeature(feature)}">${this.htmlUnsafe(this.trashIcon)}</button></div>`)}</div></div><div id="options" class="${this.selectedFeatures.length > 0 ? '' : 'disabled'}"><fieldset class="field-wrapper" disabled="${this.selectedFeatures.length <= 0}"><input id="optionsTitle" value="${this.getOptionsTitle()}" class="gg-input" disabled="${this.selectedFeatures.length > 1}"><div id="optionsText"><div id="optionsTextLines"><span class="label first" i18n="Name">Name</span> <button class="gg-icon-button icon" id="visibleIconName" tip="Show or hide shape name" onclick="${() => this.toggleNameVisibility()}">${this.htmlUnsafe(this.isDisplayNameEnabled() ? this.visibleIcon : this.notVisibleIcon)}</button> <span class="label" i18n="Font">Font</span> <input id="optionsNameFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.nameFontSize}" oninput="${() => this.onOptionsChange()}"> <span class="unit">pt</span> <button class="icon colorPicker" id="nameColorPicker"></button> <span class="${this.isMeasureInformationEnabled() ? 'label first' : 'label first disabled'}" i18n="Measures">Measures</span> <select id="measure-information" class="gg-select" tip="${this.measureInformationTooltip}" disabled="${!this.isMeasureInformationEnabled()}" onchange="${() => this.onOptionsChange()}">${Object.entries(this.measureInformations).map((entry) => uHtml `<option selected="${this.selectedFeatureMeasureInformation === entry[0]}" value="${entry[0]}"><span i18n="${entry[1]}">${entry[0]}</span></option>`)}</select> <span class="${this.isMeasureInformationEnabled() ? 'label' : 'label disabled'}" i18n="Font">Font</span> <input id="optionsMeasuresFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.measureFontSize}" disabled="${!this.isMeasureInformationEnabled()}" oninput="${() => this.onOptionsChange()}"> <span class="${this.isMeasureInformationEnabled() ? 'unit' : 'unit disabled'}">pt</span> <button class="icon colorPicker" id="measureColorPicker" disabled="${!this.isMeasureInformationEnabled()}"></button></div></div><hr><div id="optionsColor"><div id="optionsColorLine"><div><span class="${this.isStrokeColorEnabled() ? 'text-end' : 'text-end disabled'}" i18n="Stroke color">Stroke color</span> <button class="icon colorPicker" disabled="${!this.isStrokeColorEnabled()}" id="strokePicker"></button></div><div><span class="${this.isFillColorEnabled() ? 'text-end' : 'text-end disabled'}" id="fillPickerSpan" i18n="Fill color">Fill color</span> <button class="icon colorPicker" disabled="${!this.isFillColorEnabled()}" id="fillPicker"></button></div></div></div><hr><div id="optionsLine"><div class="${this.isLineStyleEnabled() ? '' : 'disabled'}" id="optionsLineLines"><span i18n="Line width">Line width</span> <input id="optionsStrokeWidth" type="number" class="gg-input" min="1" value="${this.selectedFeatures[0]?.strokeWidth}" oninput="${() => this.onOptionsChange()}"> <span class="unit">px</span> <select id="line-style" class="gg-select" onchange="${() => this.onOptionsChange()}">${Object.entries(this.lineStyles).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.lineStroke === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select></div></div><hr><div id="optionsArrow"><div class="${this.isLineArrowEnabled() ? '' : 'disabled'}" id="optionsArrowStyles"><span i18n="Arrows style">Arrows style</span> <select id="arrow-style" class="gg-select" onchange="${() => this.onArrowsChange()}">${Object.entries(this.arrowStyles).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.arrowStyle === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select> <select id="arrow-position" class="gg-select" onchange="${() => this.onArrowsChange()}">${Object.entries(this.arrowPositions).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.arrowPosition === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select></div></div><hr><div id="optionsExport"><div id="optionsExportLine"><label for="export" class="gg-label" i18n="Export">Export</label> <button class="gg-button" onclick="${() => this.exportSelectedFeatures('geojson')}">GeoJson</button> <button class="gg-button" onclick="${() => this.exportSelectedFeatures('kml')}">KML</button> <button class="gg-button" onclick="${() => this.exportSelectedFeatures('gpx')}">GPX</button></div></div></fieldset></div></div>
|
|
18
18
|
${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
19
19
|
};
|
|
20
20
|
constructor() {
|
|
@@ -44,6 +44,7 @@ export default class DrawingComponent extends GirafeHTMLElement implements IGira
|
|
|
44
44
|
olDrawing: OlDrawing;
|
|
45
45
|
cesiumDrawing: CesiumDrawing;
|
|
46
46
|
fixedLengthEnabled: boolean;
|
|
47
|
+
drawingText: string;
|
|
47
48
|
batchCreateMode: boolean;
|
|
48
49
|
constructor(name?: string);
|
|
49
50
|
render(): void;
|
|
@@ -55,6 +56,7 @@ export default class DrawingComponent extends GirafeHTMLElement implements IGira
|
|
|
55
56
|
setTool(tool?: DrawingShape | null): void;
|
|
56
57
|
showToolParameters(tool?: DrawingShape | null): void;
|
|
57
58
|
protected fixedDimensionValueChangedHandler(e: CustomEvent): void;
|
|
59
|
+
protected drawingTextChangedHandler(e: Event): void;
|
|
58
60
|
protected connectedCallback(): void;
|
|
59
61
|
togglePanel(visible: boolean): void;
|
|
60
62
|
get selectedFeatures(): DrawingFeature[];
|
|
@@ -67,8 +69,12 @@ export default class DrawingComponent extends GirafeHTMLElement implements IGira
|
|
|
67
69
|
deactivateLayerInTreeAnMap(): void;
|
|
68
70
|
protected getOptionsTitle(): string;
|
|
69
71
|
protected isDisplayNameEnabled(): boolean;
|
|
70
|
-
protected
|
|
72
|
+
protected isLineArrowEnabled(): boolean;
|
|
71
73
|
protected isFillColorEnabled(): boolean;
|
|
74
|
+
protected isStrokeColorEnabled(): boolean;
|
|
75
|
+
protected isLineStyleEnabled(): boolean;
|
|
76
|
+
protected isMeasureInformationEnabled(): boolean;
|
|
77
|
+
private selectedFeaturesHasTextFeature;
|
|
72
78
|
deleteFeature(feature: DrawingFeature): Promise<void>;
|
|
73
79
|
deleteAllFeatures(): Promise<void>;
|
|
74
80
|
onOptionsChange(): void;
|
|
@@ -76,5 +82,6 @@ export default class DrawingComponent extends GirafeHTMLElement implements IGira
|
|
|
76
82
|
toggleNameVisibility(): void;
|
|
77
83
|
private warnWhenInWebMercator;
|
|
78
84
|
exportSelectedFeatures(format: 'geojson' | 'kml' | 'gpx'): void;
|
|
85
|
+
private onRemovalRequested;
|
|
79
86
|
}
|
|
80
87
|
export {};
|
|
@@ -25,6 +25,7 @@ import visibleIcon from './assets/visible.svg?raw';
|
|
|
25
25
|
import notVisibleIcon from './assets/notVisible.svg?raw';
|
|
26
26
|
import LayerDrawing from '../../models/layers/layerdrawing.js';
|
|
27
27
|
import { UsedInTemplateOnly } from '../../decorators.js';
|
|
28
|
+
import { noop } from '../../tools/utils/async.js';
|
|
28
29
|
export const DrawingStateLocation = 'drawing';
|
|
29
30
|
export default class DrawingComponent extends GirafeHTMLElement {
|
|
30
31
|
templateUrl = null;
|
|
@@ -36,7 +37,7 @@ export default class DrawingComponent extends GirafeHTMLElement {
|
|
|
36
37
|
input{border:1px solid var(--bkg-color-grad1);width:inherit;background-color:var(--bkg-color-input);padding-right:0}input:focus{border:1px solid var(--lt-color-gray-900)}button{border:solid 1px var(--bkg-color);color:var(--text-color);background-color:var(--bkg-color);cursor:pointer;padding:0}button:hover{border:solid 1px var(--text-color-grad2)}button.selected{border:solid 1px var(--text-color-grad2);background-color:var(--bkg-color-grad1);color:var(--bkg-color)}#toolbar{flex-wrap:wrap;display:flex}.label-container{flex-grow:1}.text-end{text-align:end}.icon{width:1.2rem;height:1.2rem;fill:var(--text-color);flex-shrink:0;margin:3px}.icon:hover{fill:var(--text-color-grad2)}.gg-icon-button:hover{border:none}.colorPicker{border:1px solid var(--text-color);border-radius:5px}.picker_wrapper{transform:translate(-250px)}.picker_arrow{transform:translate(200px)rotate(90deg)scaleX(-1)!important}.picker_wrapper,.picker_arrow:after,.picker_arrow:before{background-color:var(--bkg-color)!important}.picker_wrapper,.picker_arrow:before{box-shadow:0 0 10px 1px var(--text-color-grad1)!important}button:disabled,input:disabled,.disabled{pointer-events:none;opacity:.5}fieldset.field-wrapper{border:0;margin:0;padding:0}#panel{height:100%;color:var(--text-color);flex-direction:column;display:flex}#panel>div{padding:1rem}#toolParametersContainer{& .title{margin-top:.5rem;margin-bottom:.75rem;display:inline-block}}.toolParameters{flex-direction:column;justify-content:left;row-gap:.25rem;display:flex}.toolParameters>label{padding:0 5px}#drawingListContainer{flex-grow:1;overflow:hidden auto;padding-top:0!important;& .titleContainer{margin-bottom:1rem;display:flex;& .title{flex-grow:1;align-items:center;display:flex}}}#drawingList{flex-flow:column;gap:.15rem;display:flex}#drawingList .girafe{border:solid 1px var(--text-color);flex-wrap:wrap;align-items:center;padding:.3rem;display:flex;position:relative}#drawingList .girafe span{flex-grow:1;padding-left:5px}#options{box-shadow:0px -2px 3px -1px var(--text-color-grad1);z-index:100;flex-direction:column;display:flex;position:relative}#optionsTitle{text-align:center;margin-bottom:20px;font-size:1.2rem}#options hr{width:100%;margin:8px 0}#optionsTextLines,#optionsColorLine,#optionsLineLines{align-items:center;display:grid}#optionsText{margin:auto}#optionsTextLines{grid-template-columns:.825fr 2.5fr 1fr 4em .5fr .5fr}#optionsTextLines button:hover{border:none}#optionsColor,#optionsLine,#optionsExport,#optionsArrow{margin:auto}#optionsColorLine{display:flex}#optionsColorLine>div{align-items:center;width:100%;display:flex}#optionsLineLines,#optionsArrowStyle{grid-template-columns:3fr 4em 1fr auto}#optionsExportLine{grid-template-columns:60px 60px 45px 45px;gap:.2rem;display:flex}span.label{padding-left:.5rem;padding-right:.5rem;&.first{padding-left:0}}span.unit{padding-left:.5rem}
|
|
37
38
|
</style>
|
|
38
39
|
<style>${this.customStyle}</style>
|
|
39
|
-
<link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="panel"><div><div id="toolbar"><button id="disable" tip="Disable drawing" class="gg-icon-button gg-medium"><img alt="select icon" src="icons/arrow.svg"></button> <button id="point" tip="Point" class="gg-icon-button gg-medium"><img alt="point icon" src="icons/point.svg"></button> <button id="line" tip="Line" class="gg-icon-button gg-medium"><img alt="polyline icon" src="icons/polyline.svg"></button> <button id="polygon" tip="Polygon" class="gg-icon-button gg-medium"><img alt="polygon icon" src="icons/polygon.svg"></button> <button id="square" tip="Square" class="gg-icon-button gg-medium"><img alt="square icon" src="icons/square.svg"></button> <button id="rectangle" tip="Rectangle" class="gg-icon-button gg-medium"><img alt="rectangle icon" src="icons/rectangle.svg"></button> <button id="circle" tip="Circle" class="gg-icon-button gg-medium"><img alt="circle icon" src="icons/circle.svg"></button> <button id="freeline" tip="Freehand line" class="gg-icon-button gg-medium"><img alt="polyline-free icon" src="icons/polyline-free.svg"></button> <button id="freepolygon" tip="Freehand polygon" class="gg-icon-button gg-medium"><img alt="polygon-free icon" src="icons/polygon-free.svg"></button></div><div id="toolParametersContainer"><span i18n="Settings" class="title"></span><div class="toolParameters" data-tool="Polyline,Polygon"><girafe-fixed-dimension dimensionname="length" dimension="length" id="fixedLineLength" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Square"><girafe-fixed-dimension dimensionname="side length" dimension="side" id="fixedSquareSide" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Rectangle"><girafe-fixed-dimension dimensionname="width" dimension="width" id="fixedRectangleWidth" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension><girafe-fixed-dimension dimensionname="height" dimension="height" id="fixedRectangleHeight" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div></div></div><div id="drawingListContainer"><div class="titleContainer"><span i18n="Drawing List" class="title"></span> <button class="gg-icon-button icon" tip="Delete all shapes" onclick="${() => this.deleteAllFeatures()}" ?disabled="${this.drawingState.features.length === 0}">${this.htmlUnsafe(this.trashIcon)}</button></div><div id="drawingList">${this.drawingState.features.map(feature => uHtmlFor(feature, feature.id) `<div id="${'f-' + feature.id}" class="girafe"><button id="${'f-select-' + feature.id}" class="gg-icon-button gg-small" tip="Select to change appearance" onclick="${() => this.onToggleFeatureSelection(feature)}"><div class="icon">${this.htmlUnsafe(feature.selected ? this.checkedIcon : this.noCheckedIcon)}</div></button><div class="label-container"><button class="${feature.selected ? 'selectable-label gg-icon-button gg-small gg-selected' : 'selectable-label gg-icon-button gg-small gg-opacity'}" onclick="${() => this.onToggleFeatureSelection(feature)}"><span id="${'f-name-' + feature.id}">${feature.name}</span></button></div><button class="gg-icon-button icon" tip="Center on shape" onclick="${() => this.olDrawing.centerViewOnFeature(feature)}">${this.htmlUnsafe(this.locateIcon)}</button> <button class="gg-icon-button icon" tip="Delete shape" onclick="${() => this.deleteFeature(feature)}">${this.htmlUnsafe(this.trashIcon)}</button></div>`)}</div></div><div id="options" class="${this.selectedFeatures.length > 0 ? '' : 'disabled'}"><fieldset class="field-wrapper" disabled="${this.selectedFeatures.length <= 0}"><input id="optionsTitle" value="${this.getOptionsTitle()}" class="gg-input" disabled="${this.selectedFeatures.length > 1}"><div id="optionsText"><div id="optionsTextLines"><span class="label first" i18n="Name">Name</span> <button class="gg-icon-button icon" id="visibleIconName" tip="Show or hide shape name" onclick="${() => this.toggleNameVisibility()}">${this.htmlUnsafe(this.isDisplayNameEnabled() ? this.visibleIcon : this.notVisibleIcon)}</button> <span class="label" i18n="Font">Font</span> <input id="optionsNameFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.nameFontSize}" oninput="${() => this.onOptionsChange()}"> <span class="unit">pt</span> <button class="icon colorPicker" id="nameColorPicker"></button> <span class="label first" i18n="Measures">Measures</span> <select id="measure-information" class="gg-select" tip="${this.measureInformationTooltip}" onchange="${() => this.onOptionsChange()}">${Object.entries(this.measureInformations).map((entry) => uHtml `<option selected="${this.selectedFeatureMeasureInformation === entry[0]}" value="${entry[0]}"><span i18n="${entry[1]}">${entry[0]}</span></option>`)}</select> <span class="label" i18n="Font">Font</span> <input id="optionsMeasuresFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.measureFontSize}" oninput="${() => this.onOptionsChange()}"> <span class="unit">pt</span> <button class="icon colorPicker" id="measureColorPicker"></button></div></div><hr><div id="optionsColor"><div id="optionsColorLine"><div><span class="text-end" i18n="Stroke color">Stroke color</span> <button class="icon colorPicker" id="strokePicker"></button></div><div><span class="${this.isFillColorEnabled() ? 'text-end' : 'text-end disabled'}" id="fillPickerSpan" i18n="Fill color">Fill color</span> <button class="icon colorPicker" disabled="${!this.isFillColorEnabled()}" id="fillPicker"></button></div></div></div><hr><div id="optionsLine"><div id="optionsLineLines"><span i18n="Line width">Line width</span> <input id="optionsStrokeWidth" type="number" class="gg-input" min="1" value="${this.selectedFeatures[0]?.strokeWidth}" oninput="${() => this.onOptionsChange()}"> <span class="unit">px</span> <select id="line-style" class="gg-select" onchange="${() => this.onOptionsChange()}">${Object.entries(this.lineStyles).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.lineStroke === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select></div></div><hr><div id="optionsArrow"><div class="${this.
|
|
40
|
+
<link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="panel"><div><div id="toolbar"><button id="disable" tip="Disable drawing" class="gg-icon-button gg-medium"><img alt="select icon" src="icons/arrow.svg"></button> <button id="point" tip="Point" class="gg-icon-button gg-medium"><img alt="point icon" src="icons/point.svg"></button> <button id="line" tip="Line" class="gg-icon-button gg-medium"><img alt="polyline icon" src="icons/polyline.svg"></button> <button id="polygon" tip="Polygon" class="gg-icon-button gg-medium"><img alt="polygon icon" src="icons/polygon.svg"></button> <button id="square" tip="Square" class="gg-icon-button gg-medium"><img alt="square icon" src="icons/square.svg"></button> <button id="rectangle" tip="Rectangle" class="gg-icon-button gg-medium"><img alt="rectangle icon" src="icons/rectangle.svg"></button> <button id="circle" tip="Circle" class="gg-icon-button gg-medium"><img alt="circle icon" src="icons/circle.svg"></button> <button id="freeline" tip="Freehand line" class="gg-icon-button gg-medium"><img alt="polyline-free icon" src="icons/polyline-free.svg"></button> <button id="freepolygon" tip="Freehand polygon" class="gg-icon-button gg-medium"><img alt="polygon-free icon" src="icons/polygon-free.svg"></button> <button id="text" tip="Text" class="gg-icon-button gg-medium"><img alt="text icon" src="icons/text-font.svg"></button></div><div id="toolParametersContainer"><span i18n="Settings" class="title"></span><div class="toolParameters" data-tool="Polyline,Polygon"><girafe-fixed-dimension dimensionname="length" dimension="length" id="fixedLineLength" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Square"><girafe-fixed-dimension dimensionname="side length" dimension="side" id="fixedSquareSide" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Rectangle"><girafe-fixed-dimension dimensionname="width" dimension="width" id="fixedRectangleWidth" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension><girafe-fixed-dimension dimensionname="height" dimension="height" id="fixedRectangleHeight" @fixed-dimension:value-changed="${(e) => this.fixedDimensionValueChangedHandler(e)}"></girafe-fixed-dimension></div><div class="toolParameters" data-tool="Text"><label class="gg-label" for="drawingText" i18n="Text to draw">Text to draw</label> <input id="drawingText" class="gg-input" value="${this.drawingText}" oninput="${(e) => this.drawingTextChangedHandler(e)}"></div></div></div><div id="drawingListContainer"><div class="titleContainer"><span i18n="Drawing List" class="title"></span> <button class="gg-icon-button icon" tip="Delete all shapes" onclick="${() => this.deleteAllFeatures()}" ?disabled="${this.drawingState.features.length === 0}">${this.htmlUnsafe(this.trashIcon)}</button></div><div id="drawingList">${this.drawingState.features.map(feature => uHtmlFor(feature, feature.id) `<div id="${'f-' + feature.id}" class="girafe"><button id="${'f-select-' + feature.id}" class="gg-icon-button gg-small" tip="Select to change appearance" onclick="${() => this.onToggleFeatureSelection(feature)}"><div class="icon">${this.htmlUnsafe(feature.selected ? this.checkedIcon : this.noCheckedIcon)}</div></button><div class="label-container"><button class="${feature.selected ? 'selectable-label gg-icon-button gg-small gg-selected' : 'selectable-label gg-icon-button gg-small gg-opacity'}" onclick="${() => this.onToggleFeatureSelection(feature)}"><span id="${'f-name-' + feature.id}">${feature.name}</span></button></div><button class="gg-icon-button icon" tip="Center on shape" onclick="${() => this.olDrawing.centerViewOnFeature(feature)}">${this.htmlUnsafe(this.locateIcon)}</button> <button class="gg-icon-button icon" tip="Delete shape" onclick="${() => this.deleteFeature(feature)}">${this.htmlUnsafe(this.trashIcon)}</button></div>`)}</div></div><div id="options" class="${this.selectedFeatures.length > 0 ? '' : 'disabled'}"><fieldset class="field-wrapper" disabled="${this.selectedFeatures.length <= 0}"><input id="optionsTitle" value="${this.getOptionsTitle()}" class="gg-input" disabled="${this.selectedFeatures.length > 1}"><div id="optionsText"><div id="optionsTextLines"><span class="label first" i18n="Name">Name</span> <button class="gg-icon-button icon" id="visibleIconName" tip="Show or hide shape name" onclick="${() => this.toggleNameVisibility()}">${this.htmlUnsafe(this.isDisplayNameEnabled() ? this.visibleIcon : this.notVisibleIcon)}</button> <span class="label" i18n="Font">Font</span> <input id="optionsNameFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.nameFontSize}" oninput="${() => this.onOptionsChange()}"> <span class="unit">pt</span> <button class="icon colorPicker" id="nameColorPicker"></button> <span class="${this.isMeasureInformationEnabled() ? 'label first' : 'label first disabled'}" i18n="Measures">Measures</span> <select id="measure-information" class="gg-select" tip="${this.measureInformationTooltip}" disabled="${!this.isMeasureInformationEnabled()}" onchange="${() => this.onOptionsChange()}">${Object.entries(this.measureInformations).map((entry) => uHtml `<option selected="${this.selectedFeatureMeasureInformation === entry[0]}" value="${entry[0]}"><span i18n="${entry[1]}">${entry[0]}</span></option>`)}</select> <span class="${this.isMeasureInformationEnabled() ? 'label' : 'label disabled'}" i18n="Font">Font</span> <input id="optionsMeasuresFontSize" class="gg-input" type="number" min="1" value="${this.selectedFeatures[0]?.measureFontSize}" disabled="${!this.isMeasureInformationEnabled()}" oninput="${() => this.onOptionsChange()}"> <span class="${this.isMeasureInformationEnabled() ? 'unit' : 'unit disabled'}">pt</span> <button class="icon colorPicker" id="measureColorPicker" disabled="${!this.isMeasureInformationEnabled()}"></button></div></div><hr><div id="optionsColor"><div id="optionsColorLine"><div><span class="${this.isStrokeColorEnabled() ? 'text-end' : 'text-end disabled'}" i18n="Stroke color">Stroke color</span> <button class="icon colorPicker" disabled="${!this.isStrokeColorEnabled()}" id="strokePicker"></button></div><div><span class="${this.isFillColorEnabled() ? 'text-end' : 'text-end disabled'}" id="fillPickerSpan" i18n="Fill color">Fill color</span> <button class="icon colorPicker" disabled="${!this.isFillColorEnabled()}" id="fillPicker"></button></div></div></div><hr><div id="optionsLine"><div class="${this.isLineStyleEnabled() ? '' : 'disabled'}" id="optionsLineLines"><span i18n="Line width">Line width</span> <input id="optionsStrokeWidth" type="number" class="gg-input" min="1" value="${this.selectedFeatures[0]?.strokeWidth}" oninput="${() => this.onOptionsChange()}"> <span class="unit">px</span> <select id="line-style" class="gg-select" onchange="${() => this.onOptionsChange()}">${Object.entries(this.lineStyles).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.lineStroke === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select></div></div><hr><div id="optionsArrow"><div class="${this.isLineArrowEnabled() ? '' : 'disabled'}" id="optionsArrowStyles"><span i18n="Arrows style">Arrows style</span> <select id="arrow-style" class="gg-select" onchange="${() => this.onArrowsChange()}">${Object.entries(this.arrowStyles).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.arrowStyle === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select> <select id="arrow-position" class="gg-select" onchange="${() => this.onArrowsChange()}">${Object.entries(this.arrowPositions).map((entry) => uHtml `<option selected="${this.selectedFeatures[0]?.arrowPosition === entry[0]}" value="${entry[0]}"><span>${entry[1]}</span></option>`)}</select></div></div><hr><div id="optionsExport"><div id="optionsExportLine"><label for="export" class="gg-label" i18n="Export">Export</label> <button class="gg-button" onclick="${() => this.exportSelectedFeatures('geojson')}">GeoJson</button> <button class="gg-button" onclick="${() => this.exportSelectedFeatures('kml')}">KML</button> <button class="gg-button" onclick="${() => this.exportSelectedFeatures('gpx')}">GPX</button></div></div></fieldset></div></div>
|
|
40
41
|
${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
41
42
|
};
|
|
42
43
|
isPanelVisible = false;
|
|
@@ -60,7 +61,8 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
60
61
|
{ id: 'polygon', tool: DrawingShape.Polygon },
|
|
61
62
|
{ id: 'circle', tool: DrawingShape.Disk },
|
|
62
63
|
{ id: 'freeline', tool: DrawingShape.FreehandPolyline },
|
|
63
|
-
{ id: 'freepolygon', tool: DrawingShape.FreehandPolygon }
|
|
64
|
+
{ id: 'freepolygon', tool: DrawingShape.FreehandPolygon },
|
|
65
|
+
{ id: 'text', tool: DrawingShape.Text }
|
|
64
66
|
];
|
|
65
67
|
toolSelected = null;
|
|
66
68
|
arrowStyles = {
|
|
@@ -112,6 +114,8 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
112
114
|
olDrawing;
|
|
113
115
|
cesiumDrawing;
|
|
114
116
|
fixedLengthEnabled = false;
|
|
117
|
+
// Text used by the "Text" drawing tool for the shapes it creates.
|
|
118
|
+
drawingText = '';
|
|
115
119
|
// Batch Create mode is currently not used. Batch mode allows the user to create multiple shapes without re-selecting
|
|
116
120
|
// the drawing tool. It possibly will be part of advanced drawing/editing tools.
|
|
117
121
|
batchCreateMode = false;
|
|
@@ -168,6 +172,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
168
172
|
this.olDrawing.registerInteractions();
|
|
169
173
|
if (this.state.globe.loaded)
|
|
170
174
|
this.cesiumDrawing.registerInteractions();
|
|
175
|
+
this.subscribe(/layers\.layersList\..*\.removalRequested/, (oldValue, value, parents) => this.onRemovalRequested(oldValue, value, parents));
|
|
171
176
|
}
|
|
172
177
|
unregisterEvents() {
|
|
173
178
|
this.olDrawing.unregisterInteractions();
|
|
@@ -228,6 +233,11 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
228
233
|
console.debug('Value changed for unknown Dimension with id', details.id);
|
|
229
234
|
}
|
|
230
235
|
}
|
|
236
|
+
drawingTextChangedHandler(e) {
|
|
237
|
+
this.drawingText = e.target.value;
|
|
238
|
+
this.olDrawing.setDrawingText(this.drawingText);
|
|
239
|
+
this.cesiumDrawing.setDrawingText(this.drawingText);
|
|
240
|
+
}
|
|
231
241
|
connectedCallback() {
|
|
232
242
|
super.connectedCallback();
|
|
233
243
|
if (!this.state.extendedState[DrawingStateLocation]) {
|
|
@@ -244,6 +254,12 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
244
254
|
this.cesiumDrawing = new CesiumDrawing(map, DrawingStateLocation, this.context);
|
|
245
255
|
this.render();
|
|
246
256
|
this.subscribe(`extendedState.${DrawingStateLocation}.features`, (olds, news) => this.onFeaturesChanged(olds, news));
|
|
257
|
+
// Keep the shape list and the options in sync when the selection is changed in the map
|
|
258
|
+
this.subscribe(new RegExp(String.raw `extendedState.${DrawingStateLocation}.features.*\.selected`, 'g'), () => {
|
|
259
|
+
if (this.isPanelVisible) {
|
|
260
|
+
this.refreshRender();
|
|
261
|
+
}
|
|
262
|
+
});
|
|
247
263
|
this.subscribe('projection', (olds, news) => this.onProjectionChanged(olds, news));
|
|
248
264
|
this.subscribe('globe.loaded', () => {
|
|
249
265
|
if (this.state.globe.loaded && this.isPanelVisible) {
|
|
@@ -258,6 +274,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
258
274
|
togglePanel(visible) {
|
|
259
275
|
if (this.isPanelVisible == visible)
|
|
260
276
|
return;
|
|
277
|
+
if (this.activeDrawingLayer?.removalRequested) {
|
|
278
|
+
this.deleteAllFeatures().then(noop);
|
|
279
|
+
}
|
|
261
280
|
this.isPanelVisible = visible;
|
|
262
281
|
if (this.isPanelVisible) {
|
|
263
282
|
this.registerEvents();
|
|
@@ -369,11 +388,27 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
369
388
|
isDisplayNameEnabled() {
|
|
370
389
|
return this.selectedFeatures.some((f) => f.displayName);
|
|
371
390
|
}
|
|
372
|
-
|
|
391
|
+
isLineArrowEnabled() {
|
|
373
392
|
return this.selectedFeatures.some((f) => f.type == DrawingShape.Polyline || f.type == DrawingShape.FreehandPolyline);
|
|
374
393
|
}
|
|
375
394
|
isFillColorEnabled() {
|
|
376
|
-
return
|
|
395
|
+
return this.selectedFeatures.every((f) => f.type == DrawingShape.Polygon ||
|
|
396
|
+
f.type == DrawingShape.FreehandPolygon ||
|
|
397
|
+
f.type == DrawingShape.Disk ||
|
|
398
|
+
f.type == DrawingShape.Rectangle ||
|
|
399
|
+
f.type == DrawingShape.Square);
|
|
400
|
+
}
|
|
401
|
+
isStrokeColorEnabled() {
|
|
402
|
+
return !this.selectedFeaturesHasTextFeature();
|
|
403
|
+
}
|
|
404
|
+
isLineStyleEnabled() {
|
|
405
|
+
return !this.selectedFeaturesHasTextFeature();
|
|
406
|
+
}
|
|
407
|
+
isMeasureInformationEnabled() {
|
|
408
|
+
return !this.selectedFeaturesHasTextFeature();
|
|
409
|
+
}
|
|
410
|
+
selectedFeaturesHasTextFeature() {
|
|
411
|
+
return this.selectedFeatures.some((f) => f.type == DrawingShape.Text);
|
|
377
412
|
}
|
|
378
413
|
async deleteFeature(feature) {
|
|
379
414
|
const confirm = await window.gConfirm('Do you want to remove "${feature.name}" ?', 'Delete Feature', (translatedMessage) => {
|
|
@@ -393,6 +428,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
393
428
|
this.drawingState.features = [];
|
|
394
429
|
this.refreshRender();
|
|
395
430
|
}
|
|
431
|
+
else {
|
|
432
|
+
this.activeDrawingLayer.removalRequested = false;
|
|
433
|
+
}
|
|
396
434
|
}
|
|
397
435
|
onOptionsChange() {
|
|
398
436
|
const nameFontSize = parseInt(this.getById('optionsNameFontSize').value);
|
|
@@ -449,7 +487,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
449
487
|
case 'kml':
|
|
450
488
|
return download(new KML().writeFeatures(olFeatures, { featureProjection: this.state.projection }), fileName + '.kml', 'application/vnd.google-earth.kml+xml');
|
|
451
489
|
case 'gpx':
|
|
452
|
-
if (this.selectedFeatures.some((f) => !f.
|
|
490
|
+
if (this.selectedFeatures.some((f) => !f.isPointPolylineOrText())) {
|
|
453
491
|
this.context.errorManager.pushMessage('export-gpx-error', 'The GPX format only supports points and polylines', 'warning');
|
|
454
492
|
}
|
|
455
493
|
else {
|
|
@@ -457,10 +495,18 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
457
495
|
}
|
|
458
496
|
}
|
|
459
497
|
}
|
|
498
|
+
onRemovalRequested(_oldValue, value, parents) {
|
|
499
|
+
if (value === true && parents.removalRequested) {
|
|
500
|
+
this.deleteAllFeatures().then(noop);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
460
503
|
}
|
|
461
504
|
__decorate([
|
|
462
505
|
UsedInTemplateOnly()
|
|
463
506
|
], DrawingComponent.prototype, "fixedDimensionValueChangedHandler", null);
|
|
507
|
+
__decorate([
|
|
508
|
+
UsedInTemplateOnly()
|
|
509
|
+
], DrawingComponent.prototype, "drawingTextChangedHandler", null);
|
|
464
510
|
__decorate([
|
|
465
511
|
UsedInTemplateOnly('Currently not used, will possibly be part of advanced editing/drawing tools')
|
|
466
512
|
], DrawingComponent.prototype, "onToggleBatchMode", null);
|
|
@@ -472,7 +518,16 @@ __decorate([
|
|
|
472
518
|
], DrawingComponent.prototype, "isDisplayNameEnabled", null);
|
|
473
519
|
__decorate([
|
|
474
520
|
UsedInTemplateOnly()
|
|
475
|
-
], DrawingComponent.prototype, "
|
|
521
|
+
], DrawingComponent.prototype, "isLineArrowEnabled", null);
|
|
476
522
|
__decorate([
|
|
477
523
|
UsedInTemplateOnly()
|
|
478
524
|
], DrawingComponent.prototype, "isFillColorEnabled", null);
|
|
525
|
+
__decorate([
|
|
526
|
+
UsedInTemplateOnly()
|
|
527
|
+
], DrawingComponent.prototype, "isStrokeColorEnabled", null);
|
|
528
|
+
__decorate([
|
|
529
|
+
UsedInTemplateOnly()
|
|
530
|
+
], DrawingComponent.prototype, "isLineStyleEnabled", null);
|
|
531
|
+
__decorate([
|
|
532
|
+
UsedInTemplateOnly()
|
|
533
|
+
], DrawingComponent.prototype, "isMeasureInformationEnabled", null);
|
package/components/main.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export { default as SelectionPanelMobile, getLinkFriendlyString } from './select
|
|
|
48
48
|
export { default as SelectionToolComponent } from './selectiontool/component.js';
|
|
49
49
|
export { default as SelectionWindowComponent } from './selectionwindow/component.js';
|
|
50
50
|
export { default as ShareComponent } from './share/component.js';
|
|
51
|
+
export { default as ShareMobileComponent } from './share-mobile/component.js';
|
|
51
52
|
export { default as SwipeUpPanelMobile } from './swipe-up-panel-mobile/component.js';
|
|
52
53
|
export { default as ThemeComponent } from './themes/component.js';
|
|
53
54
|
export { default as MobileGroupElementComponent } from './themes-mobile/group/component.js';
|
package/components/main.js
CHANGED
|
@@ -47,6 +47,7 @@ export { default as SelectionPanelMobile, getLinkFriendlyString } from './select
|
|
|
47
47
|
export { default as SelectionToolComponent } from './selectiontool/component.js';
|
|
48
48
|
export { default as SelectionWindowComponent } from './selectionwindow/component.js';
|
|
49
49
|
export { default as ShareComponent } from './share/component.js';
|
|
50
|
+
export { default as ShareMobileComponent } from './share-mobile/component.js';
|
|
50
51
|
export { default as SwipeUpPanelMobile } from './swipe-up-panel-mobile/component.js';
|
|
51
52
|
export { default as ThemeComponent } from './themes/component.js';
|
|
52
53
|
export { default as MobileGroupElementComponent } from './themes-mobile/group/component.js';
|
|
@@ -6,7 +6,7 @@ export default class MenuMobile3dButton extends GirafeHTMLElement {
|
|
|
6
6
|
styleUrls = null;
|
|
7
7
|
template = () => {
|
|
8
8
|
return uHtml `<style>
|
|
9
|
-
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}
|
|
9
|
+
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}.menu-item-title{text-align:center}
|
|
10
10
|
</style>
|
|
11
11
|
<style>${this.customStyle}</style>
|
|
12
12
|
<div onpointerup="${() => this.onPointerUp()}" class="menu-item"><div class="menu-item-image-container"><img alt="switch-icon" src="${this.icon}"></div><div class="menu-item-title-container"><div class="menu-item-title" i18n="${this.label}"></div></div></div>
|
|
@@ -6,7 +6,7 @@ export default class MenuMobileDrawingButton extends GirafeHTMLElement {
|
|
|
6
6
|
styleUrls = null;
|
|
7
7
|
template = () => {
|
|
8
8
|
return uHtml `<style>
|
|
9
|
-
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}
|
|
9
|
+
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}.menu-item-title{text-align:center}
|
|
10
10
|
</style>
|
|
11
11
|
<style>${this.customStyle}</style>
|
|
12
12
|
<div onpointerup="${() => this.onPointerUp()}" class="menu-item"><div class="menu-item-image-container"><img alt="switch-icon" src="${this.icon}"></div><div class="menu-item-title-container"><div class="menu-item-title" i18n="${this.label}"></div></div></div>
|
|
@@ -6,7 +6,7 @@ export default class MenuMobileOfflineButton extends GirafeHTMLElement {
|
|
|
6
6
|
styleUrls = null;
|
|
7
7
|
template = () => {
|
|
8
8
|
return uHtml `<style>
|
|
9
|
-
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}
|
|
9
|
+
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}.menu-item-title{text-align:center}
|
|
10
10
|
</style>
|
|
11
11
|
<style>${this.customStyle}</style>
|
|
12
12
|
<div onpointerup="${() => this.onPointerUp()}" class="menu-item"><div class="menu-item-image-container"><img alt="switch-icon" src="${this.icon}"></div><div class="menu-item-title-container"><div class="menu-item-title" i18n="${this.label}"></div></div></div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
|
|
2
|
+
export default class MenuMobileShareButton extends GirafeHTMLElement {
|
|
3
|
+
protected templateUrl: string | null;
|
|
4
|
+
protected styleUrls: string[] | null;
|
|
5
|
+
template: () => import("uhtml").Hole;
|
|
6
|
+
icon: string;
|
|
7
|
+
label: string;
|
|
8
|
+
constructor();
|
|
9
|
+
onPointerUp(): void;
|
|
10
|
+
protected connectedCallback(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html as uHtml } from 'uhtml';
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
|
|
4
|
+
export default class MenuMobileShareButton extends GirafeHTMLElement {
|
|
5
|
+
templateUrl = null;
|
|
6
|
+
styleUrls = null;
|
|
7
|
+
template = () => {
|
|
8
|
+
return uHtml `<style>
|
|
9
|
+
.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}.menu-item-title{text-align:center}
|
|
10
|
+
</style>
|
|
11
|
+
<style>${this.customStyle}</style>
|
|
12
|
+
<div onpointerup="${() => this.onPointerUp()}" class="menu-item"><div class="menu-item-image-container"><img alt="switch-icon" src="${this.icon}"></div><div class="menu-item-title-container"><div class="menu-item-title" i18n="${this.label}"></div></div></div>
|
|
13
|
+
${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
14
|
+
};
|
|
15
|
+
icon = 'icons/share.svg';
|
|
16
|
+
label = 'Share map';
|
|
17
|
+
constructor() {
|
|
18
|
+
super('mobile-share-button');
|
|
19
|
+
}
|
|
20
|
+
onPointerUp() {
|
|
21
|
+
// If not delaying, the releasing of the click is also fired
|
|
22
|
+
// on the offline panel shown
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
this.state.interface.sharePanelVisible = true;
|
|
25
|
+
this.state.interface.swipeupPanelContent = 'share';
|
|
26
|
+
}, 50);
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
this.render();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -10,7 +10,7 @@ export default class MenuMobile extends GirafeHTMLElement {
|
|
|
10
10
|
</style><style>
|
|
11
11
|
.hidden{display:none}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}button,input,select,textarea{font:inherit}.gg-icon-button,.gg-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-button{text-align:left}.gg-small{flex-direction:row}.gg-small img{width:calc(var(--app-standard-height) / 2.5);margin:0}.gg-small span{margin-left:.5rem;font-size:1rem}.girafe-button-big{filter:drop-shadow(0 0 8px #0000004d);background-color:var(--bkg-color);width:3.5rem;height:3.5rem;color:var(--text-color);border:none;border-radius:4rem;flex-direction:column;align-items:center;padding:.5rem;display:flex}.girafe-button-big img{width:95%;height:auto;padding:5%;overflow:hidden}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color)}
|
|
12
12
|
</style><style>
|
|
13
|
-
.menu-title{color:#3f68a7;text-transform:uppercase;text-align:center;margin:.5em 0;font-size:1.8em;font-weight:600}.menu-item-container{box-sizing:border-box;user-select:none;margin-bottom:max(env(safe-area-inset-bottom), 20px);grid-template-columns:repeat(2,1fr);gap:20px;padding:0 25px;display:grid}.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}
|
|
13
|
+
.menu-title{color:#3f68a7;text-transform:uppercase;text-align:center;margin:.5em 0;font-size:1.8em;font-weight:600}.menu-item-container{box-sizing:border-box;user-select:none;margin-bottom:max(env(safe-area-inset-bottom), 20px);grid-template-columns:repeat(2,1fr);gap:20px;padding:0 25px;display:grid}.menu-item{filter:drop-shadow(0 4px 7px #0004382c);background-color:#fff;border-radius:8px;flex-direction:column;padding:1em;display:flex}.menu-item:active{background-color:#c6ceda}.menu-item-image-container{flex:1;justify-content:center;align-items:center;padding-bottom:1em;display:flex}.menu-item-image-container>img{opacity:.7;width:25%}.menu-item-title-container{color:#3f68a7;flex:1;justify-content:center;align-items:center;font-size:1.2em;font-weight:600;display:flex}.menu-item-title{text-align:center}
|
|
14
14
|
</style>
|
|
15
15
|
<style>${this.customStyle}</style>
|
|
16
16
|
<div style="${this.state.interface.swipeupPanelContent === 'menu' ? '' : 'display: none;'}"><div class="menu-title" i18n="Tools"></div><div class="menu-item-container"><slot name="mobile-menu-content"></slot></div></div>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { html as uHtml } from 'uhtml';
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import TwitterLogo from '
|
|
4
|
-
import FacebookLogo from '
|
|
5
|
-
import LinkedInLogo from '
|
|
6
|
-
import MailLogo from '
|
|
3
|
+
import TwitterLogo from '../../assets/icons/twitter.svg';
|
|
4
|
+
import FacebookLogo from '../../assets/icons/facebook.svg';
|
|
5
|
+
import LinkedInLogo from '../../assets/icons/linkedin.svg';
|
|
6
|
+
import MailLogo from '../../assets/icons/share-mail.svg';
|
|
7
7
|
import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
|
|
8
8
|
import SimpleMaskManager from '../../tools/layers/simplemaskmanager.js';
|
|
9
9
|
class ShareComponent extends GirafeHTMLElement {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
|
|
2
|
+
import { IUrlShortener } from '../../tools/share/iurlshortener.js';
|
|
3
|
+
declare class ShareMobileComponent extends GirafeHTMLElement {
|
|
4
|
+
protected templateUrl: string | null;
|
|
5
|
+
protected styleUrls: string[] | null;
|
|
6
|
+
template: () => import("uhtml").Hole;
|
|
7
|
+
shareLink?: string;
|
|
8
|
+
qrCode?: string;
|
|
9
|
+
success: boolean;
|
|
10
|
+
twitterLogo: string;
|
|
11
|
+
facebookLogo: string;
|
|
12
|
+
linkedInLogo: string;
|
|
13
|
+
mailLogo: string;
|
|
14
|
+
shareNativeLogo: string;
|
|
15
|
+
awaitingShareLink: boolean;
|
|
16
|
+
get urlShortener(): IUrlShortener | undefined;
|
|
17
|
+
constructor();
|
|
18
|
+
render(): void;
|
|
19
|
+
protected connectedCallback(): void;
|
|
20
|
+
registerEvents(): void;
|
|
21
|
+
private generateShareLink;
|
|
22
|
+
shareFacebook(): void;
|
|
23
|
+
shareTwitter(): void;
|
|
24
|
+
shareLinkedIn(): void;
|
|
25
|
+
shareMail(): void;
|
|
26
|
+
shareNative(): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
export default ShareMobileComponent;
|