File tree 4 files changed +12
-12
lines changed
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ export const StylingDrawer: React.FC<StylingDrawerProps> = ({
46
46
} = useTranslation ( ) ;
47
47
48
48
useEffect ( ( ) => {
49
-
50
49
if ( ! layerUid ) {
51
50
setIsImageLayer ( false ) ;
52
51
}
Original file line number Diff line number Diff line change @@ -103,7 +103,6 @@ export const LayerTreeContextMenu: React.FC<LayerTreeContextMenuProps> = ({
103
103
t
104
104
} = useTranslation ( ) ;
105
105
106
- const drawerVisibilty = useAppSelector ( state => state . stylingDrawerVisibility ) ;
107
106
const downloadConfig : DownloadConfig [ ] = layer . get ( 'downloadConfig' ) ?? null ;
108
107
const allowedEditMode = useAppSelector (
109
108
state => state . editFeature . userEditMode
@@ -257,8 +256,10 @@ export const LayerTreeContextMenu: React.FC<LayerTreeContextMenuProps> = ({
257
256
} ;
258
257
259
258
const configureStyles = ( ) => {
260
- dispatch ( setStylingDrawerVisibility ( true ) ) ;
261
- dispatch ( setStylingDrawerLayerUid ( getUid ( layer ) ) ) ;
259
+ if ( layer ) {
260
+ dispatch ( setStylingDrawerVisibility ( true ) ) ;
261
+ dispatch ( setStylingDrawerLayerUid ( getUid ( layer ) ) ) ;
262
+ }
262
263
} ;
263
264
264
265
const dropdownMenuItems : ItemType [ ] = [ ] ;
@@ -324,7 +325,7 @@ export const LayerTreeContextMenu: React.FC<LayerTreeContextMenuProps> = ({
324
325
}
325
326
if ( isGeoserverLayer ) {
326
327
dropdownMenuItems . push ( {
327
- label : 'Geostyler' ,
328
+ label : t ( 'LayerTreeContextMenu.styleLayer' ) ,
328
329
key : 'geostyler'
329
330
} ) ;
330
331
}
Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ export default {
90
90
hideLegend : 'Legende ausblenden' ,
91
91
downloadLayer : 'Layer exportieren ({{formatName}})' ,
92
92
editLayer : 'Layer bearbeiten' ,
93
- layerDetails : 'Eigenschaften'
93
+ layerDetails : 'Eigenschaften' ,
94
+ styleLayer : 'Layer Stil'
94
95
} ,
95
96
LayerDetailsModal : {
96
97
title : 'Eigenschaften des Layers {{layerName}}' ,
@@ -386,7 +387,8 @@ export default {
386
387
hideLegend : 'Hide legend' ,
387
388
downloadLayer : 'Export layer as {{formatName}}' ,
388
389
editLayer : 'Edit layer' ,
389
- layerDetails : 'Properties'
390
+ layerDetails : 'Properties' ,
391
+ styleLayer : 'Layer style'
390
392
} ,
391
393
LayerDetailsModal : {
392
394
title : 'Properties of layer {{layerName}}' ,
Original file line number Diff line number Diff line change @@ -104,15 +104,13 @@ export const fetchGeoserverStyle = async (
104
104
}
105
105
} ;
106
106
107
- export const getLayerUrl = ( layerSource : Source | undefined ) : string | false => {
108
- if ( ! layerSource ) {
109
- return false ;
110
- }
107
+ export const getLayerUrl = ( layerSource : Source | undefined ) : string | undefined => {
108
+
111
109
let url : string | undefined ;
112
110
if ( layerSource instanceof TileWMS || layerSource instanceof ImageWMS ) {
113
111
url = layerSource instanceof TileWMS ? layerSource . getUrls ( ) ?. [ 0 ] : layerSource . getUrl ( ) ;
114
112
}
115
- return url || false ;
113
+ return url || undefined ;
116
114
} ;
117
115
118
116
export const checkIfGeoserverLayer = ( layerSource : Source | undefined ) : boolean => {
You can’t perform that action at this time.
0 commit comments