geonetwork-ui 2.11.0-dev.1cf4ab0c6 → 2.11.0-dev.448254758
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/fesm2022/geonetwork-ui.mjs +1138 -1249
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +79 -67
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +40 -9
- package/src/libs/common/domain/src/lib/model/search/filter.model.ts +8 -1
- package/src/libs/feature/map/src/index.ts +0 -2
- package/src/libs/feature/map/src/lib/feature-map.module.ts +1 -8
- package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.ts +8 -3
- package/src/libs/feature/search/src/index.ts +2 -0
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +8 -3
- package/src/libs/feature/{map/src/lib → search/src/lib/geocoding}/geocoding.service.ts +16 -7
- package/src/libs/feature/search/src/lib/location-search/location-search.component.html +8 -0
- package/src/libs/feature/search/src/lib/location-search/location-search.component.ts +40 -0
- package/src/libs/feature/search/src/lib/state/reducer.ts +1 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +25 -7
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +10 -1
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +8 -0
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +7 -4
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +12 -9
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.model.ts +2 -2
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html +2 -2
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts +8 -2
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +1 -0
- package/src/libs/util/app-config/src/lib/app-config.ts +20 -0
- package/src/libs/util/app-config/src/lib/fixtures.ts +16 -1
- package/src/libs/util/app-config/src/lib/model.ts +14 -1
- package/src/libs/util/shared/src/lib/utils/geojson.ts +16 -0
- package/translations/de.json +2 -2
- package/translations/en.json +4 -4
- package/translations/es.json +2 -2
- package/translations/fr.json +5 -5
- package/translations/it.json +2 -2
- package/translations/nl.json +2 -2
- package/translations/pt.json +2 -2
- package/translations/sk.json +2 -2
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.css +0 -0
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +0 -41
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +0 -112
- package/src/libs/feature/map/src/lib/style/index.ts +0 -2
- package/src/libs/feature/map/src/lib/style/map-style.fixtures.ts +0 -47
- package/src/libs/feature/map/src/lib/style/map-style.service.ts +0 -108
package/translations/it.json
CHANGED
|
@@ -425,7 +425,6 @@
|
|
|
425
425
|
"map.add.layer.wms": "Da un WMS",
|
|
426
426
|
"map.addFromFile.placeholder": "Clicca o trascina un file qui",
|
|
427
427
|
"map.dropdown.placeholder": "Nessun livello di anteprima disponibile",
|
|
428
|
-
"map.geocoding.placeholder": "Cerca un luogo",
|
|
429
428
|
"map.help.addFromFile": "Clicca o trascina un file per aggiungerlo alla mappa (attualmente supporta solo il formato GeoJSON)",
|
|
430
429
|
"map.layer.add": "Aggiungi",
|
|
431
430
|
"map.layers.available": "Layer disponibili",
|
|
@@ -692,7 +691,6 @@
|
|
|
692
691
|
"search.filters.representationType": "Tipo di rappresentazione",
|
|
693
692
|
"search.filters.resourceCreationRevisionDate": "Data della risorsa",
|
|
694
693
|
"search.filters.resourceType": "Tipo di risorsa",
|
|
695
|
-
"search.filters.spatialExtent": "",
|
|
696
694
|
"search.filters.spatialExtent.bboxFromFile": "",
|
|
697
695
|
"search.filters.spatialExtent.bboxFromFileDelete": "",
|
|
698
696
|
"search.filters.spatialExtent.bboxInitial": "",
|
|
@@ -700,7 +698,9 @@
|
|
|
700
698
|
"search.filters.spatialExtent.error.fileTooLarge": "",
|
|
701
699
|
"search.filters.spatialExtent.error.invalidFormat": "",
|
|
702
700
|
"search.filters.spatialExtent.error.noGeometry": "",
|
|
701
|
+
"search.filters.spatialExtent.error.outOfBounds": "",
|
|
703
702
|
"search.filters.spatialExtent.error.title": "",
|
|
703
|
+
"search.filters.spatialExtent": "",
|
|
704
704
|
"search.filters.spatialExtent.helpText": "",
|
|
705
705
|
"search.filters.spatialExtent.import": "",
|
|
706
706
|
"search.filters.standard": "Standard",
|
package/translations/nl.json
CHANGED
|
@@ -425,7 +425,6 @@
|
|
|
425
425
|
"map.add.layer.wms": "",
|
|
426
426
|
"map.addFromFile.placeholder": "",
|
|
427
427
|
"map.dropdown.placeholder": "",
|
|
428
|
-
"map.geocoding.placeholder": "",
|
|
429
428
|
"map.help.addFromFile": "",
|
|
430
429
|
"map.layer.add": "",
|
|
431
430
|
"map.layers.available": "",
|
|
@@ -692,7 +691,6 @@
|
|
|
692
691
|
"search.filters.representationType": "",
|
|
693
692
|
"search.filters.resourceCreationRevisionDate": "",
|
|
694
693
|
"search.filters.resourceType": "",
|
|
695
|
-
"search.filters.spatialExtent": "",
|
|
696
694
|
"search.filters.spatialExtent.bboxFromFile": "",
|
|
697
695
|
"search.filters.spatialExtent.bboxFromFileDelete": "",
|
|
698
696
|
"search.filters.spatialExtent.bboxInitial": "",
|
|
@@ -700,7 +698,9 @@
|
|
|
700
698
|
"search.filters.spatialExtent.error.fileTooLarge": "",
|
|
701
699
|
"search.filters.spatialExtent.error.invalidFormat": "",
|
|
702
700
|
"search.filters.spatialExtent.error.noGeometry": "",
|
|
701
|
+
"search.filters.spatialExtent.error.outOfBounds": "",
|
|
703
702
|
"search.filters.spatialExtent.error.title": "",
|
|
703
|
+
"search.filters.spatialExtent": "",
|
|
704
704
|
"search.filters.spatialExtent.helpText": "",
|
|
705
705
|
"search.filters.spatialExtent.import": "",
|
|
706
706
|
"search.filters.standard": "",
|
package/translations/pt.json
CHANGED
|
@@ -425,7 +425,6 @@
|
|
|
425
425
|
"map.add.layer.wms": "",
|
|
426
426
|
"map.addFromFile.placeholder": "",
|
|
427
427
|
"map.dropdown.placeholder": "",
|
|
428
|
-
"map.geocoding.placeholder": "",
|
|
429
428
|
"map.help.addFromFile": "",
|
|
430
429
|
"map.layer.add": "",
|
|
431
430
|
"map.layers.available": "",
|
|
@@ -692,7 +691,6 @@
|
|
|
692
691
|
"search.filters.representationType": "",
|
|
693
692
|
"search.filters.resourceCreationRevisionDate": "",
|
|
694
693
|
"search.filters.resourceType": "",
|
|
695
|
-
"search.filters.spatialExtent": "",
|
|
696
694
|
"search.filters.spatialExtent.bboxFromFile": "",
|
|
697
695
|
"search.filters.spatialExtent.bboxFromFileDelete": "",
|
|
698
696
|
"search.filters.spatialExtent.bboxInitial": "",
|
|
@@ -700,7 +698,9 @@
|
|
|
700
698
|
"search.filters.spatialExtent.error.fileTooLarge": "",
|
|
701
699
|
"search.filters.spatialExtent.error.invalidFormat": "",
|
|
702
700
|
"search.filters.spatialExtent.error.noGeometry": "",
|
|
701
|
+
"search.filters.spatialExtent.error.outOfBounds": "",
|
|
703
702
|
"search.filters.spatialExtent.error.title": "",
|
|
703
|
+
"search.filters.spatialExtent": "",
|
|
704
704
|
"search.filters.spatialExtent.helpText": "",
|
|
705
705
|
"search.filters.spatialExtent.import": "",
|
|
706
706
|
"search.filters.standard": "",
|
package/translations/sk.json
CHANGED
|
@@ -425,7 +425,6 @@
|
|
|
425
425
|
"map.add.layer.wms": "Z WMS",
|
|
426
426
|
"map.addFromFile.placeholder": "Kliknite na tlačidlo alebo sem vložte súbor",
|
|
427
427
|
"map.dropdown.placeholder": "",
|
|
428
|
-
"map.geocoding.placeholder": "Nájsť miesto",
|
|
429
428
|
"map.help.addFromFile": "Kliknite na tlačidlo alebo sem vložte súbor, ktorý chcete pridať do mapy (v súčasnosti podporuje iba formát GeoJSON).",
|
|
430
429
|
"map.layer.add": "Pridať",
|
|
431
430
|
"map.layers.available": "Dostupné vrsty",
|
|
@@ -692,7 +691,6 @@
|
|
|
692
691
|
"search.filters.representationType": "Typ reprezentácie",
|
|
693
692
|
"search.filters.resourceCreationRevisionDate": "",
|
|
694
693
|
"search.filters.resourceType": "Typ zdroja",
|
|
695
|
-
"search.filters.spatialExtent": "",
|
|
696
694
|
"search.filters.spatialExtent.bboxFromFile": "",
|
|
697
695
|
"search.filters.spatialExtent.bboxFromFileDelete": "",
|
|
698
696
|
"search.filters.spatialExtent.bboxInitial": "",
|
|
@@ -700,7 +698,9 @@
|
|
|
700
698
|
"search.filters.spatialExtent.error.fileTooLarge": "",
|
|
701
699
|
"search.filters.spatialExtent.error.invalidFormat": "",
|
|
702
700
|
"search.filters.spatialExtent.error.noGeometry": "",
|
|
701
|
+
"search.filters.spatialExtent.error.outOfBounds": "",
|
|
703
702
|
"search.filters.spatialExtent.error.title": "",
|
|
703
|
+
"search.filters.spatialExtent": "",
|
|
704
704
|
"search.filters.spatialExtent.helpText": "",
|
|
705
705
|
"search.filters.spatialExtent.import": "",
|
|
706
706
|
"search.filters.standard": "Štandard",
|
|
File without changes
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<gn-ui-search-input
|
|
2
|
-
[(value)]="searchText"
|
|
3
|
-
(valueChange)="onSearchChange($event)"
|
|
4
|
-
(keyup.enter)="onEnterPress()"
|
|
5
|
-
[placeholder]="'map.geocoding.placeholder' | translate"
|
|
6
|
-
>
|
|
7
|
-
</gn-ui-search-input>
|
|
8
|
-
@if (results && results.length) {
|
|
9
|
-
<ul
|
|
10
|
-
class="bg-gray-50 border border-gray-200 w-full mt-2 shadow-sm rounded-lg"
|
|
11
|
-
>
|
|
12
|
-
@for (result of results; track result) {
|
|
13
|
-
<li
|
|
14
|
-
(click)="zoomToLocation(result)"
|
|
15
|
-
class="flex items-center pl-8 pr-4 py-2 border-b border-gray-200 relative cursor-pointer hover:bg-blue-100 hover:text-gray-800 transition duration-300 ease-in-out"
|
|
16
|
-
>
|
|
17
|
-
<svg
|
|
18
|
-
class="stroke-current text-blue-500 absolute w-5 h-5 left-3 top-3"
|
|
19
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
-
fill="none"
|
|
21
|
-
viewBox="0 0 24 24"
|
|
22
|
-
stroke="currentColor"
|
|
23
|
-
>
|
|
24
|
-
<path
|
|
25
|
-
stroke-linecap="round"
|
|
26
|
-
stroke-linejoin="round"
|
|
27
|
-
stroke-width="2"
|
|
28
|
-
d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
|
|
29
|
-
/>
|
|
30
|
-
<path
|
|
31
|
-
stroke-linecap="round"
|
|
32
|
-
stroke-linejoin="round"
|
|
33
|
-
stroke-width="2"
|
|
34
|
-
d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"
|
|
35
|
-
/>
|
|
36
|
-
</svg>
|
|
37
|
-
<span class="font-sans font-semibold ml-4">{{ result.label }}</span>
|
|
38
|
-
</li>
|
|
39
|
-
}
|
|
40
|
-
</ul>
|
|
41
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { Component, OnDestroy, inject } from '@angular/core'
|
|
2
|
-
import { catchError, firstValueFrom, from, Subject, takeUntil } from 'rxjs'
|
|
3
|
-
import { debounceTime, switchMap } from 'rxjs/operators'
|
|
4
|
-
import { GeocodingService } from '../geocoding.service'
|
|
5
|
-
import { MapFacade } from '../+state/map.facade'
|
|
6
|
-
|
|
7
|
-
import { SearchInputComponent } from '../../../../../../libs/ui/inputs/src'
|
|
8
|
-
import { TranslatePipe } from '@ngx-translate/core'
|
|
9
|
-
import { MapContextView } from '@geospatial-sdk/core'
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'gn-ui-geocoding',
|
|
13
|
-
templateUrl: './geocoding.component.html',
|
|
14
|
-
styleUrls: ['./geocoding.component.css'],
|
|
15
|
-
standalone: true,
|
|
16
|
-
imports: [SearchInputComponent, TranslatePipe],
|
|
17
|
-
})
|
|
18
|
-
export class GeocodingComponent implements OnDestroy {
|
|
19
|
-
private mapFacade = inject(MapFacade)
|
|
20
|
-
private geocodingService = inject(GeocodingService)
|
|
21
|
-
|
|
22
|
-
searchText = ''
|
|
23
|
-
results: any[] = []
|
|
24
|
-
searchTextChanged = new Subject<string>()
|
|
25
|
-
destroy$ = new Subject<void>()
|
|
26
|
-
errorMessage: string | null = null
|
|
27
|
-
|
|
28
|
-
constructor() {
|
|
29
|
-
this.searchTextChanged
|
|
30
|
-
.pipe(
|
|
31
|
-
debounceTime(300),
|
|
32
|
-
switchMap((searchText) => {
|
|
33
|
-
return from(this.geocodingService.query(searchText)).pipe(
|
|
34
|
-
catchError((error) => {
|
|
35
|
-
this.errorMessage =
|
|
36
|
-
'An error occurred while searching. Please try again.'
|
|
37
|
-
console.error(error)
|
|
38
|
-
return []
|
|
39
|
-
})
|
|
40
|
-
)
|
|
41
|
-
}),
|
|
42
|
-
takeUntil(this.destroy$)
|
|
43
|
-
)
|
|
44
|
-
.subscribe((results) => {
|
|
45
|
-
this.results = results
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
ngOnDestroy() {
|
|
50
|
-
this.destroy$.next()
|
|
51
|
-
this.destroy$.complete()
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
onSearchChange(searchText: string) {
|
|
55
|
-
if (!searchText) {
|
|
56
|
-
this.clearSearch()
|
|
57
|
-
return
|
|
58
|
-
} else {
|
|
59
|
-
this.searchTextChanged.next(searchText)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
clearSearch() {
|
|
64
|
-
this.searchText = ''
|
|
65
|
-
this.results = []
|
|
66
|
-
this.errorMessage = null
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async zoomToLocation(result: any) {
|
|
70
|
-
const geometry = result.geom
|
|
71
|
-
|
|
72
|
-
if (geometry.type === 'Point') {
|
|
73
|
-
await this.zoomToPoint(geometry.coordinates)
|
|
74
|
-
} else if (geometry.type === 'Polygon') {
|
|
75
|
-
await this.zoomToPolygon(geometry.coordinates)
|
|
76
|
-
} else {
|
|
77
|
-
console.error(`Unsupported geometry type: ${geometry.type}`)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async zoomToPoint(pointCoords: [number, number]) {
|
|
82
|
-
const context = await firstValueFrom(this.mapFacade.context$)
|
|
83
|
-
const view: MapContextView = {
|
|
84
|
-
center: pointCoords,
|
|
85
|
-
zoom: 10,
|
|
86
|
-
}
|
|
87
|
-
this.mapFacade.applyContext({
|
|
88
|
-
...context,
|
|
89
|
-
view,
|
|
90
|
-
})
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async zoomToPolygon(polygonCoords: [[number, number][]]) {
|
|
94
|
-
const context = await firstValueFrom(this.mapFacade.context$)
|
|
95
|
-
const view: MapContextView = {
|
|
96
|
-
geometry: {
|
|
97
|
-
type: 'Polygon',
|
|
98
|
-
coordinates: polygonCoords,
|
|
99
|
-
},
|
|
100
|
-
}
|
|
101
|
-
this.mapFacade.applyContext({
|
|
102
|
-
...context,
|
|
103
|
-
view,
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
onEnterPress() {
|
|
108
|
-
if (this.results && this.results.length > 0) {
|
|
109
|
-
this.zoomToLocation(this.results[0])
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Circle, Fill, Stroke, Style } from 'ol/style.js'
|
|
2
|
-
|
|
3
|
-
const colorPrimary = 'blue'
|
|
4
|
-
const colorSecondary = 'red'
|
|
5
|
-
const colorStroke = 'white'
|
|
6
|
-
|
|
7
|
-
export const defaultMapStyleFixture = (): Style =>
|
|
8
|
-
new Style({
|
|
9
|
-
image: new Circle({
|
|
10
|
-
fill: new Fill({
|
|
11
|
-
color: colorPrimary,
|
|
12
|
-
}),
|
|
13
|
-
stroke: new Stroke({
|
|
14
|
-
color: colorStroke,
|
|
15
|
-
width: 2,
|
|
16
|
-
}),
|
|
17
|
-
radius: 5,
|
|
18
|
-
}),
|
|
19
|
-
fill: new Fill({
|
|
20
|
-
color: 'rgba(0,0,255,0.25)',
|
|
21
|
-
}),
|
|
22
|
-
stroke: new Stroke({
|
|
23
|
-
color: colorStroke,
|
|
24
|
-
width: 2,
|
|
25
|
-
}),
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
export const defaultMapStyleHlFixture = (): Style =>
|
|
29
|
-
new Style({
|
|
30
|
-
image: new Circle({
|
|
31
|
-
fill: new Fill({
|
|
32
|
-
color: colorSecondary,
|
|
33
|
-
}),
|
|
34
|
-
stroke: new Stroke({
|
|
35
|
-
color: colorStroke,
|
|
36
|
-
width: 3,
|
|
37
|
-
}),
|
|
38
|
-
radius: 6,
|
|
39
|
-
}),
|
|
40
|
-
fill: new Fill({
|
|
41
|
-
color: 'rgba(255,0,0,0.25)',
|
|
42
|
-
}),
|
|
43
|
-
stroke: new Stroke({
|
|
44
|
-
color: colorSecondary,
|
|
45
|
-
width: 3,
|
|
46
|
-
}),
|
|
47
|
-
})
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core'
|
|
2
|
-
import { getThemeConfig, isConfigLoaded } from '../../../../../../libs/util/app-config/src'
|
|
3
|
-
import chroma from 'chroma-js'
|
|
4
|
-
import Feature from 'ol/Feature.js'
|
|
5
|
-
import { Fill, Stroke, Style } from 'ol/style.js'
|
|
6
|
-
import CircleStyle from 'ol/style/Circle.js'
|
|
7
|
-
import { StyleLike } from 'ol/style/Style.js'
|
|
8
|
-
|
|
9
|
-
export interface CreateStyleOptions {
|
|
10
|
-
color: string
|
|
11
|
-
isFocused?: boolean
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type StyleByGeometryType = {
|
|
15
|
-
line: Style | Style[]
|
|
16
|
-
polygon: Style | Style[]
|
|
17
|
-
point: Style | Style[]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@Injectable({
|
|
21
|
-
providedIn: 'root',
|
|
22
|
-
})
|
|
23
|
-
export class MapStyleService {
|
|
24
|
-
styles = {
|
|
25
|
-
default: this.createStyleFunction(
|
|
26
|
-
this.createGeometryStyles({
|
|
27
|
-
color: isConfigLoaded() ? getThemeConfig().PRIMARY_COLOR : 'blue',
|
|
28
|
-
})
|
|
29
|
-
),
|
|
30
|
-
defaultHL: this.createStyleFunction(
|
|
31
|
-
this.createGeometryStyles({
|
|
32
|
-
color: isConfigLoaded() ? getThemeConfig().SECONDARY_COLOR : 'red',
|
|
33
|
-
isFocused: true,
|
|
34
|
-
})
|
|
35
|
-
),
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
createGeometryStyles(options: CreateStyleOptions): StyleByGeometryType {
|
|
39
|
-
const { color, isFocused } = options
|
|
40
|
-
const zIndex = isFocused ? 10 : undefined
|
|
41
|
-
return {
|
|
42
|
-
polygon: new Style({
|
|
43
|
-
fill: new Fill({
|
|
44
|
-
color: this.computeTransparentFillColor(color),
|
|
45
|
-
}),
|
|
46
|
-
stroke: new Stroke({
|
|
47
|
-
color: 'white',
|
|
48
|
-
width: 2,
|
|
49
|
-
}),
|
|
50
|
-
zIndex,
|
|
51
|
-
}),
|
|
52
|
-
point: new Style({
|
|
53
|
-
image: new CircleStyle({
|
|
54
|
-
fill: new Fill({
|
|
55
|
-
color,
|
|
56
|
-
}),
|
|
57
|
-
stroke: new Stroke({
|
|
58
|
-
color: 'white',
|
|
59
|
-
width: isFocused ? 3 : 2,
|
|
60
|
-
}),
|
|
61
|
-
radius: isFocused ? 8 : 7,
|
|
62
|
-
}),
|
|
63
|
-
zIndex,
|
|
64
|
-
}),
|
|
65
|
-
line: [
|
|
66
|
-
new Style({
|
|
67
|
-
stroke: new Stroke({
|
|
68
|
-
color: 'white',
|
|
69
|
-
width: isFocused ? 8 : 6,
|
|
70
|
-
}),
|
|
71
|
-
zIndex,
|
|
72
|
-
}),
|
|
73
|
-
new Style({
|
|
74
|
-
stroke: new Stroke({
|
|
75
|
-
color,
|
|
76
|
-
width: isFocused ? 3 : 2,
|
|
77
|
-
}),
|
|
78
|
-
zIndex,
|
|
79
|
-
}),
|
|
80
|
-
],
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
createStyleFunction(styleByGeometryType: StyleByGeometryType): StyleLike {
|
|
85
|
-
return (feature: Feature): Style | Style[] => {
|
|
86
|
-
const geometryType = feature?.getGeometry()?.getType()
|
|
87
|
-
switch (geometryType) {
|
|
88
|
-
case 'LinearRing':
|
|
89
|
-
case 'LineString':
|
|
90
|
-
case 'MultiLineString':
|
|
91
|
-
return styleByGeometryType.line
|
|
92
|
-
case 'Point':
|
|
93
|
-
case 'MultiPoint':
|
|
94
|
-
return styleByGeometryType.point
|
|
95
|
-
case 'Circle':
|
|
96
|
-
case 'Polygon':
|
|
97
|
-
case 'MultiPolygon':
|
|
98
|
-
return styleByGeometryType.polygon
|
|
99
|
-
default:
|
|
100
|
-
return styleByGeometryType.point
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
private computeTransparentFillColor(color: string, alpha = 0.25): string {
|
|
106
|
-
return chroma(color).alpha(alpha).css()
|
|
107
|
-
}
|
|
108
|
-
}
|