injectSiMapTranslations Type documentation¶
TypeScript declaration¶
import { injectSiMapTranslations } from '@siemens/element-ng/maplibre';Provides translated MapLibre locale strings as an Angular signal. The record uses MapLibre's original locale keys, such as AttributionControl.ToggleAttribution, and updates when the active Element language changes.
Example:
@Component({ ... })
export class MapComponent {
protected readonly mapTranslations = injectSiMapTranslations();
}
<mgl-map [locale]="mapTranslations()" />
Returns: A signal containing a MapLibre locale record, for example { 'AttributionControl.ToggleAttribution': 'Toggle attribution' }.
injectSiMapTranslations(): Signal<Record<string, string>>
Provides translated MapLibre locale strings as an Angular signal. The record uses MapLibre's original locale keys, such as AttributionControl.ToggleAttribution, and updates when the active Element language changes.
Example:
@Component({ ... })
export class MapComponent {
protected readonly mapTranslations = injectSiMapTranslations();
}
<mgl-map [locale]="mapTranslations()" />
Returns: A signal containing a MapLibre locale record, for example { 'AttributionControl.ToggleAttribution': 'Toggle attribution' }.
Except where otherwise noted, content on this site is licensed under MIT License.