File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Shared/Samples/Add vector tiled layer from custom style Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,12 @@ private extension AddVectorTiledLayerFromCustomStyleView {
109109 }
110110 map. basemap = Basemap ( baseLayer: vectorTiledLayer)
111111
112- if vectorTiledLayer. vectorTileCache != nil {
112+ return if vectorTiledLayer. vectorTileCache != nil {
113113 // Uses a Dodge City, KS viewpoint if the layer was created using the tile cache.
114- return Viewpoint ( latitude: 37.76528 , longitude: - 100.01766 , scale: 4e4 )
114+ Viewpoint ( latitude: 37.76528 , longitude: - 100.01766 , scale: 4e4 )
115115 } else {
116116 // Uses a Europe/Africa viewpoint if the layer was created using an online style.
117- return Viewpoint ( latitude: 28.53345 , longitude: 17.56488 , scale: 1e8 )
117+ Viewpoint ( latitude: 28.53345 , longitude: 17.56488 , scale: 1e8 )
118118 }
119119 }
120120
Original file line number Diff line number Diff line change @@ -15,15 +15,15 @@ Pan and zoom to explore the vector tile basemap. Select a theme to see it applie
1515
1616## How it works
1717
18- 1 . Construct an ` ArcGISVectorTiledLayer ` with the URL of a custom style from AcrGIS Online.
19- 2 . Alternatively, construct an ` ArcGISVectorTiledLayer ` by taking a portal item offline and apply it to an offline vector tile package:
18+ 1 . Create an ` ArcGISVectorTiledLayer ` with the URL of a custom style from AcrGIS Online.
19+ 2 . Alternatively, create an ` ArcGISVectorTiledLayer ` by taking a portal item offline and applying it to an offline vector tile package:
2020 i. Create a ` PortalItem ` using the URL of a custom style.
2121 ii. Create an ` ExportVectorTilesTask ` using the portal item.
2222 iii. Get the ` ExportVectorTilesJob ` using ` ExportVectorTilesTask.makeExportStyleResourceCacheJob(itemResourceCacheURL:) ` .
23- iv. Start the job using ` ExportVectorTilesJob .start()` .
24- v. Construct an ` VectorTileCache ` using the path of the local vector tile package.
25- vi. Once the job is complete, construct an ` ArcGISVectorTiledLayer ` using the vector tile cache and the ` ItemResourceCache ` from the job's result.
26- 3 . Create an ` Basemap ` from the ` ArcGISVectorTiledLayer ` .
23+ iv. Start the job using ` Job .start()` .
24+ v. Create a ` VectorTileCache ` using the path of the local vector tile package.
25+ vi. Once the job is complete, create an ` ArcGISVectorTiledLayer ` using the vector tile cache and the ` ItemResourceCache ` from the job's result.
26+ 3 . Create a ` Basemap ` from the ` ArcGISVectorTiledLayer ` .
27274 . Assign the basemap to the map's ` basemap ` .
2828
2929## Relevant API
You can’t perform that action at this time.
0 commit comments