Skip to content

Commit 2a9c327

Browse files
committed
Update readme.
1 parent 2750d9c commit 2a9c327

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

Shared/Samples/Create dynamic basemap gallery/CreateDynamicBasemapGalleryView.Views.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ extension CreateDynamicBasemapGalleryView {
5555
}
5656
}
5757
}
58+
.disabled(model.basemapStyleInfo?.languageStrategies.isEmpty ?? true)
5859

5960
Picker("Worldview", selection: $model.worldviewCode) {
6061
ForEach(model.worldviews, id: \.?.code) { worldview in
6162
Text(worldview?.displayName ?? "")
6263
.tag(worldview?.code)
6364
}
6465
}
66+
.disabled(model.basemapStyleInfo?.worldviews.isEmpty ?? true)
6567
}
6668
}
6769
}

Shared/Samples/Create dynamic basemap gallery/CreateDynamicBasemapGalleryView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extension CreateDynamicBasemapGalleryView {
9999
@Published private(set) var stylesInfo: [BasemapStyleInfo] = []
100100

101101
/// The basemap style info for the basemap style.
102-
@Published private var basemapStyleInfo: BasemapStyleInfo?
102+
@Published private(set) var basemapStyleInfo: BasemapStyleInfo?
103103

104104
/// The basemap style language strategy options for the basemap style info.
105105
var languageStrategies: [BasemapStyleLanguageStrategy] {

Shared/Samples/Create dynamic basemap gallery/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ Implement a basemap gallery that automatically retrieves the latest customizatio
66

77
## Use case
88

9-
Multi-use and/or international applications benefit from the ability to change a basemap's style or localize the basemap. For example, an application used for ecological surveys might include navigation functionality to guide an ecologist to a location and functionality for inputting data. When traveling, a user is likely to benefit from a map with a style that emphasizes the transport infrastructure (e.g. `ArcGIS Navigation`). However, during surveys a user is likely to benefit from a map with a style that highlights features in the terrain (e.g. `ArcGIS Terrain`). Implementing a basemap gallery with customization options in an application gives a user the freedom to select a basemap with a style and features (e.g. language of labels) suitable for the task they are undertaking. Making the basemap gallery dynamic ensures the latest customization options are automatically included.
9+
Multi-use and/or international applications benefit from the ability to change a basemap's style or localize the basemap. For example, an application used for ecological surveys might include navigation functionality to guide an ecologist to a location and functionality for inputting data. When traveling, a user is likely to benefit from a map with a style that emphasizes the transport infrastructure (e.g., `ArcGIS Navigation`). However, during surveys a user is likely to benefit from a map with a style that highlights features in the terrain (e.g. `ArcGIS Terrain`). Implementing a basemap gallery with customization options in an application gives a user the freedom to select a basemap with a style and features (e.g., the language of labels) suitable for the task they are undertaking. Making the basemap gallery dynamic ensures the latest customization options are automatically included.
1010

1111
## How to use the sample
1212

13-
When launched, this sample displays a map containing a button that, when pressed, displays a gallery of all styles available in the basemap styles service. Selecting a style results in the drop-down menus at the base of the gallery becoming enabled or disabled. A disabled menu indicates that the customization cannot be applied to the selected style. Once a style and any desired customizations have been selected, pressing `Load` will update the basemap in the map view.
13+
Press "Basemap" to display a gallery of all styles available in the basemap styles service. Select a style using the "Style" picker. Select a language or language strategy using the "Language" picker. Optionally selected a worldview using the "Worldview" picker. Disabled pickers indicate that the customization cannot be applied to the selected style.
1414

1515
## How it works
1616

17-
* Instantiate and load a `BasemapStylesService` object.
18-
* Get the `BasemapStylesServiceInfo` object from `BasemapStylesService.info()`.
19-
* Access the list of `BasemapStyleInfo` objects using `BasemapStylesServiceInfo.stylesInfo()`. These `BasemapStyleInfo` objects contain up-to-date information about each of the styles supported by the Maps SDK, including:
20-
* `styleName`: The human-readable name of the style.
21-
* `style`: The `BasemapStyle` enumeration value representing this style in the Maps SDK.
22-
* `thumbnail`: An image that can be used to display a preview of the style.
23-
* `languages`: A list of `BasemapStyleLanguageInfo` objects, which provide information about each of the specific languages that can be used to customize labels on the style.
24-
* `worldview`: A list of `Worldview` objects, which provide information about each representation of a disputed boundary that can be used to customize boundaries on the style.
17+
* Create and load a `BasemapStylesService` object.
18+
* Get the `BasemapStylesServiceInfo` object from `BasemapStylesService.info`.
19+
* Access the list of `BasemapStyleInfo` objects using `BasemapStylesServiceInfo.stylesInfo`. These `BasemapStyleInfo` objects contain up-to-date information about each of the styles supported by the Maps SDK, including:
20+
* `languageStrategies`: A list of `BasemapStyleLanguageStrategy` enumeration values that can be used with the style.
21+
* `languages`: A list of `Locale.Language` objects that can be used to customize labels on the style.
22+
* `styleName`: The human-readable name of the style.
23+
* `style`: The `Basemap.Style` enumeration value representing this style in the Maps SDK.
24+
* `thumbnail`: An image that can be used to display a preview of the style.
25+
* `worldview`: A list of `Worldview` objects, which provide information about each representation of a disputed boundary that can be used to customize boundaries on the style.
2526
* The information contained in the list of `BasemapStyleInfo` objects can be used as the data model for a basemap gallery UI component.
2627

2728
## Relevant API
@@ -35,7 +36,7 @@ When launched, this sample displays a map containing a button that, when pressed
3536

3637
## Additional information
3738

38-
This sample demonstrates how to implement a basemap gallery using the Maps SDK. The styles and associated customization options used for the gallery are retrieved from the [basemap styles service](https://developers.arcgis.com/rest/basemap-styles/). A ready-made basemap gallery component is also available in the toolkit's provided with each SDK. To see how the ready-made basemap gallery toolkit component can be integrated into a Maps SDK application refer to the `Set Basemap` sample.
39+
This sample demonstrates how to implement a basemap gallery using the Maps SDK. The styles and associated customization options used for the gallery are retrieved from the [basemap styles service](https://developers.arcgis.com/rest/basemap-styles/). A ready-made basemap gallery component is also available in the toolkits provided with each SDK. To see how the ready-made basemap gallery toolkit component can be integrated into a Maps SDK application, refer to the `Set Basemap` sample.
3940

4041
## Tags
4142

0 commit comments

Comments
 (0)