Skip to content

Commit

Permalink
Use named arguments for some functions
Browse files Browse the repository at this point in the history
  • Loading branch information
darryl-lynch committed Dec 20, 2024
1 parent 3ab0e2b commit 0f1f61d
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ class ProjectGeometryViewModel(val app: Application) : AndroidViewModel(app) {
// create a map with a navigation night basemap style
val arcGISMap = ArcGISMap(BasemapStyle.ArcGISStreetsNight).apply {
// set the default viewpoint to Redlands,CA
initialViewpoint = Viewpoint(34.058, -117.195, 5e4)
initialViewpoint = Viewpoint(
latitude = 34.058,
longitude = -117.195,
scale = 5e4
)
}
// create a MapViewProxy to interact with the MapView
val mapViewProxy = MapViewProxy()
Expand Down Expand Up @@ -83,8 +87,8 @@ class ProjectGeometryViewModel(val app: Application) : AndroidViewModel(app) {
viewModelScope.launch {
arcGISMap.load().onFailure { error ->
messageDialogVM.showMessageDialog(
"Failed to load map",
error.message.toString()
title = "Failed to load map",
description = error.message.toString()
)
}
}
Expand All @@ -101,7 +105,10 @@ class ProjectGeometryViewModel(val app: Application) : AndroidViewModel(app) {
}
// project the web mercator location into a WGS84
val projectedPoint =
GeometryEngine.projectOrNull(point, SpatialReference.wgs84())
GeometryEngine.projectOrNull(
geometry = point,
spatialReference = SpatialReference.wgs84()
)
_infoText.value = app.resources.getString(
R.string.projection_info_text,
point.toDisplayFormat(),
Expand Down

0 comments on commit 0f1f61d

Please sign in to comment.