- globalmapper.SetAreaFeatureClassDrawStyle(AreaFeatureClass_t16 aFeatureClass, GM_AreaStyle_t aAreaStyle) GM_Error_t32
-
Sets the default style and font to use for drawing areas with the given area classification. Pass None for the area style to reset the default drawing style to the default style for that classification of area.
Typically, when modifying the drawing style of a area class you will want to call GetAreaFeatureClassDrawStyle to get the current drawing style, then just change what you need, then pass your copy in to this function.
- Parameters:
-
aFeatureClass (AreaFeatureClass_t16) – Feature class to set draw style for
aAreaStyle (GM_AreaStyle_t) – New style to use for area class (use None to reset to default)
- Returns:
-
Error Code
- Return type:
-
GM_Error_t32
Example
The following is an example of SetAreaFeatureClassDrawStyle.
import globalmapper as gm
# Area class for an AFC_WETLAND
err_GetAreaFeatureClassDrawStyle, area_style = gm.GetAreaFeatureClassDrawStyle(33)
area_style.mBorderPenColor = gm.toRGB(3, 252, 202)
### START SAMPLE
err_SetAreaFeatureClassDrawStyle = gm.SetAreaFeatureClassDrawStyle(33, area_style)
### END SAMPLE
# Reset the changes made in this sample
err_SetAreaFeatureClassDrawStyle1 = gm.SetAreaFeatureClassDrawStyle(33, None)
assert (
gm.GM_Error_None == err_GetAreaFeatureClassDrawStyle
), f"GetAreaFeatureClassDrawStyle: Expected {gm.GM_Error_None}, got {err_GetAreaFeatureClassDrawStyle}"
assert (
gm.GM_Error_None == err_SetAreaFeatureClassDrawStyle
), f"SetAreaFeatureClassDrawStyle: Expected {gm.GM_Error_None}, got {err_SetAreaFeatureClassDrawStyle}"