Skip to content

Commit

Permalink
Fix conversion of scale ranges with varying styles (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored May 21, 2024
1 parent 5eb0812 commit e94c238
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions felt/core/fsl_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,25 @@ def vector_layer_to_fsl(

if layer.hasScaleBasedVisibility():
if layer.minimumScale():
fsl['style']['minZoom'] = (
MapUtils.map_scale_to_leaflet_tile_zoom(
layer.minimumScale()))
if isinstance(fsl['style'], list):
for style in fsl['style']:
style['minZoom'] = (
MapUtils.map_scale_to_leaflet_tile_zoom(
layer.minimumScale()))
else:
fsl['style']['minZoom'] = (
MapUtils.map_scale_to_leaflet_tile_zoom(
layer.minimumScale()))
if layer.maximumScale():
fsl['style']['maxZoom'] = (
MapUtils.map_scale_to_leaflet_tile_zoom(
layer.maximumScale()))
if isinstance(fsl['style'], list):
for style in fsl['style']:
style['maxZoom'] = (
MapUtils.map_scale_to_leaflet_tile_zoom(
layer.maximumScale()))
else:
fsl['style']['maxZoom'] = (
MapUtils.map_scale_to_leaflet_tile_zoom(
layer.maximumScale()))

return fsl

Expand Down

0 comments on commit e94c238

Please sign in to comment.