@kalisio/kdk 2.1.9 → 2.2.0
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/.travis.test.sh +42 -10
- package/README.md +2 -2
- package/core/api/application.js +6 -1
- package/core/api/authentication.js +17 -1
- package/core/api/db.js +7 -2
- package/core/api/hooks/hooks.authentication.js +4 -2
- package/core/api/hooks/hooks.authorisations.js +12 -2
- package/core/api/hooks/hooks.model.js +5 -5
- package/core/api/hooks/hooks.organisations.js +0 -4
- package/core/api/services/account/account.hooks.js +10 -6
- package/core/api/services/account/account.service.js +1 -1
- package/{map/api/services/geocoder/geocoder.hooks.js → core/api/services/import-export/import-export.hooks.js} +7 -5
- package/core/api/services/import-export/import-export.service.js +11 -0
- package/core/api/services/index.js +13 -1
- package/core/api/services/users/users.hooks.js +2 -3
- package/core/client/api.js +16 -14
- package/core/client/capabilities.js +6 -2
- package/core/client/components/KContent.vue +11 -1
- package/core/client/components/KDialog.vue +17 -15
- package/core/client/components/KSponsor.vue +1 -1
- package/core/client/components/KTextArea.vue +5 -1
- package/core/client/components/app/KAbout.vue +1 -2
- package/core/client/components/app/KWelcome.vue +3 -5
- package/core/client/components/chart/KTimeSeriesChart.vue +24 -37
- package/core/client/components/collection/KColumn.vue +20 -17
- package/core/client/components/editor/KModalEditor.vue +0 -2
- package/core/client/components/form/KChipsField.vue +12 -2
- package/core/client/components/form/KColorField.vue +12 -2
- package/core/client/components/form/KColorScaleField.vue +12 -2
- package/core/client/components/form/KDateTimeRangeField.vue +12 -2
- package/core/client/components/form/KDatetimeField.vue +12 -2
- package/core/client/components/form/KEmailField.vue +12 -2
- package/core/client/components/form/KFileField.vue +12 -2
- package/core/client/components/form/KForm.vue +43 -9
- package/core/client/components/form/KIconField.vue +12 -2
- package/core/client/components/form/KItemField.vue +25 -4
- package/core/client/components/form/KNumberField.vue +12 -2
- package/core/client/components/form/KOptionsField.vue +12 -2
- package/core/client/components/form/KPasswordField.vue +12 -2
- package/core/client/components/form/KPhoneField.vue +13 -3
- package/core/client/components/form/KPropertyItemField.vue +12 -2
- package/core/client/components/form/KResolutionField.vue +126 -0
- package/core/client/components/form/KRoleField.vue +12 -2
- package/core/client/components/form/KSelectField.vue +14 -4
- package/core/client/components/form/KTextField.vue +12 -2
- package/core/client/components/form/KTextareaField.vue +13 -3
- package/core/client/components/form/KToggleField.vue +12 -2
- package/core/client/components/form/KTokenField.vue +12 -2
- package/core/client/components/form/KUnitField.vue +12 -2
- package/core/client/components/form/KUrlField.vue +12 -2
- package/core/client/components/input/KIconChooser.vue +10 -12
- package/core/client/components/input/KPalette.vue +2 -1
- package/core/client/components/layout/KPage.vue +5 -4
- package/core/client/components/layout/KWindow.vue +10 -10
- package/core/client/components/media/KColorScale.vue +26 -20
- package/core/client/components/media/KImageViewer.vue +57 -33
- package/core/client/components/media/KShape.vue +14 -103
- package/core/client/components/screen/KRegisterScreen.vue +0 -1
- package/core/client/components/screen/KScreenFooter.vue +0 -18
- package/core/client/components/team/KAddMember.vue +16 -22
- package/core/client/components/team/KGroupsActivity.vue +14 -0
- package/core/client/components/team/KMembersActivity.vue +12 -0
- package/core/client/components/team/KTagsActivity.vue +14 -0
- package/core/client/components/time/KDateTime.vue +23 -7
- package/core/client/components/time/KTimeControl.vue +142 -0
- package/core/client/components/tool/KExportTool.vue +57 -0
- package/core/client/composables/collection.js +0 -1
- package/core/client/composables/pwa.js +0 -1
- package/core/client/composables/schema.js +1 -1
- package/core/client/composables/session.js +30 -6
- package/core/client/exporter.js +141 -0
- package/core/client/i18n/core_en.json +91 -23
- package/core/client/i18n/core_fr.json +92 -23
- package/core/client/index.js +3 -0
- package/core/client/layout.js +34 -14
- package/core/client/local-storage.js +8 -6
- package/core/client/mixins/index.js +0 -1
- package/core/client/mixins/mixin.base-field.js +24 -2
- package/core/client/mixins/mixin.object-proxy.js +0 -1
- package/core/client/search.js +2 -1
- package/core/client/services/index.js +2 -1
- package/core/client/services/local-settings.service.js +4 -4
- package/core/client/theme.js +3 -3
- package/core/client/time.js +4 -0
- package/core/client/units.js +149 -4
- package/core/client/utils/index.js +13 -6
- package/core/client/utils/utils.account.js +1 -1
- package/core/client/utils/utils.colors.js +43 -0
- package/core/client/utils/utils.platform.js +0 -1
- package/core/client/utils/utils.pwa.js +14 -14
- package/core/client/utils/utils.session.js +1 -1
- package/core/client/utils/utils.shapes.js +270 -0
- package/core/client/utils/utils.time.js +37 -0
- package/core/common/permissions.js +3 -0
- package/core/common/schemas/settings.update.json +50 -29
- package/extras/css/core.variables.scss +3 -1
- package/extras/tours/map/navigation-bar.js +17 -15
- package/extras/tours/map/timeline.js +33 -33
- package/map/api/config/categories.cjs +4 -1
- package/map/api/hooks/hooks.catalog.js +39 -0
- package/map/api/hooks/hooks.features.js +23 -3
- package/map/api/hooks/hooks.query.js +31 -10
- package/map/api/models/projects.model.mongodb.js +8 -0
- package/map/api/services/catalog/catalog.hooks.js +5 -3
- package/map/api/services/features/features.hooks.js +18 -6
- package/map/api/services/index.js +22 -6
- package/map/api/services/projects/projects.hooks.js +118 -0
- package/map/client/capture.js +16 -0
- package/map/client/cesium/utils/index.js +3 -0
- package/map/client/cesium/utils/utils.events.js +30 -0
- package/map/client/cesium/utils/utils.popup.js +17 -0
- package/map/client/cesium/{utils.js → utils/utils.style.js} +53 -49
- package/map/client/components/KCapture.vue +50 -0
- package/map/client/components/KCaptureTextArea.vue +53 -0
- package/map/client/components/KCompass.vue +2 -2
- package/map/client/components/KFeaturesChart.vue +1 -1
- package/map/client/components/KFeaturesFilter.vue +2 -2
- package/map/client/components/KLayerStyleForm.vue +256 -430
- package/map/client/components/KLevelSlider.vue +1 -1
- package/map/client/components/KNorth.vue +31 -0
- package/map/client/components/KProjectMenu.vue +88 -0
- package/map/client/components/KTimezoneMap.vue +36 -23
- package/map/client/components/catalog/KAddLayer.vue +3 -4
- package/map/client/components/catalog/KConnectLayer.vue +16 -4
- package/map/client/components/catalog/KCreateLayer.vue +1 -2
- package/map/client/components/catalog/KCreateProject.vue +100 -0
- package/map/client/components/catalog/KCreateView.vue +25 -2
- package/map/client/components/catalog/KLayersPanel.vue +24 -27
- package/map/client/components/catalog/KLayersSelector.vue +1 -1
- package/map/client/components/catalog/KProjectEditor.vue +91 -0
- package/map/client/components/catalog/KProjectManager.vue +60 -0
- package/map/client/components/catalog/KProjectSelector.vue +38 -0
- package/map/client/components/catalog/KProjectsPanel.vue +153 -0
- package/map/client/components/catalog/KSelectLayers.vue +96 -0
- package/map/client/components/catalog/KSelectViews.vue +96 -0
- package/map/client/components/catalog/KViewsPanel.vue +66 -30
- package/map/client/components/form/KDirectionField.vue +24 -5
- package/map/client/components/form/KLayerCategoryField.vue +12 -2
- package/map/client/components/form/KLocationField.vue +20 -5
- package/map/client/components/form/KOwsLayerField.vue +12 -2
- package/map/client/components/form/KOwsServiceField.vue +12 -2
- package/map/client/components/form/KSelectLayersField.vue +159 -0
- package/map/client/components/form/KSelectViewsField.vue +121 -0
- package/map/client/components/form/KTimezoneField.vue +24 -17
- package/map/client/components/legend/KColorScaleLegend.vue +1 -1
- package/map/client/components/legend/KLayerLegend.vue +61 -0
- package/map/client/components/legend/KLegend.vue +45 -44
- package/map/client/components/legend/KLegendRenderer.vue +5 -3
- package/map/client/components/legend/KSymbolsLegend.vue +12 -10
- package/map/client/components/legend/KVariablesLegend.vue +78 -0
- package/map/client/components/location/KGeocodersFilter.vue +2 -4
- package/map/client/components/location/KLocationMap.vue +48 -17
- package/map/client/components/location/KLocationSearch.vue +13 -3
- package/map/client/components/tools/KSearchTool.vue +17 -12
- package/map/client/components/widget/KElevationProfile.vue +16 -19
- package/map/client/components/widget/KMapillaryViewer.vue +21 -22
- package/map/client/components/widget/KTimeSeries.vue +35 -23
- package/map/client/composables/activity.js +15 -2
- package/map/client/composables/catalog.js +66 -0
- package/map/client/composables/highlight.js +56 -20
- package/map/client/composables/index.js +2 -0
- package/map/client/composables/location.js +25 -18
- package/map/client/composables/project.js +122 -0
- package/map/client/geolocation.js +1 -1
- package/map/client/globe.js +2 -0
- package/map/client/i18n/map_en.json +123 -76
- package/map/client/i18n/map_fr.json +124 -72
- package/map/client/index.js +3 -0
- package/map/client/init.js +17 -0
- package/map/client/leaflet/GSMaPLayer.js +16 -17
- package/map/client/leaflet/ShapeMarker.js +40 -0
- package/map/client/leaflet/TiledFeatureLayer.js +1 -1
- package/map/client/leaflet/TiledMeshLayer.js +11 -15
- package/map/client/leaflet/TiledWindLayer.js +6 -10
- package/map/client/leaflet/utils/index.js +4 -0
- package/map/client/leaflet/utils/utils.events.js +41 -0
- package/map/client/leaflet/utils/utils.popup.js +21 -0
- package/map/client/leaflet/utils/utils.style.js +191 -0
- package/map/client/leaflet/utils/utils.tiles.js +87 -0
- package/map/client/map.js +2 -0
- package/map/client/mixins/globe/mixin.base-globe.js +29 -21
- package/map/client/mixins/globe/mixin.geojson-layers.js +132 -69
- package/map/client/mixins/globe/mixin.popup.js +2 -1
- package/map/client/mixins/globe/mixin.style.js +6 -4
- package/map/client/mixins/globe/mixin.tooltip.js +8 -3
- package/map/client/mixins/map/mixin.base-map.js +13 -11
- package/map/client/mixins/map/mixin.edit-layers.js +15 -15
- package/map/client/mixins/map/mixin.forecast-layers.js +3 -1
- package/map/client/mixins/map/mixin.geojson-layers.js +56 -20
- package/map/client/mixins/map/mixin.georaster-layers.js +4 -11
- package/map/client/mixins/map/mixin.heatmap-layers.js +1 -1
- package/map/client/mixins/map/mixin.popup.js +2 -1
- package/map/client/mixins/map/mixin.style.js +4 -67
- package/map/client/mixins/map/mixin.tiled-mesh-layers.js +2 -1
- package/map/client/mixins/map/mixin.tiled-wind-layers.js +4 -2
- package/map/client/mixins/map/mixin.tooltip.js +2 -1
- package/map/client/mixins/mixin.activity.js +66 -191
- package/map/client/mixins/mixin.catalog-panel.js +6 -6
- package/map/client/mixins/mixin.context.js +12 -9
- package/map/client/mixins/mixin.feature-service.js +29 -300
- package/map/client/mixins/mixin.weacast.js +11 -17
- package/map/client/pixi-utils.js +1 -1
- package/map/client/planets.js +58 -0
- package/map/client/utils/index.js +6 -0
- package/map/client/utils/utils.capture.js +176 -0
- package/map/client/utils/utils.catalog.js +149 -0
- package/map/client/utils/utils.features.js +364 -0
- package/map/client/utils/utils.js +0 -151
- package/map/client/utils/utils.layers.js +174 -0
- package/map/client/utils/utils.location.js +91 -23
- package/map/client/utils/utils.project.js +8 -0
- package/map/client/utils/utils.schema.js +0 -1
- package/map/client/utils/utils.style.js +297 -0
- package/map/client/utils.all.js +2 -2
- package/map/client/utils.globe.js +1 -1
- package/map/client/utils.map.js +1 -1
- package/map/common/permissions.js +2 -0
- package/map/common/schemas/capture.create.json +132 -0
- package/map/common/schemas/projects.create.json +52 -0
- package/map/common/schemas/projects.update.json +52 -0
- package/package.json +6 -5
- package/test/api/core/account.test.js +20 -0
- package/test/api/core/config/default.cjs +16 -3
- package/test/api/core/import-export.test.js +86 -0
- package/test/api/core/test-log-2024-01-04.log +14 -0
- package/test/api/map/catalog.test.js +164 -0
- package/test/api/map/index.test.js +25 -61
- package/test/api/map/test-log-2024-01-04.log +2 -0
- package/test/api/map/test-log-2024-01-11.log +1 -0
- package/test/api/map/test-log-2024-01-25.log +19 -0
- package/test/client/core/layout.js +25 -5
- package/test/client/core/utils.js +7 -0
- package/test/client/map/catalog.js +78 -1
- package/test/client/map/time.js +2 -1
- package/core/client/components/screen/KEndpointScreen.vue +0 -80
- package/core/client/mixins/mixin.account.js +0 -61
- package/extras/icons/kdk.png +0 -0
- package/map/api/services/geocoder/geocoder.service.js +0 -79
- package/map/client/components/KCaptureToolbar.vue +0 -155
- package/map/client/components/KColorLegend.vue +0 -349
- package/map/client/components/KTimeline.vue +0 -293
- package/map/client/components/KUrlLegend.vue +0 -122
- package/map/client/leaflet/utils.js +0 -246
|
@@ -3,57 +3,46 @@
|
|
|
3
3
|
<k-icon-chooser ref="iconChooser" @icon-choosed="onIconChanged" />
|
|
4
4
|
<k-color-chooser ref="colorChooser" @color-choosed="onColorChanged" />
|
|
5
5
|
<q-expansion-item id="style-general-group" default-opened icon="las la-low-vision" :label="$t('KLayerStyleForm.BASE')" group="group">
|
|
6
|
-
<q-list dense class="
|
|
7
|
-
<q-item class="
|
|
8
|
-
<q-item-section class="col-1">
|
|
9
|
-
|
|
10
|
-
</q-item-section>
|
|
11
|
-
<q-item-section class="col-11 text-left">
|
|
12
|
-
{{$t('KLayerStyleForm.DEFAULT_VISIBILITY')}}
|
|
13
|
-
</q-item-section>
|
|
6
|
+
<q-list dense class="q-pa-md">
|
|
7
|
+
<q-item class="row justify-start">
|
|
8
|
+
<q-item-section class="col-1"><q-toggle v-model="isVisible"/></q-item-section>
|
|
9
|
+
<q-item-section>{{$t('KLayerStyleForm.DEFAULT_VISIBILITY')}}</q-item-section>
|
|
14
10
|
</q-item>
|
|
15
|
-
<q-item class="
|
|
16
|
-
<q-item-section class="col-1">
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<q-item-section class="col-6 text-left">
|
|
20
|
-
{{$t('KLayerStyleForm.MIN_ZOOM')}}
|
|
21
|
-
</q-item-section>
|
|
22
|
-
<q-item-section class="col-4 text-left">
|
|
11
|
+
<q-item class="row justify-start">
|
|
12
|
+
<q-item-section class="col-1"><q-toggle id="style-toggle-minzoom" v-model="hasMinZoom"/></q-item-section>
|
|
13
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.MIN_ZOOM')}} </q-item-section>
|
|
14
|
+
<q-item-section class="col-2">
|
|
23
15
|
<q-slider id="style-set-minzoom" v-model="minZoom" :disable="!hasMinZoom"
|
|
24
16
|
:min="minViewerZoom" :max="hasMaxZoom ? maxZoom : maxViewerZoom" :step="1"
|
|
25
17
|
label label-always :label-value="minZoom"/>
|
|
26
18
|
</q-item-section>
|
|
27
19
|
</q-item>
|
|
28
|
-
<q-item class="
|
|
29
|
-
<q-item-section class="col-1">
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<q-item-section class="col-6 text-left">
|
|
33
|
-
{{$t('KLayerStyleForm.MAX_ZOOM')}}
|
|
34
|
-
</q-item-section>
|
|
35
|
-
<q-item-section class="col-4">
|
|
20
|
+
<q-item class="row justify-start">
|
|
21
|
+
<q-item-section class="col-1"><q-toggle id="style-toggle-maxzoom" v-model="hasMaxZoom"/></q-item-section>
|
|
22
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.MAX_ZOOM')}} </q-item-section>
|
|
23
|
+
<q-item-section class="col-2">
|
|
36
24
|
<q-slider id="style-set-maxzoom" v-model="maxZoom" :disable="!hasMaxZoom"
|
|
37
25
|
:min="hasMinZoom ? minZoom : minViewerZoom" :max="maxViewerZoom" :step="1"
|
|
38
26
|
label label-always :label-value="maxZoom"/>
|
|
39
27
|
</q-item-section>
|
|
40
28
|
</q-item>
|
|
41
|
-
<q-item class="
|
|
42
|
-
<q-item-section class="col-1">
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
<q-item class="row justify-start">
|
|
30
|
+
<q-item-section class="col-1"><q-toggle id="style-toggle-clustering" v-model="clustering"/></q-item-section>
|
|
31
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.POINT_CLUSTERING')}} </q-item-section>
|
|
32
|
+
<q-item-section class="col-2">
|
|
33
|
+
<q-slider id="style-set-clustering" v-model="disableClusteringAtZoom" :disable="!clustering"
|
|
34
|
+
:min="minViewerZoom" :max="maxViewerZoom" :step="1"
|
|
35
|
+
label label-always :label-value="disableClusteringAtZoom"/>
|
|
47
36
|
</q-item-section>
|
|
48
37
|
</q-item>
|
|
49
|
-
<q-item
|
|
50
|
-
<q-item-section class="col-1">
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<q-item-section class="col-
|
|
38
|
+
<q-item class="row justify-start" v-if="isVectorLayer">
|
|
39
|
+
<q-item-section class="col-1"><q-toggle id="style-is-selectable" v-model="isSelectable"/></q-item-section>
|
|
40
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.SELECTABLE')}}</q-item-section>
|
|
41
|
+
</q-item>
|
|
42
|
+
<q-item v-if="!hasFeatureSchema" class="row justify-start">
|
|
43
|
+
<q-item-section class="col-1"><q-toggle v-model="hasOpacity"/></q-item-section>
|
|
44
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.LAYER_OPACITY')}} </q-item-section>
|
|
45
|
+
<q-item-section class="col-2">
|
|
57
46
|
<q-slider v-model="opacity" :disable="!hasOpacity"
|
|
58
47
|
:min="0" :max="1" :step="0.1"
|
|
59
48
|
label label-always :label-value="$t('KLayerStyleForm.OPACITY') + ' ' + opacity"/>
|
|
@@ -62,225 +51,160 @@
|
|
|
62
51
|
</q-list>
|
|
63
52
|
</q-expansion-item>
|
|
64
53
|
<q-expansion-item v-if="isVectorLayer" id="style-point-group" icon="las la-map-marker-alt" :label="$t('KLayerStyleForm.POINTS')" group="group">
|
|
65
|
-
<q-list dense class="
|
|
66
|
-
<q-item class="
|
|
67
|
-
<q-item-section
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<q-item-section class="col-
|
|
71
|
-
|
|
54
|
+
<q-list dense class="q-pa-md">
|
|
55
|
+
<q-item class="row justify-start">
|
|
56
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.DEFAULT_ICON_STYLE')}}</q-item-section>
|
|
57
|
+
<q-item-section avatar><q-avatar id="style-point-icon" :text-color="defaultPoint['icon.color']" :icon="defaultPoint['icon.classes'] || 'fas fa-circle'"
|
|
58
|
+
:color="defaultPoint['icon.color'] === 'white' ? 'dark' : 'white'" @click="onIconClicked(defaultPoint)"/></q-item-section>
|
|
59
|
+
<q-item-section class="col-1"><q-select id="style-icon-size" :label="$t('KLayerStyleForm.ICON_SIZE')" hide-dropdown-icon v-model="defaultPoint['icon.size']" dense :options="getSizes()" emit-value map-options/>
|
|
60
|
+
</q-item-section>
|
|
61
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.DEFAULT_POINT_STYLE')}} </q-item-section>
|
|
62
|
+
<q-item-section avatar><q-btn id="style-point-color" round style="max-width: 16px" :color="defaultPoint['color']" @click="onColorClicked(defaultPoint, 'color')"/></q-item-section>
|
|
63
|
+
|
|
64
|
+
<q-item-section class="col-1"><q-select id="style-point-size" :label="$t('KLayerStyleForm.POINT_SIZE')" hide-dropdown-icon v-model="defaultPoint.size" dense :options="getSizes()" emit-value map-options/>
|
|
65
|
+
</q-item-section>
|
|
66
|
+
<q-item-section avatar><q-select id="style-point-shape" :label="$t('KLayerStyleForm.POINT_SHAPE')" hide-dropdown-icon v-model="defaultPoint.shape" dense :options="getShapes()" emit-value map-options bottom-slots>
|
|
67
|
+
<template v-slot:selected-item="scope"><KShape :options="scope.opt"/></template>
|
|
68
|
+
<template v-slot:option="scope"><KShape class="row justify-center" v-bind="scope.itemProps" :options="scope.opt"/></template>
|
|
69
|
+
</q-select></q-item-section>
|
|
70
|
+
</q-item>
|
|
71
|
+
<q-item v-if="hasFeatureSchema" v-for="iconStyle in iconStyles" :key="iconStyle.key" class="row justify-start">
|
|
72
|
+
<q-item-section avatar><q-btn flat round color="primary" icon="las la-trash" @click="onRemoveIconStyle(iconStyle)">
|
|
73
|
+
<q-tooltip>{{$t('KLayerStyleForm.REMOVE_POINT_STYLE')}}</q-tooltip></q-btn>
|
|
72
74
|
</q-item-section>
|
|
73
|
-
<q-item-section
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
label label-always :label-value="disableClusteringAtZoom"/>
|
|
75
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.PROPERTY_ICON_STYLE')}}</q-item-section>
|
|
76
|
+
<q-item-section avatar><q-avatar :text-color="iconStyle['icon.color']" :icon="iconStyle['icon.classes']" color="white" @click="onIconClicked(iconStyle)"/></q-item-section>
|
|
77
|
+
<q-item-section class="col-1"><q-select :label="$t('KLayerStyleForm.ICON_SIZE')" hide-dropdown-icon v-model="iconStyle['icon.size']" dense :options="getSizes()" emit-value map-options/>
|
|
77
78
|
</q-item-section>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
:icon="defaultIcon['icon-classes']" :color="defaultIcon['marker-color']" @click="onIconClicked(defaultIcon)"/>
|
|
79
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.PROPERTY_POINT_STYLE')}} </q-item-section>
|
|
80
|
+
<q-item-section avatar><q-btn round style="max-width: 16px" :color="iconStyle['color']" @click="onColorClicked(iconStyle, 'color')"></q-btn></q-item-section>
|
|
81
|
+
|
|
82
|
+
<q-item-section class="col-1"><q-select id="style-point-size" :label="$t('KLayerStyleForm.POINT_SIZE')" hide-dropdown-icon v-model="iconStyle.size" dense :options="getSizes()" emit-value map-options/>
|
|
83
83
|
</q-item-section>
|
|
84
|
-
<q-item-section>
|
|
85
|
-
|
|
84
|
+
<q-item-section avatar><q-select id="style-point-shape" :label="$t('KLayerStyleForm.POINT_SHAPE')" hide-dropdown-icon v-model="iconStyle.shape" dense :options="getShapes()" emit-value map-options bottom-slots>
|
|
85
|
+
<template v-slot:selected-item="scope"><KShape :options="scope.opt"/></template>
|
|
86
|
+
<template v-slot:option="scope"><KShape class="row justify-center" v-bind="scope.itemProps" :options="scope.opt"/></template>
|
|
87
|
+
</q-select></q-item-section>
|
|
88
|
+
<q-item-section class="col-2"><q-select v-if="iconStyle.operator" v-model="iconStyle.operator" dense :options="getOperators(iconStyle)" emit-value map-options>
|
|
89
|
+
<template v-slot:prepend><span class="text-body2">{{$t('KLayerStyleForm.WHEN_PROPERTY_IS_POINT_STYLE', { property: iconStyle.property })}}</span></template></q-select>
|
|
86
90
|
</q-item-section>
|
|
87
|
-
|
|
88
|
-
<q-item v-bind:id="'point-feature-schema-' + color" v-if="hasFeatureSchema" v-for="iconStyle in iconStyles" :key="iconStyle.key" class="col-12">
|
|
89
|
-
<q-item-section avatar>
|
|
90
|
-
<q-chip clickable v-ripple text-color="white"
|
|
91
|
-
:icon="iconStyle['icon-classes']" :color="iconStyle['marker-color']" @click="onIconClicked(iconStyle)"/>
|
|
92
|
-
</q-item-section>
|
|
93
|
-
<q-item-section avatar class="col-4">
|
|
94
|
-
<q-select v-if="iconStyle.operator" v-model="iconStyle.operator" :label="iconStyle.property" stack-label :options="getOperators(iconStyle)" emit-value map-options/>
|
|
95
|
-
</q-item-section>
|
|
96
|
-
<q-item-section class="col-5">
|
|
97
|
-
<component
|
|
98
|
-
:is="iconStyle.component"
|
|
99
|
-
:ref="iconStyle.onComponentCreated"
|
|
100
|
-
:properties="iconStyle.properties"
|
|
101
|
-
:display="{ icon: false, label: false }"
|
|
102
|
-
@field-changed="iconStyle.onValueChanged"
|
|
103
|
-
/>
|
|
104
|
-
</q-item-section>
|
|
105
|
-
<q-item-section avatar>
|
|
106
|
-
<q-btn flat color="primary" icon="las la-trash" @click="onRemoveIconStyle(iconStyle)">
|
|
107
|
-
<q-tooltip anchor="top middle" self="bottom middle" :offset="[10, 10]">
|
|
108
|
-
{{$t('KLayerStyleForm.REMOVE_POINT_STYLE')}}
|
|
109
|
-
</q-tooltip>
|
|
110
|
-
</q-btn>
|
|
91
|
+
<q-item-section><component :is="iconStyle.component" :ref="iconStyle.onComponentCreated" :properties="iconStyle.properties" @field-changed="iconStyle.onValueChanged"/>
|
|
111
92
|
</q-item-section>
|
|
112
93
|
</q-item>
|
|
113
|
-
<q-item v-if="hasFeatureSchema" class="
|
|
114
|
-
<q-item-section avatar class="col-6 text-left">
|
|
115
|
-
{{$t('KLayerStyleForm.ADD_POINT_STYLE')}}
|
|
116
|
-
</q-item-section>
|
|
94
|
+
<q-item v-if="hasFeatureSchema" class="row justify-start">
|
|
117
95
|
<q-item-section class="col-6">
|
|
118
96
|
<q-select v-model="property" :options="properties">
|
|
119
|
-
<template v-slot:
|
|
120
|
-
|
|
121
|
-
</template>
|
|
97
|
+
<template v-slot:prepend><span class="text-body2">{{$t('KLayerStyleForm.ADD_POINT_STYLE')}}</span></template>
|
|
98
|
+
<template v-slot:before><q-btn v-if="property" round dense flat icon="las la-plus" @click="onAddIconStyle(property)"/></template>
|
|
122
99
|
</q-select>
|
|
123
100
|
</q-item-section>
|
|
124
101
|
</q-item>
|
|
125
102
|
</q-list>
|
|
126
103
|
</q-expansion-item>
|
|
127
104
|
<q-expansion-item v-if="isVectorLayer" id="style-line-group" icon="las la-grip-lines" :label="$t('KLayerStyleForm.LINES')" group="group">
|
|
128
|
-
<q-list dense class="
|
|
129
|
-
<q-item class="
|
|
130
|
-
<q-item-section
|
|
131
|
-
|
|
105
|
+
<q-list dense class="q-pa-md">
|
|
106
|
+
<q-item class="row justify-start">
|
|
107
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.DEFAULT_LINE_STYLE')}} </q-item-section>
|
|
108
|
+
<q-item-section class="col-1"><q-slider id="style-line-width" v-model="defaultLine['width']" :min="1" :max="20" :step="1"
|
|
109
|
+
dense label label-always :label-value="$t('KLayerStyleForm.LINE_WIDTH') + defaultLine['width'] + 'px'"/>
|
|
132
110
|
</q-item-section>
|
|
133
|
-
<q-item-section class="col-1"
|
|
134
|
-
|
|
135
|
-
</q-btn>
|
|
136
|
-
</q-item-section>
|
|
137
|
-
<q-item-section class="col-2">
|
|
138
|
-
<q-slider id="style-line-width" v-model="defaultLine['stroke-width']"
|
|
139
|
-
:min="1" :max="20" :step="1"
|
|
140
|
-
label label-always :label-value="$t('KLayerStyleForm.LINE_WIDTH') + defaultLine['stroke-width'] + 'px'"/>
|
|
141
|
-
</q-item-section>
|
|
142
|
-
<q-item-section class="col-2">
|
|
143
|
-
<q-slider id="style-line-opacity" v-model="defaultLine['stroke-opacity']"
|
|
144
|
-
:min="0" :max="1" :step="0.1"
|
|
145
|
-
label label-always :label-value="$t('KLayerStyleForm.LINE_OPACITY') + defaultLine['stroke-opacity']"/>
|
|
111
|
+
<q-item-section class="col-1"><q-slider id="style-line-opacity" v-model="defaultLine['opacity']" :min="0" :max="1" :step="0.1"
|
|
112
|
+
label label-always :label-value="$t('KLayerStyleForm.LINE_OPACITY') + defaultLine['opacity']"/>
|
|
146
113
|
</q-item-section>
|
|
114
|
+
<q-item-section class="col-1"><q-btn id="style-line-color" round style="max-width: 16px" :color="defaultLine['color']" @click="onColorClicked(defaultLine, 'color')"/></q-item-section>
|
|
147
115
|
</q-item>
|
|
148
|
-
<q-item v-if="hasFeatureSchema" v-for="lineStyle in lineStyles" :key="lineStyle.key" class="
|
|
149
|
-
<q-item-section avatar
|
|
150
|
-
<q-
|
|
151
|
-
</q-item-section>
|
|
152
|
-
<q-item-section class="col-3">
|
|
153
|
-
<component
|
|
154
|
-
:is="lineStyle.component"
|
|
155
|
-
:ref="lineStyle.onComponentCreated"
|
|
156
|
-
:properties="lineStyle.properties"
|
|
157
|
-
:display="{ icon: false, label: false }"
|
|
158
|
-
@field-changed="lineStyle.onValueChanged"
|
|
159
|
-
/>
|
|
160
|
-
</q-item-section>
|
|
161
|
-
<q-item-section class="col-1">
|
|
162
|
-
<q-btn round small :color="lineStyle['stroke-color']" @click="onColorClicked(lineStyle, 'stroke-color')">
|
|
163
|
-
</q-btn>
|
|
116
|
+
<q-item v-if="hasFeatureSchema" v-for="lineStyle in lineStyles" :key="lineStyle.key" class="row justify-start">
|
|
117
|
+
<q-item-section avatar><q-btn flat round color="primary" icon="las la-trash" @click="onRemoveLineStyle(lineStyle)">
|
|
118
|
+
<q-tooltip>{{$t('KLayerStyleForm.REMOVE_LINE_STYLE')}}</q-tooltip></q-btn>
|
|
164
119
|
</q-item-section>
|
|
165
|
-
<q-item-section
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
label label-always :label-value="$t('KLayerStyleForm.LINE_WIDTH') + lineStyle['stroke-width'] + 'px'"/>
|
|
120
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.PROPERTY_LINE_STYLE')}}</q-item-section>
|
|
121
|
+
<q-item-section class="col-1"><q-slider v-model="lineStyle['width']" :min="1" :max="20" :step="1"
|
|
122
|
+
label label-always :label-value="$t('KLayerStyleForm.LINE_WIDTH') + lineStyle['width'] + 'px'"/>
|
|
169
123
|
</q-item-section>
|
|
170
|
-
<q-item-section class="col-
|
|
171
|
-
|
|
172
|
-
:min="0" :max="1" :step="0.1"
|
|
173
|
-
label label-always :label-value="$t('KLayerStyleForm.LINE_OPACITY') + lineStyle['stroke-opacity']"/>
|
|
124
|
+
<q-item-section class="col-1"><q-slider v-model="lineStyle['opacity']" :min="0" :max="1" :step="0.1"
|
|
125
|
+
label label-always :label-value="$t('KLayerStyleForm.LINE_OPACITY') + lineStyle['opacity']"/>
|
|
174
126
|
</q-item-section>
|
|
175
|
-
<q-item-section
|
|
176
|
-
|
|
177
|
-
<
|
|
178
|
-
{{$t('KLayerStyleForm.REMOVE_LINE_STYLE')}}
|
|
179
|
-
</q-tooltip>
|
|
180
|
-
</q-btn>
|
|
127
|
+
<q-item-section class="col-1"><q-btn round style="max-width: 16px" :color="lineStyle['color']" @click="onColorClicked(lineStyle, 'color')"/></q-item-section>
|
|
128
|
+
<q-item-section class="col-2"><q-select v-if="lineStyle.operator" v-model="lineStyle.operator" dense :options="getOperators(lineStyle)" emit-value map-options>
|
|
129
|
+
<template v-slot:prepend><span class="text-body2">{{$t('KLayerStyleForm.WHEN_PROPERTY_IS_LINE_STYLE', { property: lineStyle.property })}}</span></template></q-select>
|
|
181
130
|
</q-item-section>
|
|
182
|
-
|
|
183
|
-
<q-item v-if="hasFeatureSchema" class="col-12">
|
|
184
|
-
<q-item-section avatar class="col-6 text-left">
|
|
185
|
-
{{$t('KLayerStyleForm.ADD_LINE_STYLE')}}
|
|
131
|
+
<q-item-section class="col-5"><component :is="lineStyle.component" :ref="lineStyle.onComponentCreated" :properties="lineStyle.properties" @field-changed="lineStyle.onValueChanged"/>
|
|
186
132
|
</q-item-section>
|
|
133
|
+
</q-item>
|
|
134
|
+
<q-item v-if="hasFeatureSchema" class="row justify-start">
|
|
187
135
|
<q-item-section class="col-6">
|
|
188
136
|
<q-select v-model="property" :options="properties">
|
|
189
|
-
<template v-slot:
|
|
190
|
-
|
|
191
|
-
</template>
|
|
137
|
+
<template v-slot:prepend><span class="text-body2">{{$t('KLayerStyleForm.ADD_LINE_STYLE')}}</span></template>
|
|
138
|
+
<template v-slot:before><q-btn v-if="property" round dense flat icon="las la-plus" @click="onAddLineStyle(property)"/></template>
|
|
192
139
|
</q-select>
|
|
193
140
|
</q-item-section>
|
|
194
141
|
</q-item>
|
|
195
142
|
</q-list>
|
|
196
143
|
</q-expansion-item>
|
|
197
144
|
<q-expansion-item v-if="isVectorLayer" id="style-polygon-group" icon="las la-draw-polygon" :label="$t('KLayerStyleForm.POLYGONS')" group="group">
|
|
198
|
-
<q-list dense class="
|
|
199
|
-
<q-item class="
|
|
200
|
-
<q-item-section
|
|
201
|
-
|
|
145
|
+
<q-list dense class="q-pa-md">
|
|
146
|
+
<q-item class="row justify-start">
|
|
147
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.DEFAULT_POLYGON_LINE_STYLE')}} </q-item-section>
|
|
148
|
+
<q-item-section class="col-1"><q-slider id="style-polygon-line-width" v-model="defaultPolygon['stroke.width']" :min="1" :max="20" :step="1"
|
|
149
|
+
label label-always :label-value="$t('KLayerStyleForm.POLYGON_LINE_WIDTH') + defaultPolygon['stroke.width'] + 'px'"/>
|
|
202
150
|
</q-item-section>
|
|
203
|
-
<q-item-section class="col-1"
|
|
204
|
-
|
|
205
|
-
</q-btn>
|
|
151
|
+
<q-item-section class="col-1"><q-slider id="style-polygon-line-opacity" v-model="defaultPolygon['stroke.opacity']" :min="0" :max="1" :step="0.1"
|
|
152
|
+
label label-always :label-value="$t('KLayerStyleForm.POLYGON_LINE_OPACITY') + defaultPolygon['stroke.opacity']"/>
|
|
206
153
|
</q-item-section>
|
|
207
|
-
<q-item-section class="col-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
154
|
+
<q-item-section class="col-1"><q-btn id="style-polygon-line-color" round style="max-width: 16px" :color="defaultPolygon['stroke.color']" @click="onColorClicked(defaultPolygon, 'stroke.color')"/>
|
|
155
|
+
</q-item-section>
|
|
156
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.DEFAULT_POLYGON_FILL_STYLE')}} </q-item-section>
|
|
157
|
+
<q-item-section class="col-1"><q-slider id="style-polygon-opacity" v-model="defaultPolygon['opacity']" :min="0" :max="1" :step="0.1"
|
|
158
|
+
label label-always :label-value="$t('KLayerStyleForm.POLYGON_FILL_OPACITY') + defaultPolygon['opacity']"/>
|
|
159
|
+
</q-item-section>
|
|
160
|
+
<q-item-section class="col-1"><q-btn id="style-polygon-color" round style="max-width: 16px" :color="defaultPolygon['color']" @click="onColorClicked(defaultPolygon, 'color')"/>
|
|
211
161
|
</q-item-section>
|
|
212
162
|
</q-item>
|
|
213
|
-
<q-item v-if="hasFeatureSchema" v-for="polygonStyle in polygonStyles" :key="polygonStyle.key" class="
|
|
214
|
-
<q-item-section avatar
|
|
215
|
-
<q-
|
|
216
|
-
</q-item-section>
|
|
217
|
-
<q-item-section class="col-4">
|
|
218
|
-
<component
|
|
219
|
-
:is="polygonStyle.component"
|
|
220
|
-
:ref="polygonStyle.onComponentCreated"
|
|
221
|
-
:properties="polygonStyle.properties"
|
|
222
|
-
:display="{ icon: false, label: false }"
|
|
223
|
-
@field-changed="polygonStyle.onValueChanged"
|
|
224
|
-
/>
|
|
225
|
-
</q-item-section>
|
|
226
|
-
<q-item-section class="col-1">
|
|
227
|
-
<q-btn round small :color="polygonStyle['fill-color']" @click="onColorClicked(polygonStyle, 'fill-color')">
|
|
228
|
-
</q-btn>
|
|
163
|
+
<q-item v-if="hasFeatureSchema" v-for="polygonStyle in polygonStyles" :key="polygonStyle.key" class="row justify-start">
|
|
164
|
+
<q-item-section avatar><q-btn flat round color="primary" icon="las la-trash" @click="onRemovePolygonStyle(polygonStyle)">
|
|
165
|
+
<q-tooltip>{{$t('KLayerStyleForm.REMOVE_POLYGON_STYLE')}}</q-tooltip></q-btn>
|
|
229
166
|
</q-item-section>
|
|
230
|
-
<q-item-section
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
label label-always :label-value="$t('KLayerStyleForm.POLYGON_FILL_OPACITY') + polygonStyle['fill-opacity']"/>
|
|
167
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.PROPERTY_POLYGON_LINE_STYLE')}}</q-item-section>
|
|
168
|
+
<q-item-section class="col-1"><q-slider v-model="polygonStyle['stroke.width']" :min="1" :max="20" :step="1"
|
|
169
|
+
label label-always :label-value="$t('KLayerStyleForm.POLYGON_LINE_WIDTH') + polygonStyle['stroke.width'] + 'px'"/>
|
|
234
170
|
</q-item-section>
|
|
235
|
-
<q-item-section
|
|
236
|
-
|
|
237
|
-
<q-tooltip anchor="top middle" self="bottom middle" :offset="[10, 10]">
|
|
238
|
-
{{$t('KLayerStyleForm.REMOVE_POLYGON_STYLE')}}
|
|
239
|
-
</q-tooltip>
|
|
240
|
-
</q-btn>
|
|
171
|
+
<q-item-section class="col-1"><q-slider v-model="polygonStyle['stroke.opacity']" :min="0" :max="1" :step="0.1"
|
|
172
|
+
label label-always :label-value="$t('KLayerStyleForm.POLYGON_LINE_OPACITY') + polygonStyle['stroke.opacity']"/>
|
|
241
173
|
</q-item-section>
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
<q-item-section avatar
|
|
245
|
-
|
|
174
|
+
<q-item-section><q-btn round style="max-width: 16px" :color="polygonStyle['stroke.color']" @click="onColorClicked(polygonStyle, 'stroke.color')"/>
|
|
175
|
+
</q-item-section>
|
|
176
|
+
<q-item-section avatar>{{$t('KLayerStyleForm.PROPERTY_POLYGON_FILL_STYLE')}} </q-item-section>
|
|
177
|
+
<q-item-section class="col-1"><q-slider v-model="polygonStyle['opacity']" :min="0" :max="1" :step="0.1"
|
|
178
|
+
label label-always :label-value="$t('KLayerStyleForm.POLYGON_FILL_OPACITY') + polygonStyle['opacity']"/>
|
|
179
|
+
</q-item-section>
|
|
180
|
+
<q-item-section class="col-1"><q-btn round style="max-width: 16px" :color="polygonStyle['color']" @click="onColorClicked(polygonStyle, 'color')"/>
|
|
246
181
|
</q-item-section>
|
|
182
|
+
<q-item-section class="col-2"><q-select v-if="polygonStyle.operator" v-model="polygonStyle.operator" dense :options="getOperators(polygonStyle)" emit-value map-options>
|
|
183
|
+
<template v-slot:prepend><span class="text-body2">{{$t('KLayerStyleForm.WHEN_PROPERTY_IS_POLYGON_STYLE', { property: polygonStyle.property })}}</span></template></q-select>
|
|
184
|
+
</q-item-section>
|
|
185
|
+
<q-item-section class="col-3"><component :is="polygonStyle.component" :ref="polygonStyle.onComponentCreated" :properties="polygonStyle.properties" @field-changed="polygonStyle.onValueChanged"/>
|
|
186
|
+
</q-item-section>
|
|
187
|
+
</q-item>
|
|
188
|
+
<q-item v-if="hasFeatureSchema" class="row justify-start">
|
|
247
189
|
<q-item-section class="col-6">
|
|
248
190
|
<q-select v-model="property" :options="properties">
|
|
249
|
-
<template v-slot:
|
|
250
|
-
|
|
251
|
-
</template>
|
|
191
|
+
<template v-slot:prepend><span class="text-body2">{{$t('KLayerStyleForm.ADD_POLYGON_STYLE')}}</span></template>
|
|
192
|
+
<template v-slot:before><q-btn v-if="property" round dense flat icon="las la-plus" @click="onAddPolygonStyle(property)"/></template>
|
|
252
193
|
</q-select>
|
|
253
194
|
</q-item-section>
|
|
254
195
|
</q-item>
|
|
255
196
|
</q-list>
|
|
256
197
|
</q-expansion-item>
|
|
257
198
|
<q-expansion-item v-if="hasFeatureSchema" ref="popup" id="style-popup-group" icon="las la-comment-alt" :label="$t('KLayerStyleForm.POPUP')" group="group">
|
|
258
|
-
<q-list dense class="
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
<q-item-section class="col-
|
|
262
|
-
|
|
263
|
-
</q-item-section>
|
|
264
|
-
<q-item-section class="col-11">
|
|
265
|
-
<q-select
|
|
266
|
-
for="style-popup-field"
|
|
267
|
-
id="style-popup-field"
|
|
268
|
-
:disable="!popup"
|
|
269
|
-
use-chips
|
|
270
|
-
v-model="popupProperties"
|
|
271
|
-
multiple
|
|
272
|
-
:options="properties"
|
|
273
|
-
:label="$t('KLayerStyleForm.ADD_POPUP')"
|
|
274
|
-
>
|
|
199
|
+
<q-list dense class="q-pa-md">
|
|
200
|
+
<q-item class="row justify-start">
|
|
201
|
+
<q-item-section class="col-1"><q-toggle id="style-toggle-popup" v-model="popup"/></q-item-section>
|
|
202
|
+
<q-item-section class="col-6"><q-select for="style-popup-field" id="style-popup-field" :disable="!popup" use-chips
|
|
203
|
+
v-model="popupProperties" multiple :options="properties" :label="$t('KLayerStyleForm.ADD_POPUP')">
|
|
275
204
|
<!-- Options display -->
|
|
276
205
|
<template v-slot:option="scope">
|
|
277
|
-
<q-item
|
|
278
|
-
|
|
279
|
-
:id="getPopupId(scope.opt)"
|
|
280
|
-
>
|
|
281
|
-
<q-item-section>
|
|
282
|
-
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
|
283
|
-
</q-item-section>
|
|
206
|
+
<q-item v-bind="scope.itemProps" :id="getPopupId(scope.opt)">
|
|
207
|
+
<q-item-section> <q-item-label>{{ scope.opt.label }}</q-item-label> </q-item-section>
|
|
284
208
|
</q-item>
|
|
285
209
|
</template>
|
|
286
210
|
</q-select>
|
|
@@ -289,29 +213,15 @@
|
|
|
289
213
|
</q-list>
|
|
290
214
|
</q-expansion-item>
|
|
291
215
|
<q-expansion-item v-if="hasFeatureSchema" ref="tooltip" id="style-tooltip-group" icon="las la-mouse-pointer" :label="$t('KLayerStyleForm.TOOLTIP')" group="group">
|
|
292
|
-
<q-list dense class="
|
|
293
|
-
<q-item class="
|
|
294
|
-
<q-item-section class="col-1">
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<q-item-section class="col-11">
|
|
298
|
-
<q-select
|
|
299
|
-
for="style-tooltip-field"
|
|
300
|
-
id="style-tooltip-field"
|
|
301
|
-
:disable="!tooltip"
|
|
302
|
-
v-model="tooltipProperty"
|
|
303
|
-
:options="properties"
|
|
304
|
-
:label="$t('KLayerStyleForm.ADD_TOOLTIP')"
|
|
305
|
-
>
|
|
216
|
+
<q-list dense class="q-pa-md">
|
|
217
|
+
<q-item class="row justify-start">
|
|
218
|
+
<q-item-section class="col-1"><q-toggle id="style-toggle-tooltip" v-model="tooltip"/></q-item-section>
|
|
219
|
+
<q-item-section class="col-6"><q-select for="style-tooltip-field" id="style-tooltip-field" :disable="!tooltip"
|
|
220
|
+
v-model="tooltipProperty" :options="properties" :label="$t('KLayerStyleForm.ADD_TOOLTIP')">
|
|
306
221
|
<!-- Options display -->
|
|
307
222
|
<template v-slot:option="scope">
|
|
308
|
-
<q-item
|
|
309
|
-
|
|
310
|
-
:id="getPopupId(scope.opt)"
|
|
311
|
-
>
|
|
312
|
-
<q-item-section>
|
|
313
|
-
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
|
314
|
-
</q-item-section>
|
|
223
|
+
<q-item v-bind="scope.itemProps" :id="getPopupId(scope.opt)" >
|
|
224
|
+
<q-item-section> <q-item-label>{{ scope.opt.label }}</q-item-label> </q-item-section>
|
|
315
225
|
</q-item>
|
|
316
226
|
</template>
|
|
317
227
|
</q-select>
|
|
@@ -320,31 +230,15 @@
|
|
|
320
230
|
</q-list>
|
|
321
231
|
</q-expansion-item>
|
|
322
232
|
<q-expansion-item v-if="hasFeatureSchema" ref="infobox" id="style-infobox-group" icon="las la-th-list" :label="$t('KLayerStyleForm.INFOBOX')" group="group">
|
|
323
|
-
<q-list dense class="
|
|
324
|
-
<q-item class="
|
|
325
|
-
<q-item-section class="col-1">
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
<q-item-section class="col-11">
|
|
329
|
-
<q-select
|
|
330
|
-
for="style-infobox-field"
|
|
331
|
-
id="style-infobox-field"
|
|
332
|
-
:disable="!infobox"
|
|
333
|
-
use-chips
|
|
334
|
-
v-model="infoboxProperties"
|
|
335
|
-
multiple
|
|
336
|
-
:options="properties"
|
|
337
|
-
:label="$t('KLayerStyleForm.ADD_INFOBOX')"
|
|
338
|
-
>
|
|
233
|
+
<q-list dense class="q-pa-md">
|
|
234
|
+
<q-item class="row justify-start">
|
|
235
|
+
<q-item-section class="col-1"><q-toggle id="style-toggle-infobox" v-model="infobox"/> </q-item-section>
|
|
236
|
+
<q-item-section class="col-6"><q-select for="style-infobox-field" id="style-infobox-field" :disable="!infobox" use-chips
|
|
237
|
+
v-model="infoboxProperties" multiple :options="properties" :label="$t('KLayerStyleForm.ADD_INFOBOX')" >
|
|
339
238
|
<!-- Options display -->
|
|
340
239
|
<template v-slot:option="scope">
|
|
341
|
-
<q-item
|
|
342
|
-
|
|
343
|
-
:id="getPopupId(scope.opt)"
|
|
344
|
-
>
|
|
345
|
-
<q-item-section>
|
|
346
|
-
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
|
347
|
-
</q-item-section>
|
|
240
|
+
<q-item v-bind="scope.itemProps" :id="getPopupId(scope.opt)" >
|
|
241
|
+
<q-item-section> <q-item-label>{{ scope.opt.label }}</q-item-label> </q-item-section>
|
|
348
242
|
</q-item>
|
|
349
243
|
</template>
|
|
350
244
|
</q-select>
|
|
@@ -354,12 +248,8 @@
|
|
|
354
248
|
</q-expansion-item>
|
|
355
249
|
<q-list v-show="hasError" dense class="row items-center justify-around q-pa-md">
|
|
356
250
|
<q-item>
|
|
357
|
-
<q-item-section side>
|
|
358
|
-
|
|
359
|
-
</q-item-section>
|
|
360
|
-
<q-item-section class="text-negative">
|
|
361
|
-
{{error}}
|
|
362
|
-
</q-item-section>
|
|
251
|
+
<q-item-section side> <q-icon name="las la-exclamation-circle" color="negative" /> </q-item-section>
|
|
252
|
+
<q-item-section class="text-negative">{{error}} </q-item-section>
|
|
363
253
|
</q-item>
|
|
364
254
|
</q-list>
|
|
365
255
|
</div>
|
|
@@ -370,13 +260,15 @@ import _ from 'lodash'
|
|
|
370
260
|
import logger from 'loglevel'
|
|
371
261
|
import { uid } from 'quasar'
|
|
372
262
|
import { mixins as kCoreMixins, utils as kCoreUtils } from '../../../core/client'
|
|
373
|
-
import { KIconChooser, KColorChooser } from '../../../core/client/components'
|
|
263
|
+
import { KIconChooser, KColorChooser, KShape } from '../../../core/client/components'
|
|
264
|
+
import { processStyleTemplates, generateStyleTemplates } from '../utils/utils.style.js'
|
|
374
265
|
|
|
375
266
|
export default {
|
|
376
267
|
name: 'k-layer-style-form',
|
|
377
268
|
components: {
|
|
378
269
|
KIconChooser,
|
|
379
|
-
KColorChooser
|
|
270
|
+
KColorChooser,
|
|
271
|
+
KShape
|
|
380
272
|
},
|
|
381
273
|
emits: [
|
|
382
274
|
'form-ready'
|
|
@@ -402,9 +294,9 @@ export default {
|
|
|
402
294
|
properties () {
|
|
403
295
|
const properties = []
|
|
404
296
|
_.forOwn(this.fields, (value, key) => {
|
|
405
|
-
// Use
|
|
297
|
+
// Use label or ID
|
|
406
298
|
properties.push({
|
|
407
|
-
label: _.get(value, 'field.
|
|
299
|
+
label: _.get(value, 'field.label', key),
|
|
408
300
|
value: key
|
|
409
301
|
})
|
|
410
302
|
})
|
|
@@ -441,22 +333,11 @@ export default {
|
|
|
441
333
|
infoboxProperties: [],
|
|
442
334
|
clustering: true,
|
|
443
335
|
disableClusteringAtZoom: 18,
|
|
444
|
-
|
|
445
|
-
defaultIcon: {
|
|
446
|
-
'marker-color': 'blue',
|
|
447
|
-
'icon-classes': 'fas fa-circle'
|
|
448
|
-
},
|
|
336
|
+
defaultPoint: {},
|
|
449
337
|
iconStyles: [],
|
|
450
|
-
defaultLine: {
|
|
451
|
-
'stroke-color': 'red',
|
|
452
|
-
'stroke-width': 3,
|
|
453
|
-
'stroke-opacity': 1
|
|
454
|
-
},
|
|
338
|
+
defaultLine: {},
|
|
455
339
|
lineStyles: [],
|
|
456
|
-
defaultPolygon: {
|
|
457
|
-
'fill-color': 'green',
|
|
458
|
-
'fill-opacity': 1
|
|
459
|
-
},
|
|
340
|
+
defaultPolygon: {},
|
|
460
341
|
polygonStyles: [],
|
|
461
342
|
hasError: false,
|
|
462
343
|
error: ''
|
|
@@ -492,7 +373,7 @@ export default {
|
|
|
492
373
|
properties.field.options = values.map(value => ({ value, label: (_.isNil(value) ? 'NIL' : value) }))
|
|
493
374
|
}
|
|
494
375
|
// Remove label as we add it on top of the operator
|
|
495
|
-
properties.field.
|
|
376
|
+
properties.field.label = ''
|
|
496
377
|
// Load the required component
|
|
497
378
|
const component = kCoreUtils.loadComponent(componentName)
|
|
498
379
|
const style = {
|
|
@@ -507,6 +388,17 @@ export default {
|
|
|
507
388
|
}
|
|
508
389
|
return Object.assign(style, options)
|
|
509
390
|
},
|
|
391
|
+
getSizes () {
|
|
392
|
+
// From 8 to 64 by step of 8
|
|
393
|
+
return Array(8).fill().map((_, i) => ({
|
|
394
|
+
label: `${8 * i + 8}px`,
|
|
395
|
+
value: 8 * i + 8
|
|
396
|
+
}))
|
|
397
|
+
},
|
|
398
|
+
getShapes () {
|
|
399
|
+
return ['none', 'circle', 'triangle-down', 'triangle', 'triangle-right', 'triangle-left', 'rect', 'diamond', 'star', 'marker-pin', 'square-pin']
|
|
400
|
+
.map(shape => ({ value: shape, shape, size: 32, opacity: 0.1, color: 'primary', stroke: { color: 'primary', width: 2 } }))
|
|
401
|
+
},
|
|
510
402
|
getOperators (style) {
|
|
511
403
|
let operators = [{
|
|
512
404
|
label: this.$t('KLayerStyleForm.EQUAL'),
|
|
@@ -526,120 +418,13 @@ export default {
|
|
|
526
418
|
}
|
|
527
419
|
return operators
|
|
528
420
|
},
|
|
529
|
-
async processTemplates (values, properties, defaultStyle, styles) {
|
|
530
|
-
|
|
531
|
-
//
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
// if (properties.A === "V") { %>#00FF00<% } else
|
|
535
|
-
// if (properties.B === "U") { %>#FF0000<% } else
|
|
536
|
-
// { %>#0000FF<% }
|
|
537
|
-
|
|
538
|
-
// First split after the last else statement to get default style values, then split after each if/else statement
|
|
539
|
-
// We will have an array of template statements, actually one for each style property (i.e. stroke-width, marker-color, etc.)
|
|
540
|
-
const templates = {}
|
|
541
|
-
properties.forEach((property, index) => {
|
|
542
|
-
const templateStatements = _.get(values, `leaflet.${property}`).split('} else {')
|
|
543
|
-
templates[property] = templateStatements[0].split(' else ').concat(templateStatements[1])
|
|
544
|
-
})
|
|
545
|
-
// Process default style values
|
|
546
|
-
properties.forEach((property) => {
|
|
547
|
-
// Default style value is contained in the last template statement
|
|
548
|
-
let template = templates[property].pop()
|
|
549
|
-
// Extract it using a regex
|
|
550
|
-
template = template.match(/%>([^<%]+)<%/)[1]
|
|
551
|
-
// Conversion from palette to RGB color is required
|
|
552
|
-
const value = (property.includes('color') ? kCoreUtils.getPaletteFromColor(template) : template)
|
|
553
|
-
// Convert to number whenever required
|
|
554
|
-
if (property.includes('width') || property.includes('opacity')) {
|
|
555
|
-
defaultStyle[property] = _.toNumber(value)
|
|
556
|
-
} else {
|
|
557
|
-
defaultStyle[property] = value
|
|
558
|
-
}
|
|
559
|
-
})
|
|
560
|
-
// Then process all templated if statements
|
|
561
|
-
// As all templates have the same conditional structure use the first template to extract property values
|
|
562
|
-
const templatesStructure = templates[properties[0]]
|
|
563
|
-
for (let index = 0; index < templatesStructure.length; index++) {
|
|
564
|
-
const template = templatesStructure[index]
|
|
565
|
-
// Identify used operator first
|
|
566
|
-
const operators = ['===', '!==', '>', '<']
|
|
567
|
-
const operator = _.find(operators, operator => template.includes(` ${operator} `))
|
|
568
|
-
// Match properties + operator to get property name part
|
|
569
|
-
const propertyNameRegex = new RegExp(`properties.([^${operator}]+)${operator}`, 'g')
|
|
570
|
-
let propertyName = propertyNameRegex.exec(template)[1].trim()
|
|
571
|
-
const isNumber = !propertyName.includes('.toString()')
|
|
572
|
-
propertyName = propertyName.replace('.toString()', '')
|
|
573
|
-
// Split at operator
|
|
574
|
-
let propertyValue = template.split(` ${operator} `)[1]
|
|
575
|
-
// Match until last parenthesis of the if expression to get property value part
|
|
576
|
-
propertyValue = propertyValue.slice(0, propertyValue.indexOf(')'))
|
|
577
|
-
// Omit enclosing quotes for strings
|
|
578
|
-
propertyValue = propertyValue.replaceAll('"', '').trim()
|
|
579
|
-
if (isNumber) propertyValue = _.toNumber(propertyValue)
|
|
580
|
-
let style = { value: propertyValue, operator }
|
|
581
|
-
properties.forEach(property => {
|
|
582
|
-
// Match %> <% block to get style values, e.g. icon colors/names
|
|
583
|
-
const match = /%>([^<%]+)<%/g.exec(templates[property][index])
|
|
584
|
-
const value = (match ? match[1].trim() : '')
|
|
585
|
-
// Conversion from palette to RGB color is required
|
|
586
|
-
style[property] = (property.includes('color')
|
|
587
|
-
? kCoreUtils.getPaletteFromColor(value)
|
|
588
|
-
: (_.isNumber(value) ? Number(value) : value))
|
|
589
|
-
})
|
|
590
|
-
style = await this.createStyle(propertyName, style)
|
|
591
|
-
styles.push(style)
|
|
421
|
+
async processTemplates (values, properties, styleType, defaultStyle, styles) {
|
|
422
|
+
processStyleTemplates(values.leaflet, properties, styleType, defaultStyle, styles)
|
|
423
|
+
// Jump from style object to internal requirements for UI with additional component, etc.
|
|
424
|
+
for (let i = 0; i < styles.length; i++) {
|
|
425
|
+
styles[i] = await this.createStyle(styles[i].property, styles[i])
|
|
592
426
|
}
|
|
593
427
|
},
|
|
594
|
-
generateTemplates (properties, defaultStyle, styles) {
|
|
595
|
-
const hasStyles = (styles.length > 0)
|
|
596
|
-
const values = {}
|
|
597
|
-
const templates = properties.map(property => '')
|
|
598
|
-
// Process all styles, a style is a matching feature property value associated with a style property values.
|
|
599
|
-
// It is expressed as a if statement in the final template expression of the style property.
|
|
600
|
-
// For instance if I want all linear features with property 'A' equals 'V' to be green,
|
|
601
|
-
// all linear features with property 'B' equals 'U' to be red, and all others to be blue (default style),
|
|
602
|
-
// the 'stroke' style property value once converted to template will be the following:
|
|
603
|
-
// if (properties.A === "V") { %>#00FF00<% } else
|
|
604
|
-
// if (properties.B === "U") { %>#FF0000<% } else
|
|
605
|
-
// { %>#0000FF<% }
|
|
606
|
-
styles.forEach(style => {
|
|
607
|
-
// Process all properties, for each property
|
|
608
|
-
properties.forEach((property, index) => {
|
|
609
|
-
// Conversion from palette to RGB color is required
|
|
610
|
-
const value = (property.includes('color')
|
|
611
|
-
? kCoreUtils.getColorFromPalette(style[property])
|
|
612
|
-
: style[property])
|
|
613
|
-
let propertyName = style.property
|
|
614
|
-
let propertyValue = style.value
|
|
615
|
-
const propertyOperator = style.operator
|
|
616
|
-
if (typeof propertyValue !== 'number') {
|
|
617
|
-
propertyName = `${propertyName}.toString()`
|
|
618
|
-
propertyValue = `"${propertyValue}"`
|
|
619
|
-
}
|
|
620
|
-
// Generate style value for given property value
|
|
621
|
-
templates[index] += `if (properties.${propertyName} ${propertyOperator} ${propertyValue}) { %>${value}<% } else `
|
|
622
|
-
})
|
|
623
|
-
})
|
|
624
|
-
// Process default style for each style property
|
|
625
|
-
// If there are some styles based on feature property values it will be the last else statement
|
|
626
|
-
// otherwise it will simply be the sole value in the template expression
|
|
627
|
-
properties.forEach((property, index) => {
|
|
628
|
-
// Conversion from palette to RGB color is required
|
|
629
|
-
const value = (property.includes('color')
|
|
630
|
-
? kCoreUtils.getColorFromPalette(defaultStyle[property])
|
|
631
|
-
: defaultStyle[property])
|
|
632
|
-
// Avoid converting numbers to string on default values
|
|
633
|
-
if (hasStyles) templates[index] += `{ %>${value}<% }`
|
|
634
|
-
else templates[index] = value
|
|
635
|
-
})
|
|
636
|
-
// Set all templates
|
|
637
|
-
properties.forEach((property, index) => {
|
|
638
|
-
values[`leaflet.${property}`] = (hasStyles ? `<% ${templates[index]} %>` : templates[index])
|
|
639
|
-
})
|
|
640
|
-
values['leaflet.template'] = (hasStyles ? properties : [])
|
|
641
|
-
return values
|
|
642
|
-
},
|
|
643
428
|
fillBaseStyle (values) {
|
|
644
429
|
this.isVisible = _.get(values, 'leaflet.isVisible', true)
|
|
645
430
|
this.hasMinZoom = !!_.get(values, 'leaflet.minZoom')
|
|
@@ -659,44 +444,69 @@ export default {
|
|
|
659
444
|
this.iconStyles = []
|
|
660
445
|
const templates = _.get(values, 'leaflet.template', [])
|
|
661
446
|
// When no template we have a single default icon
|
|
662
|
-
if (!templates.includes('
|
|
447
|
+
if (!templates.includes('style.point.color')) {
|
|
663
448
|
// Conversion from palette to RGB color is required for markers
|
|
664
|
-
this.
|
|
665
|
-
_.get(
|
|
666
|
-
|
|
667
|
-
|
|
449
|
+
this.defaultPoint.color = kCoreUtils.getPaletteFromColor(
|
|
450
|
+
_.get(values, 'leaflet.style.point.color',
|
|
451
|
+
_.get(this.options, 'style.point.color', kCoreUtils.getColorFromPalette('red'))))
|
|
452
|
+
this.defaultPoint.size = _.get(values, 'leaflet.style.point.size',
|
|
453
|
+
_.get(this.options, 'style.point.size', 24))
|
|
454
|
+
this.defaultPoint.shape = _.get(values, 'leaflet.style.point.shape',
|
|
455
|
+
_.get(this.options, 'style.point.shape', 'circle'))
|
|
456
|
+
this.defaultPoint['icon.classes'] =
|
|
457
|
+
_.get(values, 'leaflet.style.point.icon.classes',
|
|
458
|
+
_.get(this.options, 'style.point.icon.classes', ''))
|
|
459
|
+
this.defaultPoint['icon.color'] = kCoreUtils.getPaletteFromColor(
|
|
460
|
+
_.get(values, 'leaflet.style.point.icon.color',
|
|
461
|
+
_.get(this.options, 'style.point.icon.color', kCoreUtils.getColorFromPalette('black'))))
|
|
462
|
+
this.defaultPoint['icon.size'] = _.get(values, 'leaflet.style.point.icon.size',
|
|
463
|
+
_.get(this.options, 'style.point.icon.size', 12))
|
|
668
464
|
} else {
|
|
669
|
-
await this.processTemplates(values, ['
|
|
465
|
+
await this.processTemplates(values, ['color', 'size', 'shape', 'icon.classes', 'icon.color', 'icon.size'], 'point', this.defaultPoint, this.iconStyles)
|
|
670
466
|
}
|
|
671
467
|
},
|
|
672
468
|
async fillLineStyles (values) {
|
|
673
469
|
this.lineStyles = []
|
|
674
470
|
const templates = _.get(values, 'leaflet.template', [])
|
|
675
471
|
// When no template we have a single default style
|
|
676
|
-
if (!templates.includes('
|
|
472
|
+
if (!templates.includes('style.line.color')) {
|
|
677
473
|
// Conversion from palette to RGB color is required for path style
|
|
678
|
-
this.defaultLine
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
474
|
+
this.defaultLine.color = kCoreUtils.getPaletteFromColor(
|
|
475
|
+
_.get(values, 'leaflet.style.line.color',
|
|
476
|
+
_.get(this.options, 'style.line.color'), kCoreUtils.getColorFromPalette('red')))
|
|
477
|
+
this.defaultLine.width =
|
|
478
|
+
_.get(values, 'leaflet.style.line.width',
|
|
479
|
+
_.get(this.options, 'style.line.width', 3))
|
|
480
|
+
this.defaultLine.opacity =
|
|
481
|
+
_.get(values, 'leaflet.style.line.opacity',
|
|
482
|
+
_.get(this.options, 'style.line.opacity', 1))
|
|
684
483
|
} else {
|
|
685
|
-
await this.processTemplates(values, ['
|
|
484
|
+
await this.processTemplates(values, ['color', 'width', 'opacity'], 'line', this.defaultLine, this.lineStyles)
|
|
686
485
|
}
|
|
687
486
|
},
|
|
688
487
|
async fillPolygonStyles (values) {
|
|
689
488
|
this.polygonStyles = []
|
|
690
489
|
const templates = _.get(values, 'leaflet.template', [])
|
|
691
490
|
// When no template we have a single default style
|
|
692
|
-
if (!templates.includes('
|
|
491
|
+
if (!templates.includes('style.polygon.color')) {
|
|
693
492
|
// Conversion from palette to RGB color is required for path style
|
|
694
|
-
this.defaultPolygon
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
493
|
+
this.defaultPolygon.color = kCoreUtils.getPaletteFromColor(
|
|
494
|
+
_.get(values, 'leaflet.style.polygon.color',
|
|
495
|
+
_.get(this.options, 'style.polygon.color', kCoreUtils.getColorFromPalette('red'))))
|
|
496
|
+
this.defaultPolygon.opacity =
|
|
497
|
+
_.get(values, 'leaflet.style.polygon.opacity',
|
|
498
|
+
_.get(this.options, 'style.polygon.opacity', 1))
|
|
499
|
+
this.defaultPolygon['stroke.color'] = kCoreUtils.getPaletteFromColor(
|
|
500
|
+
_.get(values, 'leaflet.style.polygon.stroke.color',
|
|
501
|
+
_.get(this.options, 'style.polygon.stroke.color', kCoreUtils.getColorFromPalette('red'))))
|
|
502
|
+
this.defaultPolygon['stroke.width'] =
|
|
503
|
+
_.get(values, 'leaflet.style.polygon.stroke.width',
|
|
504
|
+
_.get(this.options, 'style.polygon.stroke.width', 3))
|
|
505
|
+
this.defaultPolygon['stroke.opacity'] =
|
|
506
|
+
_.get(values, 'leaflet.style.polygon.stroke.opacity',
|
|
507
|
+
_.get(this.options, 'style.polygon.stroke.opacity', 1))
|
|
698
508
|
} else {
|
|
699
|
-
await this.processTemplates(values, ['
|
|
509
|
+
await this.processTemplates(values, ['color', 'opacity', 'stroke.color', 'stroke.width', 'stroke.opacity'], 'polygon', this.defaultPolygon, this.polygonStyles)
|
|
700
510
|
}
|
|
701
511
|
},
|
|
702
512
|
async fillPopupStyles (values) {
|
|
@@ -785,29 +595,38 @@ export default {
|
|
|
785
595
|
}
|
|
786
596
|
},
|
|
787
597
|
iconStylesValues () {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
598
|
+
// Use dot notation as it will be used to update style values using a patch operation
|
|
599
|
+
const templates = generateStyleTemplates(['color', 'size', 'shape', 'icon.classes', 'icon.color', 'icon.size'], 'point', this.defaultPoint, this.iconStyles)
|
|
600
|
+
// Globe does only support simple styling and maki icon right now
|
|
601
|
+
return Object.assign({}, _.mapKeys(templates, (value, key) => `leaflet.${key}`),
|
|
602
|
+
_.mapKeys(_.pick(templates, ['style.point.shape', 'style.point.size', 'style.point.color']), (value, key) => `cesium.${key}`))
|
|
791
603
|
},
|
|
792
604
|
lineStylesValues () {
|
|
793
|
-
|
|
605
|
+
// Use dot notation as it will be used to update style values using a patch operation
|
|
606
|
+
const templates = generateStyleTemplates(['color', 'width', 'opacity'], 'line', this.defaultLine, this.lineStyles)
|
|
607
|
+
return Object.assign({}, _.mapKeys(templates, (value, key) => `leaflet.${key}`), _.mapKeys(templates, (value, key) => `cesium.${key}`))
|
|
794
608
|
},
|
|
795
609
|
polygonStylesValues () {
|
|
796
|
-
|
|
610
|
+
// Use dot notation as it will be used to update style values using a patch operation
|
|
611
|
+
const templates = generateStyleTemplates(['color', 'opacity', 'stroke.color', 'stroke.width', 'stroke.opacity'], 'polygon', this.defaultPolygon, this.polygonStyles)
|
|
612
|
+
return Object.assign({}, _.mapKeys(templates, (value, key) => `leaflet.${key}`), _.mapKeys(templates, (value, key) => `cesium.${key}`))
|
|
797
613
|
},
|
|
798
614
|
popupStylesValues () {
|
|
799
615
|
return {
|
|
800
|
-
'leaflet.popup': (this.popup ? { pick: this.popupProperties.map(property => property.value) } : false)
|
|
616
|
+
'leaflet.popup': (this.popup ? { pick: this.popupProperties.map(property => property.value) } : false),
|
|
617
|
+
'cesium.popup': (this.popup ? { pick: this.popupProperties.map(property => property.value) } : false)
|
|
801
618
|
}
|
|
802
619
|
},
|
|
803
620
|
tooltipStylesValues () {
|
|
804
621
|
return {
|
|
805
|
-
'leaflet.tooltip': (this.tooltip ? { property: this.tooltipProperty.value } : false)
|
|
622
|
+
'leaflet.tooltip': (this.tooltip ? { property: this.tooltipProperty.value } : false),
|
|
623
|
+
'cesium.tooltip': (this.tooltip ? { property: this.tooltipProperty.value } : false)
|
|
806
624
|
}
|
|
807
625
|
},
|
|
808
626
|
infoBoxStylesValues () {
|
|
809
627
|
return {
|
|
810
|
-
'leaflet.infobox': (this.infobox ? { pick: this.infoboxProperties.map(property => property.value) } : false)
|
|
628
|
+
'leaflet.infobox': (this.infobox ? { pick: this.infoboxProperties.map(property => property.value) } : false),
|
|
629
|
+
'cesium.infobox': (this.infobox ? { pick: this.infoboxProperties.map(property => property.value) } : false)
|
|
811
630
|
}
|
|
812
631
|
},
|
|
813
632
|
values () {
|
|
@@ -837,11 +656,15 @@ export default {
|
|
|
837
656
|
},
|
|
838
657
|
async onAddIconStyle (property) {
|
|
839
658
|
// Default icon
|
|
840
|
-
let color = _.get(this.options, '
|
|
659
|
+
let color = _.get(this.options, 'style.point.color')
|
|
841
660
|
if (color) color = kCoreUtils.getPaletteFromColor(color)
|
|
842
661
|
const style = await this.createStyle(property.value, {
|
|
843
|
-
'icon
|
|
844
|
-
'
|
|
662
|
+
'icon.classes': _.get(this.options, 'style.point.icon.classes', 'fas fa-circle'),
|
|
663
|
+
'icon.color': _.get(this.options, 'style.point.icon.color', 'black'),
|
|
664
|
+
'icon.size': _.get(this.options, 'style.point.icon.size', 12),
|
|
665
|
+
color: color || 'red',
|
|
666
|
+
size: _.get(this.options, 'style.point.size', 24),
|
|
667
|
+
shape: _.get(this.options, 'style.point.shape', 'circle')
|
|
845
668
|
})
|
|
846
669
|
this.iconStyles.push(style)
|
|
847
670
|
},
|
|
@@ -852,14 +675,14 @@ export default {
|
|
|
852
675
|
onIconClicked (style) {
|
|
853
676
|
this.editedStyle = style
|
|
854
677
|
this.$refs.iconChooser.open({
|
|
855
|
-
name: style['icon
|
|
856
|
-
color: style['
|
|
678
|
+
name: style['icon.classes'],
|
|
679
|
+
color: style['icon.color']
|
|
857
680
|
})
|
|
858
681
|
},
|
|
859
682
|
onIconChanged (icon) {
|
|
860
683
|
Object.assign(this.editedStyle, {
|
|
861
|
-
'
|
|
862
|
-
'icon
|
|
684
|
+
'icon.color': icon.color,
|
|
685
|
+
'icon.classes': icon.name
|
|
863
686
|
})
|
|
864
687
|
},
|
|
865
688
|
onColorClicked (style, color) {
|
|
@@ -873,9 +696,9 @@ export default {
|
|
|
873
696
|
async onAddLineStyle (property) {
|
|
874
697
|
const style = await this.createStyle(property.value, {
|
|
875
698
|
// Default line
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
699
|
+
color: _.get(this.options, 'style.line.color', 'red'),
|
|
700
|
+
width: _.get(this.options, 'style.line.width', 1),
|
|
701
|
+
opacity: _.get(this.options, 'style.line.opacity', 1)
|
|
879
702
|
})
|
|
880
703
|
this.lineStyles.push(style)
|
|
881
704
|
},
|
|
@@ -886,8 +709,11 @@ export default {
|
|
|
886
709
|
async onAddPolygonStyle (property) {
|
|
887
710
|
const style = await this.createStyle(property.value, {
|
|
888
711
|
// Default line
|
|
889
|
-
|
|
890
|
-
|
|
712
|
+
color: _.get(this.options, 'style.polygon.color', 'green'),
|
|
713
|
+
opacity: _.get(this.options, 'style.polygon.opacity', 1),
|
|
714
|
+
'stroke.color': _.get(this.options, 'style.polygon.stroke.color', 'red'),
|
|
715
|
+
'stroke.width': _.get(this.options, 'style.polygon.stroke.width', 1),
|
|
716
|
+
'stroke.opacity': _.get(this.options, 'style.polygon.stroke.opacity', 1)
|
|
891
717
|
})
|
|
892
718
|
this.polygonStyles.push(style)
|
|
893
719
|
},
|