new StyleService()
Methods
-
asyncaddIcons(map, iconsMeta)
MapboxViewer/domain/services/StyleService.ts, line 64 -
Adds icons from metadata and emits an event on completion.
Name Type Description mapThe map instance.
iconsMetaOptional metadata for icons to add.
-
addLayerSafe(map, layer)
MapboxViewer/domain/services/StyleService.ts, line 98 -
Adds layer safely to the map.
Name Type Description mapThe map instance.
layerThe layer configuration.
-
addSourceSafe(map, id, source)
MapboxViewer/domain/services/StyleService.ts, line 89 -
Adds source safely to the map.
Name Type Description mapThe map instance.
idThe source ID.
sourceThe source data.
-
asyncapplyLayer(map, layer)
MapboxViewer/domain/services/StyleService.ts, line 26 -
Applies a layer to the map with business logic validations and emits an event on success.
Name Type Description mapThe map instance to apply the layer to.
layerThe layer configuration to apply.
Throws:
Error if layer configuration is invalid.
-
getEventEmitter()
MapboxViewer/domain/services/StyleService.ts, line 106 -
Gets the event emitter for subscribing to domain events.
Returns:
The event emitter instance. -
setLayerVisibility(map, layerId, visible)
MapboxViewer/domain/services/StyleService.ts, line 47 -
Sets layer visibility with domain rules and emits an event on change.
Name Type Description mapThe map instance.
layerIdThe ID of the layer to modify.
visibleThe visibility state to set.
-
asyncwaitForStyle(map, timeoutMs)
MapboxViewer/domain/services/StyleService.ts, line 79 -
Waits for style to load with optional timeout.
Name Type Description mapThe map instance.
timeoutMsOptional timeout in milliseconds.
