Skip to content

Commit

Permalink
in my shadow, my shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
kauevestena committed Jun 17, 2024
1 parent 32af284 commit 60f8f0c
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 221 deletions.
17 changes: 15 additions & 2 deletions webmap/webmap_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": "",
"source-layer": "",
"type": "circle",
"minzoom": 16,
"minzoom": 17,
"paint": {
"circle-color": "steelblue",
"circle-opacity": 0.8
Expand Down Expand Up @@ -192,7 +192,7 @@ def create_base_style(sources=MAP_SOURCES,name='Footway Categories'):

return style_dict

def create_simple_map_style(name,color_schema,sources=MAP_SOURCES):
def create_simple_map_style(name,color_schema,sources=MAP_SOURCES,generate_shadow_layers=True):
style_dict = deepcopy(mapstyle_basedict)

style_dict['sources'] = sources
Expand All @@ -201,6 +201,19 @@ def create_simple_map_style(name,color_schema,sources=MAP_SOURCES):

style_dict['layers'].extend(deepcopy(immutable_layers))

# creating "shadow layers" for line layers only:
if generate_shadow_layers:
for layername in ordered_map_layers:
if layertypes_dict[layername] == 'line':
layer_dict = deepcopy(layertypes_basedict['line'])
layer_dict['id'] = f'{layername}_shadow'
layer_dict['source'] = f'oswm_pmtiles_{layername}'
layer_dict['source-layer'] = layername
layer_dict['paint']['line-color'] = 'black'
layer_dict['paint']['line-width'] = 4

style_dict['layers'].append(layer_dict)

for layername in ordered_map_layers:
layer_type = layertypes_dict[layername]

Expand Down
Loading

0 comments on commit 60f8f0c

Please sign in to comment.