Skip to content

Commit

Permalink
add-web-tiled-layer: no need for mutable state in MapViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-edi committed Dec 4, 2024
1 parent 5fb9a71 commit a0bf813
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package com.esri.arcgismaps.sample.addwebtiledlayer.components

import android.app.Application
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.core.content.ContextCompat.getString
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
Expand All @@ -38,10 +36,8 @@ class MapViewModel(application: Application) : AndroidViewModel(application) {
attribution = getString(application, R.string.living_atlas_attribution)
}

val arcGISMap by mutableStateOf(
// use web tiled layer as Basemap
ArcGISMap(Basemap(webTiledLayer))
)
// use web tiled layer as Basemap
val arcGISMap = ArcGISMap(Basemap(webTiledLayer))

// create a message dialog view model for handling error messages
val messageDialogVM = MessageDialogViewModel()
Expand Down

0 comments on commit a0bf813

Please sign in to comment.