Skip to content

Commit

Permalink
Reformatted code #1155
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jul 24, 2022
1 parent 07da89c commit 975b5b3
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions geemap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8173,31 +8173,31 @@ def geometry_type(ee_object):


def vector_styling(
ee_object,
column,
ee_object,
column,
palette,
color = "000000",
colorOpacity = 1,
pointSize = 3,
pointShape = "circle",
width = 1,
lineType = "solid",
fillColorOpacity = 0.66):
color="000000",
colorOpacity=1.0,
pointSize=3,
pointShape="circle",
width=1,
lineType="solid",
fillColorOpacity=0.66,
):

"""Add a new property to each feature containing a stylying dictionary.
Args:
ee_object (object): An ee.FeatureCollection.
column (str): The column name to use for styling.
palette (list | dict): The palette (e.g., list of colors or a dict containing label and color pairs) to use for styling.
color (str, optional): A default color (CSS 3.0 color value e.g. 'FF0000' or 'red') to use for drawing the features. Defaults to "black".
colorOpacity (float, optional): Opacity between 0-1 of the features. Defaults to 1
pointSize (int, optional): The default size in pixels of the point markers. Defaults to 3.
pointShape (str, optional): The default shape of the marker to draw at each point location. One of: circle, square, diamond, cross, plus, pentagram, hexagram, triangle, triangle_up, triangle_down, triangle_left, triangle_right, pentagon, hexagon, star5, star6. This argument also supports the following Matlab marker abbreviations: o, s, d, x, +, p, h, ^, v, <, >. Defaults to "circle".
width (int, optional): The default line width for lines and outlines for polygons and point shapes. Defaults to 1.
lineType (str, optional): The default line style for lines and outlines of polygons and point shapes. Defaults to 'solid'. One of: solid, dotted, dashed. Defaults to "solid".
fillColorOpacity (float, optional): Opacity between 0-1 of the fill. Defaults to 0.66. Color of the fill is based on the column name or index in the palette.
fillColorOpacity (float, optional): Opacity between 0-1 of the fill. Defaults to 0.66. Color of the fill is based on the column name or index in the palette.
Raises:
ValueError: The provided column name is invalid.
TypeError: The provided palette is invalid.
Expand Down Expand Up @@ -8250,8 +8250,7 @@ def vector_styling(
lambda f: f.set(
{
"style": {
"color": color
+ str(hex(int(colorOpacity * 255)))[2:].zfill(2),
"color": color + str(hex(int(colorOpacity * 255)))[2:].zfill(2),
"pointSize": pointSize,
"pointShape": pointShape,
"width": width,
Expand Down

0 comments on commit 975b5b3

Please sign in to comment.