Provides parameters for creating a Basemap from a BasemapStyle. BasemapStyleParameters allows you to set preferences, such as the language to use for basemap labels, when creating a Basemap that suits your application. More...
Header: | #include <BasemapStyleParameters.h> |
Since: | Esri::ArcGISRuntime 200.3 |
Inherits: | Esri::ArcGISRuntime::Object |
Public Functions
BasemapStyleParameters(QObject *parent = nullptr) | |
virtual | ~BasemapStyleParameters() override |
Esri::ArcGISRuntime::BasemapStyleLanguageStrategy | languageStrategy() const |
void | setLanguageStrategy(Esri::ArcGISRuntime::BasemapStyleLanguageStrategy languageStrategy) |
void | setSpecificLanguage(const QString &specificLanguage) |
void | setWorldview(Esri::ArcGISRuntime::Worldview *worldview) |
QString | specificLanguage() const |
Esri::ArcGISRuntime::Worldview * | worldview() const |
Detailed Description
BasemapStyleParameters build upon a BasemapStyle to adjust settings for how that style is displayed. For example, you can choose from a set of options that determine the language for displaying labels on the basemap.
- Set the specificLanguage to specify a desired language for basemap labels.
- Set languageStrategy to use local language, use global language, or attempt to use the application locale.
Once you are finished configuring the options for your BasemapStyleParameters, they can be used with a BasemapStyle to create a Basemap. When the Basemap is loaded, the parameters in the BasemapStyleParameters are evaluated.
Relevant samples:
- Create dynamic basemap gallery: Implement a basemap gallery that automatically retrieves the latest customization options from the basemap styles service.
- Configure basemap style parameters: Apply basemap style parameters customization for a basemap, such as displaying all labels in a specific language or displaying every label in their corresponding local language.
Member Function Documentation
[explicit]
BasemapStyleParameters::BasemapStyleParameters (QObject *parent = nullptr)
Creates a BasemapStyleParameters that controls how a BasemapStyle is used when constructing a Basemap.
- parent - The optional parent QObject.
After creating a BasemapStyleParameters object, BasemapStyle preferences, such as language, can be set.
A preference for using global, local, or the system locale language can be set using languageStrategy. To define a preference for a specific language, set the specificLanguage property to a supported language code.
[override virtual]
BasemapStyleParameters::~BasemapStyleParameters ()
Destructor.
Esri::ArcGISRuntime::BasemapStyleLanguageStrategy BasemapStyleParameters::languageStrategy () const
Returns the option for setting the language for basemap labels. This property allows you to specify an option for the language to use for basemap labels. You can use global or local place names or attempt to use the system locale. If you want to use a specific language, set the specificLanguage property. Note that the specificLanguage property takes precedence over the languageStrategy. If the specificLanguage is a non-empty string, the languageStrategy will be ignored.
The default value is BasemapStyleLanguageStrategy::Default.
See also setLanguageStrategy().
void BasemapStyleParameters::setLanguageStrategy (Esri::ArcGISRuntime::BasemapStyleLanguageStrategy languageStrategy )
Sets the languageStrategy to languageStrategy.
See also languageStrategy.
void BasemapStyleParameters::setSpecificLanguage (const QString &specificLanguage )
Sets the specificLanguage to specificLanguage.
See also specificLanguage.
[since Esri::ArcGISRuntime 200.5]
void BasemapStyleParameters::setWorldview (Esri::ArcGISRuntime::Worldview *worldview)
Sets the worldview to worldview.
This function was introduced in Esri::ArcGISRuntime 200.5.
See also worldview.
QString BasemapStyleParameters::specificLanguage () const
Returns the desired language for place labels on the Basemap or an empty string if no specific language is required.
The specificLanguage must be a CLDR (Common Locale Data Repository) format string that uses a two letter language code (e.g. "en" for English) optionally followed by a two letter country code (e.g. "en-US" for US English).
If the requested combination of language and country (e.g. "fr-CA") is not supported, the resulting Basemap will fall back to the next most suitable supported language (e.g. "fr").
If no fallback is available, a default language strategy will be used. "global" for ArcGIS basemap styles or "local" for OSM basemap styles.
The list of supported language codes is shown in the table below. To see the latest list of languages supported by the Basemap Styles Service, see the Languages section of the Basemap Styles Service documentation:
Language (CLDR code) | Description |
---|---|
ar | Arabic |
bs | Bosnian |
bg | Bulgarian |
ca | Catalan |
zh-HK | Chinese (Hong Kong) |
zh-CN | Chinese (Simplified) |
zh-TW | Chinese (Taiwan) |
hr | Croatian |
cs | Czech |
da | Danish |
nl | Dutch |
en | English |
et | Estonian |
fi | Finnish |
fr | French |
de | German |
el | Greek |
he | Hebrew |
hu | Hungarian |
id | Indonesian |
it | Italian |
ja | Japanese |
ko | Korean |
lv | Latvian |
lt | Lithuanian |
nb | Norwegian |
pl | Polish |
pt-BR | Portuguese (Brazil) |
pt-PT | Portuguese (Portugal) |
ro | Romanian |
ru | Russian |
sr | Serbian |
sk | Slovak |
sl | Slovenian |
es | Spanish |
sv | Swedish |
th | Thai |
tr | Turkish |
uk | Ukrainian |
vi | Vietnamese |
If a supported language code is supplied, the labels are displayed in the identified language. If an unsupported language code is used, the label language falls back to the closest available language. For example, American English (us-EN) or Canadian French (fr-CA) are not currently supported. These are interpreted as English and French respectively. If no suitable fallback language code is found, labels use the default language for the style.
The default value is an empty string.
If set, this property takes precedence over the languageStrategy.
See also setSpecificLanguage().
[since Esri::ArcGISRuntime 200.5]
Esri::ArcGISRuntime::Worldview *BasemapStyleParameters::worldview() const
Returns specifies the desired representation of a boundary between countries on a Basemap where the location of the boundary is disputed.
This parameter defines the boundary lines and labels displayed on a Basemap. If no value is defined, the style will use the standard set of boundary lines and labels defined by the style. Note that there may be cases where labels for a given disputed area are not available in all languages. In that case, the language for the label may change by falling back to the default.
For the up-to-date list of supported world views used by the basemap styles service, see the documentation for the worldview parameter.
If customization of disputed boundaries is not required, do not set this property.
World views can only be displayed on some ArcGIS basemap styles and cannot be displayed on Open Street Map (OSM) styles.
This function was introduced in Esri::ArcGISRuntime 200.5.
See also setWorldview().