GeoserverConfig.StyleAssignToLayer (GeoserverConfig v0.3.0)

Copy Markdown View Source

Provides functionality to assign a style to a coverage layer in GeoServer.

Verifies that the specified style exists before attempting to assign it as the default style for a given layer. All functions require a GeoserverConfig.Connection as their first argument.

Summary

Functions

Assigns a style to a layer as its default style, verifying the style exists first.

Functions

assign_style_to_layer(conn, workspace, layer_name, style_name, style_workspace \\ nil)

Assigns a style to a layer as its default style, verifying the style exists first.

Parameters

  • conn — a GeoserverConfig.Connection
  • workspace — workspace in which the layer resides
  • layer_name — name of the layer
  • style_name — name of the style to assign
  • style_workspace — workspace of the style, or nil to check globally (default: nil)

Returns

  • {:ok, message} if the style was successfully assigned
  • {:error, reason} if the style does not exist or the assignment failed