diff options
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/TrackerMap/android/units')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt index bf5f1d8..cbd543a 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt @@ -90,13 +90,14 @@ class UnitsActivity : AppCompatActivity() { val popOver = PopupMenu(this, view) popOver.menuInflater.inflate(R.menu.map_layers, popOver.menu) popOver.setOnMenuItemClickListener { item -> - unitsViewModel.setMapLayer( + val layer = resources.getStringArray( when (item.itemId) { - R.id.layerStreets -> getString(R.string.maps_streets_tile_url) - R.id.layerSatellite -> getString(R.string.maps_satellite_url) - else -> getString(R.string.maps_streets_tile_url) + R.id.layerStreets -> R.array.maps_streets_tile_url + R.id.layerSatellite -> R.array.maps_satellite_tile_url + else -> R.array.maps_streets_tile_url } ) + unitsViewModel.setMapLayer(layer[0], layer[1].toInt(), layer[2].toInt()) true } popOver.show() |