Skip to content

Commit

Permalink
Added show and opacity options for styled vector (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Jul 6, 2023
1 parent c2ec277 commit ccba6fd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions geemap/foliumap.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,14 @@ def add_colormap(
self.add_image(colorbar, position=position)

def add_styled_vector(
self, ee_object, column, palette, layer_name="Untitled", **kwargs
self,
ee_object,
column,
palette,
layer_name="Untitled",
shown=True,
opacity=1.0,
**kwargs,
):
"""Adds a styled vector to the map.
Expand All @@ -904,7 +911,13 @@ def add_styled_vector(
layer_name (str, optional): The name to be used for the new layer. Defaults to "Untitled".
"""
styled_vector = vector_styling(ee_object, column, palette, **kwargs)
self.addLayer(styled_vector.style(**{"styleProperty": "style"}), {}, layer_name)
self.addLayer(
styled_vector.style(**{"styleProperty": "style"}),
{},
layer_name,
shown,
opacity,
)

def add_shapefile(self, in_shp, layer_name="Untitled", **kwargs):
"""Adds a shapefile to the map. See https://python-visualization.github.io/folium/modules.html#folium.features.GeoJson for more info about setting style.
Expand Down

0 comments on commit ccba6fd

Please sign in to comment.