|
127 | 127 | },
|
128 | 128 | 'china-incrementConfirmed': {
|
129 | 129 | tooltip: function(properties) {
|
| 130 | + if (isNaN(properties['confirmedAdd'])) { |
| 131 | + return resources.text_ncp_nodata_tooltip.replace('{name}', properties['省份']); |
| 132 | + } |
130 | 133 | return resources.text_ncp_incrementConfirmed_tooltip
|
131 | 134 | .replace('{name}', properties['省份'])
|
132 | 135 | .replace('{confirmedAdd}', properties['confirmedAdd']);
|
133 | 136 | },
|
134 | 137 | title: resources.text_ncp_incrementConfirmed_title,
|
135 | 138 | 'fill-color': [
|
136 | 139 | 'case',
|
137 |
| - ['>=', ['get', 'confirmedAdd'], 200], |
138 |
| - '#d7301f', |
139 |
| - ['>=', ['get', 'confirmedAdd'], 100], |
140 |
| - '#ef6548', |
141 |
| - ['>=', ['get', 'confirmedAdd'], 50], |
142 |
| - '#fc8d59', |
143 |
| - ['>=', ['get', 'confirmedAdd'], 10], |
144 |
| - '#fdbb84', |
145 |
| - ['>=', ['get', 'confirmedAdd'], 1], |
146 |
| - '#fdd49e', |
147 |
| - '#F4F4F4' |
| 140 | + ['has', 'confirmedAdd'], |
| 141 | + [ |
| 142 | + 'case', |
| 143 | + ['>=', ['get', 'confirmedAdd'], 200], |
| 144 | + '#d7301f', |
| 145 | + ['>=', ['get', 'confirmedAdd'], 100], |
| 146 | + '#ef6548', |
| 147 | + ['>=', ['get', 'confirmedAdd'], 50], |
| 148 | + '#fc8d59', |
| 149 | + ['>=', ['get', 'confirmedAdd'], 10], |
| 150 | + '#fdbb84', |
| 151 | + ['>=', ['get', 'confirmedAdd'], 1], |
| 152 | + '#fdd49e', |
| 153 | + '#F4F4F4' |
| 154 | + ], |
| 155 | + '#D9D9D9' |
148 | 156 | ],
|
149 | 157 | 'text-field': [
|
150 | 158 | 'concat',
|
|
155 | 163 | },
|
156 | 164 | 'china-nowConfirmed': {
|
157 | 165 | tooltip: function(properties) {
|
| 166 | + if (isNaN(properties['nowConfirmed'])) { |
| 167 | + return resources.text_ncp_nodata_tooltip.replace('{name}', properties['省份']); |
| 168 | + } |
158 | 169 | return resources.text_ncp_nowConfirmed_tooltip
|
159 | 170 | .replace('{name}', properties['省份'])
|
160 | 171 | .replace('{nowConfirmed}', properties['nowConfirmed']);
|
161 | 172 | },
|
162 | 173 | title: resources.text_ncp_nowConfirmed_title,
|
163 | 174 | 'fill-color': [
|
164 | 175 | 'case',
|
165 |
| - ['>=', ['get', 'nowConfirmed'], 200], |
166 |
| - '#d7301f', |
167 |
| - ['>=', ['get', 'nowConfirmed'], 100], |
168 |
| - '#ef6548', |
169 |
| - ['>=', ['get', 'nowConfirmed'], 50], |
170 |
| - '#fc8d59', |
171 |
| - ['>=', ['get', 'nowConfirmed'], 10], |
172 |
| - '#fdbb84', |
173 |
| - ['>=', ['get', 'nowConfirmed'], 1], |
174 |
| - '#fdd49e', |
175 |
| - '#F4F4F4' |
| 176 | + ['has', 'nowConfirmed'], |
| 177 | + [ |
| 178 | + 'case', |
| 179 | + ['>=', ['get', 'nowConfirmed'], 200], |
| 180 | + '#d7301f', |
| 181 | + ['>=', ['get', 'nowConfirmed'], 100], |
| 182 | + '#ef6548', |
| 183 | + ['>=', ['get', 'nowConfirmed'], 50], |
| 184 | + '#fc8d59', |
| 185 | + ['>=', ['get', 'nowConfirmed'], 10], |
| 186 | + '#fdbb84', |
| 187 | + ['>=', ['get', 'nowConfirmed'], 1], |
| 188 | + '#fdd49e', |
| 189 | + '#F4F4F4' |
| 190 | + ], |
| 191 | + '#D9D9D9' |
176 | 192 | ],
|
177 | 193 | 'text-field': ['get', '省份'],
|
178 | 194 | 'line-color': '#83838D'
|
|
0 commit comments