@@ -6,7 +6,10 @@ import Graduated from './types/Graduated';
6
6
import Heatmap from './types/Heatmap' ;
7
7
import SimpleSymbol from './types/SimpleSymbol' ;
8
8
import { useGetProperties } from '../hooks/useGetProperties' ;
9
- import { getColorCodeFeatureAttributes , getNumericFeatureAttributes } from '../../../tools' ;
9
+ import {
10
+ getColorCodeFeatureAttributes ,
11
+ getNumericFeatureAttributes
12
+ } from '../../../tools' ;
10
13
11
14
const VectorRendering = ( {
12
15
model,
@@ -43,15 +46,17 @@ const VectorRendering = ({
43
46
}
44
47
setSelectedRenderType ( renderType ) ;
45
48
46
- let vectorLayerOptions = [
47
- 'Single Symbol' ,
48
- 'Heatmap'
49
- ]
50
- if ( getColorCodeFeatureAttributes ( featureProperties ) ) {
51
- vectorLayerOptions . push ( 'Canonical' )
49
+ const vectorLayerOptions = [ 'Single Symbol' , 'Heatmap' ] ;
50
+
51
+ if (
52
+ Object . keys ( getColorCodeFeatureAttributes ( featureProperties ) ) . length > 0
53
+ ) {
54
+ vectorLayerOptions . push ( 'Canonical' ) ;
52
55
}
53
- if ( getNumericFeatureAttributes ( featureProperties ) ) {
54
- vectorLayerOptions . push ( 'Graduated' , 'Categorized' )
56
+ if (
57
+ Object . keys ( getNumericFeatureAttributes ( featureProperties ) ) . length > 0
58
+ ) {
59
+ vectorLayerOptions . push ( 'Graduated' , 'Categorized' ) ;
55
60
}
56
61
57
62
const options : Record < string , string [ ] > = {
@@ -60,7 +65,7 @@ const VectorRendering = ({
60
65
HeatmapLayer : [ 'Single Symbol' , 'Graduated' , 'Categorized' , 'Heatmap' ]
61
66
} ;
62
67
setRenderTypeOptions ( options [ layer . type ] ) ;
63
- } , [ ] ) ;
68
+ } , [ featureProperties ] ) ;
64
69
65
70
useEffect ( ( ) => {
66
71
switch ( selectedRenderType ) {
0 commit comments