Skip to content

Commit 7f068cb

Browse files
committed
Move LegendError to method
1 parent a3941ef commit 7f068cb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

mapboxgl/viz.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ def __init__(self,
207207
self.legend_function = legend_function
208208
self.legend_style = legend_style
209209
self.legend_gradient = legend_gradient
210-
211-
if all([self.legend, self.legend_gradient, self.legend_function == 'radius']):
212-
raise LegendError(' '.join(['Gradient legend format not compatible with a variable radius legend.',
213-
'Please either change `legend_gradient` to `False` or `legend_function` to `color`.']))
214-
215210
self.legend_fill = legend_fill
216211
self.legend_header_fill = legend_header_fill
217212
self.legend_text_color = legend_text_color
@@ -271,6 +266,11 @@ def create_html(self, filename=None):
271266
)
272267

273268
if self.legend:
269+
270+
if all([self.legend, self.legend_gradient, self.legend_function == 'radius']):
271+
raise LegendError(' '.join(['Gradient legend format not compatible with a variable radius legend.',
272+
'Please either change `legend_gradient` to False or `legend_function` to "color".']))
273+
274274
options.update(
275275
showLegend=self.legend,
276276
legendLayout=self.legend_layout,

0 commit comments

Comments
 (0)