Maps SDK for Web

Class L.LanguageSelector

This module helps you to create a language selector.

Methods

getHtmlElement(localeService, [serviceType]): HTMLSelectElement

Returns a HTMLSelectElement filled with the supported locales.

The element has a function bound to its onchange event, which updates the locale configuration of the LocaleService instance given as the first argument.

Parameters
Name Description Required Type/Values Default
localeService Locale service which will be bound to the generated dropdown. Yes LocaleService None
serviceType Determines the list of languages.
  • If you do not provide this parameter or you provide an invalid one, all languages will be included.
  • If you pass a value, only languages specific for the given service's type will be added.
No "routing" | "search" | "traffic" | "maps" None