Skip to content

Commit 5d70ee8

Browse files
committed
PR feedback
1 parent c20f754 commit 5d70ee8

File tree

1 file changed

+7
-7
lines changed
  • download-vector-tiles-to-local-cache/src/main/java/com/esri/com/arcgismaps/sample/downloadvectortilestolocalcache

1 file changed

+7
-7
lines changed

download-vector-tiles-to-local-cache/src/main/java/com/esri/com/arcgismaps/sample/downloadvectortilestolocalcache/MainActivity.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,10 @@ class MainActivity : AppCompatActivity() {
8989
lifecycle.addObserver(previewMapView)
9090

9191
// create a graphic to show a red outline square around the vector tiles to be downloaded
92-
downloadArea.symbol = SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.red, 2F)
92+
downloadArea.symbol = SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.red, 2f)
9393

9494
// create a graphics overlay and add the downloadArea graphic
95-
val graphicsOverlay = GraphicsOverlay().apply {
96-
graphics.add(downloadArea)
97-
}
95+
val graphicsOverlay = GraphicsOverlay(listOf(downloadArea))
9896

9997
mapView.apply {
10098
// set the map to BasemapType navigation night
@@ -129,14 +127,13 @@ class MainActivity : AppCompatActivity() {
129127
// check that the layer from the basemap is a vector tiled layer
130128
val vectorTiledLayer =
131129
mapView.map?.basemap?.value?.baseLayers?.get(0) as ArcGISVectorTiledLayer
132-
// the max scale parameter is set to 10% of the map's scale so the
133-
// number of tiles exported are within the vector tiled layer's max tile export limit
130+
134131
lifecycleScope.launch {
135132
// update the download area's geometry using the current viewpoint
136133
updateDownloadAreaGeometry()
137134
// create a new export vector tiles task
138135
val exportVectorTilesTask = ExportVectorTilesTask(vectorTiledLayer.uri.toString())
139-
val geometry = (downloadArea.geometry)
136+
val geometry = downloadArea.geometry
140137
if (geometry == null) {
141138
showMessage("Error retrieving download area geometry")
142139
return@launch
@@ -146,6 +143,8 @@ class MainActivity : AppCompatActivity() {
146143
val exportVectorTilesParametersResult = exportVectorTilesTask
147144
.createDefaultExportVectorTilesParameters(
148145
geometry,
146+
// set the max scale parameter to 10% of the map's scale so the
147+
// number of tiles exported are within the vector tiled layer's max tile export limit
149148
mapView.mapScale.value * 0.1
150149
)
151150

@@ -223,6 +222,7 @@ class MainActivity : AppCompatActivity() {
223222
}.onFailure {
224223
showMessage(it.message.toString())
225224
dialog?.dismiss()
225+
hasCurrentJobCompleted = true
226226
}
227227
}
228228

0 commit comments

Comments
 (0)