@kalisio/kdk 2.2.0 → 2.2.2
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/core/api/application.js +2 -3
- package/core/client/components/KModal.vue +1 -1
- package/core/client/components/form/KForm.vue +12 -3
- package/core/client/components/media/KColorScale.vue +1 -1
- package/core/client/exporter.js +14 -8
- package/core/client/mixins/mixin.base-field.js +4 -1
- package/core/client/units.js +3 -3
- package/core/client/utils/utils.shapes.js +1 -1
- package/extras/icons/wind-speed-0.svg +8 -0
- package/extras/icons/wind-speed-10.svg +8 -0
- package/extras/icons/wind-speed-100.svg +12 -0
- package/extras/icons/wind-speed-105.svg +13 -0
- package/extras/icons/wind-speed-15.svg +9 -0
- package/extras/icons/wind-speed-20.svg +9 -0
- package/extras/icons/wind-speed-25.svg +10 -0
- package/extras/icons/wind-speed-30.svg +10 -0
- package/extras/icons/wind-speed-35.svg +11 -0
- package/extras/icons/wind-speed-40.svg +11 -0
- package/extras/icons/wind-speed-45.svg +12 -0
- package/extras/icons/wind-speed-5.svg +9 -0
- package/extras/icons/wind-speed-50.svg +9 -0
- package/extras/icons/wind-speed-55.svg +10 -0
- package/extras/icons/wind-speed-60.svg +10 -0
- package/extras/icons/wind-speed-65.svg +11 -0
- package/extras/icons/wind-speed-70.svg +11 -0
- package/extras/icons/wind-speed-75.svg +12 -0
- package/extras/icons/wind-speed-80.svg +12 -0
- package/extras/icons/wind-speed-85.svg +13 -0
- package/extras/icons/wind-speed-90.svg +13 -0
- package/extras/icons/wind-speed-95.svg +14 -0
- package/map/api/hooks/hooks.query.js +34 -11
- package/map/client/cesium/utils/index.js +2 -1
- package/map/client/cesium/utils/utils.features.js +8 -0
- package/map/client/cesium/utils/utils.style.js +4 -4
- package/map/client/components/KFeatureEditor.vue +2 -3
- package/map/client/components/KLayerStyleForm.vue +32 -24
- package/map/client/components/KTimezoneMap.vue +3 -4
- package/map/client/components/catalog/KConnectLayer.vue +14 -10
- package/map/client/components/legend/KColorScaleLegend.vue +6 -2
- package/map/client/components/legend/KLayerLegend.vue +13 -3
- package/map/client/components/legend/KLegend.vue +12 -10
- package/map/client/components/location/KLocationCardSection.vue +8 -4
- package/map/client/components/widget/KTimeSeries.vue +0 -6
- package/map/client/composables/catalog.js +17 -2
- package/map/client/composables/highlight.js +9 -30
- package/map/client/composables/probe.js +4 -1
- package/map/client/composables/weather.js +3 -3
- package/map/client/i18n/map_en.json +4 -0
- package/map/client/i18n/map_fr.json +4 -0
- package/map/client/leaflet/ShapeMarker.js +23 -12
- package/map/client/leaflet/TiledFeatureLayer.js +38 -8
- package/map/client/leaflet/TiledMeshLayer.js +3 -1
- package/map/client/leaflet/utils/utils.style.js +7 -3
- package/map/client/mixins/globe/mixin.base-globe.js +29 -16
- package/map/client/mixins/globe/mixin.geojson-layers.js +7 -0
- package/map/client/mixins/map/mixin.base-map.js +40 -17
- package/map/client/mixins/map/mixin.geojson-layers.js +7 -3
- package/map/client/mixins/mixin.activity.js +5 -1
- package/map/client/planets.js +8 -0
- package/map/client/utils/utils.catalog.js +17 -0
- package/map/client/utils/utils.layers.js +2 -1
- package/map/client/utils/utils.schema.js +0 -28
- package/map/client/utils/utils.style.js +12 -0
- package/map/common/wms-utils.js +8 -3
- package/package.json +1 -1
- package/test/client/core/layout.js +0 -1
- package/test/client/map/catalog.js +1 -1
- package/test/api/core/test-log-2023-12-19.log +0 -7
- package/test/api/core/test-log-2024-01-04.log +0 -14
- package/test/api/map/test-log-2023-11-24.log +0 -121
- package/test/api/map/test-log-2023-12-12.log +0 -29
- package/test/api/map/test-log-2023-12-13.log +0 -5
- package/test/api/map/test-log-2024-01-04.log +0 -2
- package/test/api/map/test-log-2024-01-11.log +0 -1
- package/test/api/map/test-log-2024-01-25.log +0 -19
package/core/api/application.js
CHANGED
|
@@ -174,7 +174,7 @@ async function createService (name, app, options = {}) {
|
|
|
174
174
|
paginate,
|
|
175
175
|
multi: true,
|
|
176
176
|
whitelist: [
|
|
177
|
-
'$exists', '$and', '$or', '$eq', '$elemMatch', '$distinct', '$groupBy', '$group', '$regex',
|
|
177
|
+
'$exists', '$and', '$or', '$not', '$eq', '$elemMatch', '$distinct', '$groupBy', '$group', '$regex',
|
|
178
178
|
'$text', '$search', '$caseSensitive', '$language', '$diacriticSensitive',
|
|
179
179
|
'$aggregate', '$near', '$nearSphere', '$geoIntersects', '$geoWithin',
|
|
180
180
|
'$maxDistance', '$minDistance', '$geometry', '$box', '$polygon', '$center', '$centerSphere'
|
|
@@ -287,14 +287,13 @@ export function createWebhook (path, app, options = {}) {
|
|
|
287
287
|
const payload = req.body
|
|
288
288
|
const config = app.get('authentication')
|
|
289
289
|
res.set('content-type', 'application/json')
|
|
290
|
-
const params = {}
|
|
290
|
+
const params = _.get(req, 'feathers', {})
|
|
291
291
|
try {
|
|
292
292
|
if (options.preprocessor) {
|
|
293
293
|
await options.preprocessor(req, res, payload)
|
|
294
294
|
}
|
|
295
295
|
// Authenticate when required
|
|
296
296
|
if (config) {
|
|
297
|
-
params.user = _.get(req, 'feathers.user')
|
|
298
297
|
params.checkAuthorisation = true
|
|
299
298
|
}
|
|
300
299
|
if (req.headers['content-type'] !== 'application/json') {
|
|
@@ -112,7 +112,7 @@ const xlMinWidths = { wide: 90, medium: 55, narrow: 25 }
|
|
|
112
112
|
const computedStyle = computed(() => {
|
|
113
113
|
// compute the modal max height
|
|
114
114
|
const screenHeight = $q.screen.height
|
|
115
|
-
const modalMaxHeight = props.maximized ? screenHeight : 0.
|
|
115
|
+
const modalMaxHeight = props.maximized ? screenHeight : 0.9 * screenHeight
|
|
116
116
|
// compute the scroll area max height
|
|
117
117
|
// take into account the header and footer height
|
|
118
118
|
let contentMaxHeight = modalMaxHeight - headerHeight.value
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
Grouped fields
|
|
24
24
|
-->
|
|
25
25
|
<template v-for="(group, id) in groups" :key="id">
|
|
26
|
-
<q-expansion-item icon="las la-file-alt" :group="id">
|
|
26
|
+
<q-expansion-item v-show="group.hasFields" icon="las la-file-alt" :group="id">
|
|
27
27
|
<template v-slot:header>
|
|
28
28
|
<!-- Label -->
|
|
29
29
|
<q-item-section>
|
|
@@ -105,7 +105,11 @@ let buildInProgress = false
|
|
|
105
105
|
|
|
106
106
|
// Computed
|
|
107
107
|
const groups = computed(() => {
|
|
108
|
-
if (schema.value && schema.value.groups)
|
|
108
|
+
if (schema.value && schema.value.groups) {
|
|
109
|
+
return _.mapValues(schema.value.groups, (group, id) => Object.assign({
|
|
110
|
+
hasFields: _.find(fields.value, { group: id })
|
|
111
|
+
}, group))
|
|
112
|
+
}
|
|
109
113
|
return {}
|
|
110
114
|
})
|
|
111
115
|
|
|
@@ -183,7 +187,12 @@ async function build () {
|
|
|
183
187
|
// clone and configure the field
|
|
184
188
|
const cloneField = _.clone(field)
|
|
185
189
|
cloneField.name = property // assign a name to allow binding between properties and fields
|
|
186
|
-
|
|
190
|
+
let component = _.get(field.field, 'component', '')
|
|
191
|
+
if (!component) {
|
|
192
|
+
// Provide a default component based on schema value type when none is specified
|
|
193
|
+
if (field.type === 'number' || field.type === 'integer') { component = 'form/KNumberField' } else if (field.type === 'boolean') { component = 'form/KToggleField' } else if (field.type === 'string') { component = 'form/KTextField' }
|
|
194
|
+
}
|
|
195
|
+
cloneField.component = loadComponent(component)
|
|
187
196
|
cloneField.reference = null // will be set once te field is rendered
|
|
188
197
|
cloneField.required = _.includes(schema.value.required, property) // add extra required info
|
|
189
198
|
// add the field to the list of fields to be rendered
|
package/core/client/exporter.js
CHANGED
|
@@ -26,9 +26,12 @@ const ExporterQueue = {
|
|
|
26
26
|
const request = this.pendingRequests.shift()
|
|
27
27
|
try {
|
|
28
28
|
// compute a filename
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
let filename = request.filename
|
|
30
|
+
if (!filename) {
|
|
31
|
+
const timestamp = moment().toISOString().replace(/:/g, '-')
|
|
32
|
+
filename = `${_.get(request, 'basename', request.service)}_${timestamp}.${request.format}`
|
|
33
|
+
if (_.get(request, 'gzip', true)) filename += '.gz'
|
|
34
|
+
}
|
|
32
35
|
// retrienve the target service path
|
|
33
36
|
const servicePath = api.getServicePath(request.service).substring(1)
|
|
34
37
|
// retrieve the transform assigned to the format
|
|
@@ -104,8 +107,10 @@ export const Exporter = {
|
|
|
104
107
|
message: i18n.t('exporter.MESSAGE'),
|
|
105
108
|
options: {
|
|
106
109
|
type: 'radio',
|
|
107
|
-
model: options.formats[0].
|
|
108
|
-
items: options.formats
|
|
110
|
+
model: options.formats[0].label,
|
|
111
|
+
items: options.formats.map(format => {
|
|
112
|
+
return { label: format.label, value: format.label }
|
|
113
|
+
})
|
|
109
114
|
},
|
|
110
115
|
cancel: {
|
|
111
116
|
id: 'cancel-button',
|
|
@@ -121,8 +126,9 @@ export const Exporter = {
|
|
|
121
126
|
persistent: true
|
|
122
127
|
}
|
|
123
128
|
Dialog.create(dialog)
|
|
124
|
-
.onOk((
|
|
125
|
-
|
|
129
|
+
.onOk((formatLabel) => {
|
|
130
|
+
const format = _.find(options.formats, { label: formatLabel })
|
|
131
|
+
if (!ExporterQueue.push(Object.assign(params, format))) {
|
|
126
132
|
Notify.create({
|
|
127
133
|
type: 'negative',
|
|
128
134
|
message: i18n.t('exporter.EXPORTS_LIMIT_REACHED')
|
|
@@ -130,7 +136,7 @@ export const Exporter = {
|
|
|
130
136
|
}
|
|
131
137
|
})
|
|
132
138
|
} else {
|
|
133
|
-
if (!ExporterQueue.push(Object.assign(params,
|
|
139
|
+
if (!ExporterQueue.push(Object.assign(params, options.formats[0]))) {
|
|
134
140
|
Notify.create({
|
|
135
141
|
type: 'negative',
|
|
136
142
|
message: i18n.t('exporter.EXPORTS_LIMIT_REACHED')
|
|
@@ -22,7 +22,10 @@ export const baseField = {
|
|
|
22
22
|
},
|
|
23
23
|
computed: {
|
|
24
24
|
label () {
|
|
25
|
-
|
|
25
|
+
// Make use of 'description' metadata if nothing else is provided
|
|
26
|
+
// cf. https://ajv.js.org/json-schema.html#metadata-keywords
|
|
27
|
+
const description = _.get(this.properties, 'description', '')
|
|
28
|
+
return this.$tie(_.get(this.properties.field, 'label', description))
|
|
26
29
|
},
|
|
27
30
|
hasHelper () {
|
|
28
31
|
return !_.isEmpty(_.get(this.properties.field, 'helper', {}))
|
package/core/client/units.js
CHANGED
|
@@ -289,7 +289,7 @@ export const Units = {
|
|
|
289
289
|
// Get unit symbol by unit name
|
|
290
290
|
getUnitSymbol (unit) {
|
|
291
291
|
const definition = this.getUnit(unit)
|
|
292
|
-
return (definition ? i18n.
|
|
292
|
+
return (definition ? i18n.tie(definition.symbol) : unit)
|
|
293
293
|
},
|
|
294
294
|
// Get default unit definition (if any) for a given quantity/unit name
|
|
295
295
|
getDefaultUnit (quantityOrUnit) {
|
|
@@ -319,7 +319,7 @@ export const Units = {
|
|
|
319
319
|
// If target unit is not specified will use default unit (if any) for source unit
|
|
320
320
|
convert (value, sourceUnit, targetUnit) {
|
|
321
321
|
if (_.isNil(value)) {
|
|
322
|
-
logger.warn(
|
|
322
|
+
logger.warn('[KDK] cannont convert an nil value')
|
|
323
323
|
return
|
|
324
324
|
}
|
|
325
325
|
if (value === Number.MIN_VALUE || value === Number.MAX_VALUE) return value
|
|
@@ -340,7 +340,7 @@ export const Units = {
|
|
|
340
340
|
// options are mathjs format options
|
|
341
341
|
format (value, sourceUnit, targetUnit, options) {
|
|
342
342
|
if (_.isNil(value)) {
|
|
343
|
-
logger.warn(
|
|
343
|
+
logger.warn('[KDK] cannot format a nil value')
|
|
344
344
|
return
|
|
345
345
|
}
|
|
346
346
|
// If target unit is not given use default one
|
|
@@ -113,7 +113,7 @@ function getSize (size) {
|
|
|
113
113
|
- join: String - the stroke linejoin - 'miter'
|
|
114
114
|
- dashArray: String - the stroke dasharray - 'none'
|
|
115
115
|
- dashOffset: Number - the stroke dashoffset - 0
|
|
116
|
-
- icon: Object specifying an icon overlay
|
|
116
|
+
- icon: Object specifying an icon overlay, can also be a custom L.Icon object instance
|
|
117
117
|
- classes: String - the icon class
|
|
118
118
|
- url: String - the icon url
|
|
119
119
|
- color: String - the icon color
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-25 -25 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 0–2 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2.5;">
|
|
6
|
+
<circle r="18"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 8–12 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 98–102 knots</desc>
|
|
5
|
+
<g style="fill:black; stroke:none; stroke-width:0;">
|
|
6
|
+
<path d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
7
|
+
<path d="M -34,1 L -34,0 L -29,-17.25 L -24,0 L -24,1"/>
|
|
8
|
+
</g>
|
|
9
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
10
|
+
<path d="M 0,0 h -40"/>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 102–107 knots</desc>
|
|
5
|
+
<g style="fill:black; stroke:none; stroke-width:0;">
|
|
6
|
+
<path d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
7
|
+
<path d="M -34,1 L -34,0 L -29,-17.25 L -24,0 L -24,1"/>
|
|
8
|
+
</g>
|
|
9
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
10
|
+
<path d="M 0,0 h -40"/>
|
|
11
|
+
<path d="M -20,0 l -2.5,-8.5"/>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 13–17 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -2.5,-8.5"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 18–22 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -5,-17"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 23–27 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -5,-17"/>
|
|
8
|
+
<path d="M -30,0 l -2.5,-8.5"/>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 28–32 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -5,-17"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 33–37 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -5,-17"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -2.5,-8.5"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 38–42 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -5,-17"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 43–47 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40 l -5,-17"/>
|
|
7
|
+
<path d="M -35,0 l -5,-17"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
<path d="M -20,0 l -2.5,-8.5"/>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 3–7 knots</desc>
|
|
5
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
6
|
+
<path d="M 0,0 h -40"/>
|
|
7
|
+
<path d="M -35,0 l -2.5,-8.5"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 63–67 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 53–57 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -2.5,-8.5"/>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 58–62 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 63–67 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -2.5,-8.5"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 68–72 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 73–77 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
<path d="M -20,0 l -2.5,-8.5"/>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 78–82 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
<path d="M -20,0 l -5,-17"/>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 83–87 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
<path d="M -20,0 l -5,-17"/>
|
|
11
|
+
<path d="M -15,0 l -2.5,-8.5"/>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 88–92 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
<path d="M -20,0 l -5,-17"/>
|
|
11
|
+
<path d="M -15,0 l -5,-17"/>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="-48 -33 50 50">
|
|
4
|
+
<desc id="en">Observed wind speed: 93–97 knots</desc>
|
|
5
|
+
<path style="fill:black; stroke:none; stroke-width:0;" d="M -44,1 L -44,0 L -39,-17.25 L -34,0 L -34,1"/>
|
|
6
|
+
<g style="fill:none; stroke:black; stroke-width:2;">
|
|
7
|
+
<path d="M 0,0 h -40"/>
|
|
8
|
+
<path d="M -30,0 l -5,-17"/>
|
|
9
|
+
<path d="M -25,0 l -5,-17"/>
|
|
10
|
+
<path d="M -20,0 l -5,-17"/>
|
|
11
|
+
<path d="M -15,0 l -5,-17"/>
|
|
12
|
+
<path d="M -10,0 l -2.5,-8.5"/>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -30,6 +30,17 @@ function getGeometryQueryForBBox (bbox) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
export function marshallGeoJsonQuery (hook) {
|
|
35
|
+
const query = hook.params.query
|
|
36
|
+
if (query) {
|
|
37
|
+
if (query.geoJson) {
|
|
38
|
+
delete query.geoJson
|
|
39
|
+
hook.params.asGeoJson = true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
export function marshallSpatialQuery (hook) {
|
|
34
45
|
const query = hook.params.query
|
|
35
46
|
if (query) {
|
|
@@ -116,11 +127,9 @@ export function marshallSpatialQuery (hook) {
|
|
|
116
127
|
}
|
|
117
128
|
query.geometry = geometryQuery
|
|
118
129
|
}
|
|
119
|
-
if (query.geoJson) {
|
|
120
|
-
delete query.geoJson
|
|
121
|
-
hook.params.asGeoJson = true
|
|
122
|
-
}
|
|
123
130
|
}
|
|
131
|
+
// Include GeoJson query by default
|
|
132
|
+
marshallGeoJsonQuery(hook)
|
|
124
133
|
}
|
|
125
134
|
|
|
126
135
|
export function asGeoJson (options = {}) {
|
|
@@ -139,6 +148,9 @@ export function asGeoJson (options = {}) {
|
|
|
139
148
|
const isPaginated = !_.isNil(results.data)
|
|
140
149
|
const pagination = (isPaginated ? _.pick(results, ['total', 'skip', 'limit']) : {})
|
|
141
150
|
results = (isPaginated ? results.data : results)
|
|
151
|
+
// Single item case, i.e. GET ?
|
|
152
|
+
const isFeatureCollection = Array.isArray(results)
|
|
153
|
+
if (!isFeatureCollection) results = [results]
|
|
142
154
|
results = results
|
|
143
155
|
.filter(item => {
|
|
144
156
|
// Check if item is not already in GeoJson feature format and we can convert if required
|
|
@@ -190,24 +202,35 @@ export function asGeoJson (options = {}) {
|
|
|
190
202
|
// Move some data to properties ?
|
|
191
203
|
if (options.properties) {
|
|
192
204
|
results.forEach(item => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
205
|
+
// True indicates to move all fields to properties
|
|
206
|
+
if (options.properties === true) {
|
|
207
|
+
_.forOwn(item, (value, key) => {
|
|
208
|
+
if ((key === 'geometry') || (key === 'type') || (key === '_id')) return
|
|
209
|
+
_.set(item, `properties.${key}`, _.get(item, key))
|
|
210
|
+
_.unset(item, key)
|
|
211
|
+
})
|
|
212
|
+
} else { // Else we expect a specific mapping
|
|
213
|
+
options.properties.forEach(mapping => {
|
|
214
|
+
if (mapping.from) _.set(item, `properties.${mapping.to || mapping.from}`, _.get(item, `${mapping.from}`))
|
|
215
|
+
if (mapping.delete) _.unset(item, `${mapping.from}`)
|
|
216
|
+
})
|
|
217
|
+
}
|
|
197
218
|
})
|
|
198
219
|
}
|
|
199
|
-
//
|
|
200
|
-
if (_.get(options, 'asFeatureCollection', true)) {
|
|
220
|
+
// If we should make it available as a GeoJson feature collection create it
|
|
221
|
+
if (isFeatureCollection && _.get(options, 'asFeatureCollection', true)) {
|
|
222
|
+
// Copy pagination information if any so that client can use it anyway
|
|
201
223
|
_.set(hook, options.dataPath || 'result', Object.assign({
|
|
202
224
|
type: 'FeatureCollection',
|
|
203
225
|
features: results
|
|
204
226
|
}, pagination)) // If no pagination this merged object will be empty
|
|
205
227
|
} else if (isPaginated) {
|
|
228
|
+
// Copy pagination information if any so that client can use it anyway
|
|
206
229
|
_.set(hook, options.dataPath || 'result', Object.assign({
|
|
207
230
|
data: results
|
|
208
231
|
}, pagination))
|
|
209
232
|
} else {
|
|
210
|
-
_.set(hook, options.dataPath || 'result', results)
|
|
233
|
+
_.set(hook, options.dataPath || 'result', isFeatureCollection ? results : results[0])
|
|
211
234
|
}
|
|
212
235
|
}
|
|
213
236
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { kml } from '@tmcw/togeojson'
|
|
2
|
+
import Cesium from 'cesium/Source/Cesium.js'
|
|
3
|
+
|
|
4
|
+
export async function convertEntitiesToGeoJson(entities) {
|
|
5
|
+
const kmlEntities = await Cesium.exportKml({ entities, modelCallback: () => '' })
|
|
6
|
+
const parser = new DOMParser()
|
|
7
|
+
return kml(parser.parseFromString(kmlEntities.kml, 'application/xml'))
|
|
8
|
+
}
|
|
@@ -3,7 +3,7 @@ import chroma from 'chroma-js'
|
|
|
3
3
|
import moment from 'moment'
|
|
4
4
|
import Cesium from 'cesium/Source/Cesium.js'
|
|
5
5
|
import { Time, Units } from '../../../../core/client/index.js'
|
|
6
|
-
import { convertPointStyleToSimpleStyle, convertLineStyleToSimpleStyle, convertPolygonStyleToSimpleStyle,
|
|
6
|
+
import { convertPointStyleToSimpleStyle, convertLineStyleToSimpleStyle, convertPolygonStyleToSimpleStyle, convertSimpleStyleColors,
|
|
7
7
|
convertSimpleStyleToPointStyle, convertSimpleStyleToLineStyle, convertSimpleStyleToPolygonStyle,
|
|
8
8
|
PointStyleTemplateMappings, LineStyleTemplateMappings, PolygonStyleTemplateMappings } from '../../utils/utils.style.js'
|
|
9
9
|
|
|
@@ -64,7 +64,7 @@ export function getPointSimpleStyle (feature, options, engine, engineStylePath =
|
|
|
64
64
|
const featureStyle = feature.style ? _.get(feature, 'style', {}) : convertSimpleStyleToPointStyle(feature.properties)
|
|
65
65
|
const style = _.merge({}, engineStyle, layerStyle, featureStyle)
|
|
66
66
|
processStyle({ style: { point: style } }, feature, options, PointStyleTemplateMappings)
|
|
67
|
-
return convertPointStyleToSimpleStyle(style)
|
|
67
|
+
return convertSimpleStyleColors(convertPointStyleToSimpleStyle(style))
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export function getLineSimpleStyle (feature, options, engine, engineStylePath = 'style.line') {
|
|
@@ -73,7 +73,7 @@ export function getLineSimpleStyle (feature, options, engine, engineStylePath =
|
|
|
73
73
|
const featureStyle = feature.style ? _.get(feature, 'style', {}) : convertSimpleStyleToLineStyle(feature.properties)
|
|
74
74
|
const style = _.merge({}, engineStyle, layerStyle, featureStyle)
|
|
75
75
|
processStyle({ style: { line: style } }, feature, options, LineStyleTemplateMappings)
|
|
76
|
-
return convertLineStyleToSimpleStyle(style)
|
|
76
|
+
return convertSimpleStyleColors(convertLineStyleToSimpleStyle(style))
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export function getPolygonSimpleStyle (feature, options, engine, engineStylePath = 'style.polygon') {
|
|
@@ -82,7 +82,7 @@ export function getPolygonSimpleStyle (feature, options, engine, engineStylePath
|
|
|
82
82
|
const featureStyle = feature.style ? _.get(feature, 'style', {}) : convertSimpleStyleToPolygonStyle(feature.properties)
|
|
83
83
|
const style = _.merge({}, engineStyle, layerStyle, featureStyle)
|
|
84
84
|
processStyle({ style: { polygon: style } }, feature, options, PolygonStyleTemplateMappings)
|
|
85
|
-
return convertPolygonStyleToSimpleStyle(style)
|
|
85
|
+
return convertSimpleStyleColors(convertPolygonStyleToSimpleStyle(style))
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export function convertToCesiumObjects (style) {
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
<script>
|
|
17
17
|
import _ from 'lodash'
|
|
18
18
|
import { mixins as kCoreMixins, composables as kCoreComposables } from '../../../core/client'
|
|
19
|
-
import { updatePropertiesSchema } from '../utils.js'
|
|
20
19
|
import { KModalEditor } from '../../../core/client/components'
|
|
21
20
|
|
|
22
21
|
export default {
|
|
@@ -66,8 +65,8 @@ export default {
|
|
|
66
65
|
await this.$api.getService(this.service).patch(updatedFeature._id, _.pick(updatedFeature, ['properties']))
|
|
67
66
|
}
|
|
68
67
|
},
|
|
69
|
-
|
|
70
|
-
return
|
|
68
|
+
loadLayerSchema () {
|
|
69
|
+
return _.get(this.layer, 'schema.content')
|
|
71
70
|
},
|
|
72
71
|
async openModal () {
|
|
73
72
|
kCoreMixins.baseModal.methods.openModal.call(this)
|