This module provides the styling functionality for the Geoflo application. It allows users to change the map style by selecting from a list of predefined styles.
Methods
-
static closeModal() → {void}
-
Closes the style control container.
Returns:
void -
static getDefaultPosition() → {String}
-
Returns the default position for the style control container.
Returns:
String - The default position for the style control container. -
static hide() → {void}
-
Hides the style control container.
Returns:
void -
static init(options) → {Object}
-
Initializes the Styles object by extending the options object with the provided options, setting the styles, defaultStyle, and event listeners.
Parameters:
Name Type Description options
Object The options object containing the styles and selected style. Returns:
Object - Returns the Styles object. -
static onAdd(map) → {Object}
-
Adds the style control container to the map.
Parameters:
Name Type Description map
Object The map object to add the style control container to. Throws:
-
Throws an error if the map object is not provided.
- Type
- Error
Returns:
Object - The style control container. -
-
static onRemove() → {void}
-
Removes the style control container from the map.
Throws:
-
-
Throws an error if the control container, control container parent node, map, or style button is not provided.
- Type
- Error
-
-
-
Throws an error if the style button event listener is not removed.
- Type
- Error
-
-
-
Throws an error if the document event listener is not removed.
- Type
- Error
-
Returns:
void -
-
static openModal() → {void}
-
Opens the style control container.
Returns:
void -
static select(name) → {void}
-
Selects the style with the provided name by setting the map style to the style's uri.
Parameters:
Name Type Description name
String The name of the style to select. Returns:
void -
static show() → {void}
-
Shows the style control container.
Returns:
void