Skip to content

Commit 69bdfed

Browse files
committed
wip: Provide ready-made configuration snippets to help set up the app's configuration file #1140
1 parent 11f45a5 commit 69bdfed

File tree

6 files changed

+76
-35
lines changed

6 files changed

+76
-35
lines changed

extras/configs/helpers.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ module.exports = {
1313
style: 'min-height: 1px;',
1414
color
1515
}
16+
},
17+
visible: (element, rule) => {
18+
return Object.assign(element, { visible: rule })
1619
}
1720
}

extras/configs/panes.top.js

+57-23
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,96 @@
11
module.exports = {
2-
toggleFullscreen: (renderer = 'item') => {
2+
locateUser: (renderer = 'button') => {
33
return {
4-
id: 'toggle-fullscreen',
5-
component: 'action/KToggleFullscreenAction',
6-
icon: 'las la-expand',
7-
label: renderer === 'item' ? 'layout.ENTER_FULLSCREEN' : null,
8-
tooltip: renderer === 'button' ? 'layout.ENTER_FULLSCREEN' : null,
9-
toggle: {
10-
icon: 'las la-compress',
11-
label: renderer === 'item' ? 'layout.EXIT_FULLSCREEN' : null,
12-
tooltip: renderer === 'button' ? 'layout.EXIT_FULLSCREEN' : null
13-
},
14-
renderer
4+
id: 'locate-user',
5+
label: renderer === 'item' ? 'layout.LOCATE_SUER' : null,
6+
tooltip: renderer === 'button' ? 'layout.LOCATE_SUER' : null,
7+
component: 'tools/KGeolocateTool'
8+
}
9+
},
10+
searchLocation: (renderer = 'button', mode = 'search-location') => {
11+
return {
12+
id: 'search-location',
13+
icon: 'las la-search-location',
14+
label: renderer === 'item' ? 'layout.SEARCH_LOCATION' : null,
15+
tooltip: renderer === 'button' ? 'layout.SEARCH_LOCATION' : null,
16+
handler: { name: 'setTopPaneMode', params: ['search-location'] }
1517
}
1618
},
17-
toggleLegendVisibility: (renderer = 'item') => {
19+
measureTool: (renderer = 'item', mode = 'measure-tool') => {
20+
return {
21+
id: 'measure-tool',
22+
icon: 'las la-ruler-combined',
23+
label: renderer === 'item' ? 'layout.MEASURE_TOOL' : null,
24+
tooltip: renderer === 'button' ? 'layout.MEASURE_TOOL' : null,
25+
handler: { name: 'setTopPaneMode', params: ['measure-tool'] }
26+
}
27+
},
28+
toggleLegend: (renderer = 'item') => {
1829
return {
1930
id: 'toggle-legend',
20-
component: 'action/KToggleWidgetVisibility',
21-
widgetId: 'legend-widget',
2231
icon: 'las la-list',
2332
label: renderer === 'item' ? 'layout.SHOW_LEGEND' : null,
2433
tooltip: renderer === 'button' ? 'layout.SHOW_LEGEND': null,
2534
toggle: {
2635
label: renderer === 'item' ? 'layout.HIDE_LEGEND' : null,
2736
tooltip: renderer === 'button' ? 'layout.HIDE_LEGEND': null,
2837
},
29-
renderer
38+
renderer,
39+
component: 'action/KToggleWidgetVisibility',
40+
widgetId: 'legend-widget'
3041
}
3142
},
32-
togglePositionVisibility: (renderer = 'item') => {
43+
togglePosition: (renderer = 'item') => {
3344
return {
3445
id: 'toggle-position-sticky',
35-
component: 'action/KToggleStickyVisibility',
36-
stickyId: 'position-sticky',
3746
icon: 'las la-plus',
3847
label: renderer === 'item' ? 'layout.SHOW_POSITION' : null,
3948
tooltip: renderer === 'button' ? 'layout.SHOW_POSITION': null,
4049
toggle: {
4150
label: renderer === 'item' ? 'layout.HIDE_POSITION' : null,
4251
tooltip: renderer === 'button' ? 'layout.HIDE_POSITION': null,
4352
},
44-
renderer
53+
renderer,
54+
component: 'action/KToggleStickyVisibility',
55+
stickyId: 'position-sticky'
4556
}
4657
},
47-
toggleNorthArrowVisibility: (renderer = 'item') => {
58+
toggleNorthArrow: (renderer = 'item') => {
4859
return {
4960
id: 'toggle-north-arrow-sticky',
50-
component: 'action/KToggleStickyVisibility',
51-
stickyId: 'north-arrow-sticky',
5261
icon: 'las la-location-arrow',
5362
label: renderer === 'item' ? 'layout.SHOW_NORTH_ARROW' : null,
5463
tooltip: renderer === 'button' ? 'layout.SHOW_NORTH_ARROW': null,
5564
toggle: {
5665
label: renderer === 'item' ? 'layout.HIDE_NORTH_ARROW' : null,
5766
tooltip: renderer === 'button' ? 'layout.HIDE_NORTH_ARROW': null,
5867
},
68+
renderer,
69+
component: 'action/KToggleStickyVisibility',
70+
stickyId: 'north-arrow-sticky'
71+
}
72+
},
73+
toggleFullscreen: (renderer = 'item') => {
74+
return {
75+
id: 'toggle-fullscreen',
76+
component: 'action/KToggleFullscreenAction',
77+
icon: 'las la-expand',
78+
label: renderer === 'item' ? 'layout.ENTER_FULLSCREEN' : null,
79+
tooltip: renderer === 'button' ? 'layout.ENTER_FULLSCREEN' : null,
80+
toggle: {
81+
icon: 'las la-compress',
82+
label: renderer === 'item' ? 'layout.EXIT_FULLSCREEN' : null,
83+
tooltip: renderer === 'button' ? 'layout.EXIT_FULLSCREEN' : null
84+
},
5985
renderer
6086
}
87+
},
88+
restoreMode: (mode, tooltip, icon = 'las la-times') => {
89+
return {
90+
id: `restore-${mode}`,
91+
icon,
92+
tooltip,
93+
handler: { name: 'setTopPaneMode', params: [mode] }
94+
}
6195
}
6296
}

map/client/components/KMeasureTool.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<template>
22
<div class="row items-center no-padding">
33
<span class="q-pl-md q-pr-md" @click="changeUnit">
4-
<span v-html="measureValue"/>
4+
<span v-html="measureValue" />
55
<q-tooltip>
66
{{ $t('KMeasureTool.CLICK_TO_CHANGE_UNIT') }}
77
</q-tooltip>
88
</span>
9-
<k-panel id="toolbar-buttons" :content="buttons" action-renderer="button"/>
9+
<KPanel
10+
id="toolbar-buttons"
11+
:content="buttons"
12+
action-renderer="button"
13+
/>
1014
</div>
1115
</template>
1216

map/client/components/tools/KGeolocateTool.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
v-if="CurrentActivity"
44
id="locate-user"
55
icon="las la-crosshairs"
6-
tooltip="mixins.activity.SHOW_USER_LOCATION"
7-
:toggle="{ tooltip: 'mixins.activity.HIDE_USER_LOCATION' }"
6+
tooltip="layout.SHOW_USER_LOCATION"
7+
:toggle="{ tooltip: 'layout.HIDE_USER_LOCATION' }"
88
:toggled="isToggled"
99
:disabled="!isEnabled "
1010
@toggled="onToggled"

map/client/i18n/map_en.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"PROJECT_LAYERS_LABEL": "Data",
99
"PROJECT_VIEWS_LABEL": "Views",
1010
"layout": {
11+
"SHOW_USER_LOCATION": "Display my location",
12+
"HIDE_USER_LOCATION": "Hide my location",
13+
"SEARCH_LOCATION": "Search a location",
14+
"MEASURE_TOOL": "Measure tool",
1115
"SHOW_LEGEND": "Show legend",
1216
"HIDE_LEGEND": "Hide legend",
1317
"SHOW_POSITION": "Show geographical coordinates",
@@ -75,9 +79,6 @@
7579
"ZOOM_TO_LABEL": "Zoom to",
7680
"ZOOM_IN": "Zoom in",
7781
"ZOOM_OUT": "Zoom out",
78-
"SHOW_USER_LOCATION": "Display my location",
79-
"HIDE_USER_LOCATION": "Hide my location",
80-
"TOGGLE_SIDENAV": "Menu",
8182
"ENTER_FULLSCREEN": "Toggle fullscreen mode",
8283
"EXIT_FULLSCREEN": "Exit fullscreen mode",
8384
"TOGGLE_CATALOG": "Catalog",
@@ -713,7 +714,6 @@
713714
"ERROR_MESSAGE": "One capture is already in progress"
714715
},
715716
"KMeasureTool": {
716-
"TOOL_BUTTON_LABEL": "Display the measure tool",
717717
"CLEAR": "Clear all measurements",
718718
"MEASURE_DISTANCE": "Measure a distance",
719719
"MEASURE_AREA": "Measure an area",

map/client/i18n/map_fr.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"PROJECT_LAYERS_LABEL": "Données",
99
"PROJECT_VIEWS_LABEL": "Vues",
1010
"layout": {
11+
"SHOW_USER_LOCATION": "Afficher ma localisation",
12+
"HIDE_USER_LOCATION": "Masquer ma localisation",
13+
"SEARCH_LOCATION": "Recherche un lieu",
14+
"MEASURE_TOOL": "Outil de mesure",
1115
"SHOW_LEGEND": "Afficher la légende",
1216
"HIDE_LEGEND": "Masquer la légende",
1317
"SHOW_POSITION": "Afficher les coordonnées géographiques",
@@ -77,9 +81,6 @@
7781
"ZOOM_OUT": "Dézoomer",
7882
"SHOW_USER_LOCATION": "Afficher ma localisation",
7983
"HIDE_USER_LOCATION": "Masquer ma localisation",
80-
"TOGGLE_SIDENAV": "Menu",
81-
"ENTER_FULLSCREEN": "Basculer en mode plein écran",
82-
"EXIT_FULLSCREEN": "Quitter le mode plein écran",
8384
"TOGGLE_CATALOG": "Catalogue",
8485
"TOGGLE_MAP": "Visualiser en 2D",
8586
"TOGGLE_GLOBE": "Visualiser en 3D",
@@ -717,7 +718,6 @@
717718
"ERROR_MESSAGE": "Une capture est déjà en cours"
718719
},
719720
"KMeasureTool": {
720-
"TOOL_BUTTON_LABEL": "Afficher l'outil de mesures",
721721
"CLEAR": "Effacer les mesures",
722722
"MEASURE_DISTANCE": "Mesurer une distance",
723723
"MEASURE_AREA": "Mesurer une aire",

0 commit comments

Comments
 (0)