Skip to content

Commit

Permalink
update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
prupani-7 committed Mar 6, 2024
1 parent 7079558 commit 6387616
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.AndroidViewModel
import com.arcgismaps.geometry.Point
import com.arcgismaps.geometry.SpatialReference
import com.arcgismaps.mapping.ArcGISMap
import com.arcgismaps.mapping.BasemapStyle
import com.arcgismaps.mapping.Viewpoint
import com.arcgismaps.tasks.geoprocessing.GeoprocessingJob
import com.arcgismaps.tasks.geoprocessing.GeoprocessingParameters
import com.arcgismaps.tasks.geoprocessing.GeoprocessingResult
Expand Down Expand Up @@ -57,6 +60,14 @@ class MapViewModel(
// job used to run the geoprocessing task on a service
private var geoprocessingJob: GeoprocessingJob? = null

init {
map.apply {
initialViewpoint = Viewpoint(
center = Point(-13671170.0, 5693633.0, SpatialReference(wkid = 3857)),
scale = 1e5
)
}
}
/**
* Creates a [geoprocessingJob] with the default [GeoprocessingParameters]
* and a custom query date range between [fromDate] & [toDate]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import com.arcgismaps.geometry.Point
import com.arcgismaps.geometry.SpatialReference
import com.arcgismaps.mapping.Viewpoint
import com.arcgismaps.toolkit.geocompose.MapView
import com.arcgismaps.toolkit.geocompose.MapViewpointOperation
import com.esri.arcgismaps.sample.analyzehotspots.components.MapViewModel
import com.esri.arcgismaps.sample.sampleslib.components.JobLoadingDialog
import com.esri.arcgismaps.sample.sampleslib.components.MessageDialog
Expand Down Expand Up @@ -60,13 +56,7 @@ fun MainScreen(sampleName: String) {
modifier = Modifier
.fillMaxSize()
.weight(1f),
arcGISMap = mapViewModel.map,
viewpointOperation = MapViewpointOperation.Set(
viewpoint = Viewpoint(
center = Point(-13671170.0, 5693633.0, SpatialReference(wkid = 3857)),
scale = 1e5
)
)
arcGISMap = mapViewModel.map
)
// bottom layout with a button to display analyze hotspot options
BottomAppContent(
Expand Down

0 comments on commit 6387616

Please sign in to comment.