add satelite tile option

master
yova 4 months ago
parent 3cf8fba57f
commit 1bb333f796

@ -7,11 +7,11 @@
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_2_API_29_2.avd" />
<value value="$USER_HOME$/.android/avd/Pixel_5_API_30_2.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-12-26T22:11:52.582376773Z" />
<timeTargetWasSelectedWithDropDown value="2024-01-14T22:16:53.335532481Z" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

Binary file not shown.

@ -43,6 +43,7 @@ class GatherActivity : AppCompatActivity() {
val ID_ZULETZT_GEOEFFNETES_PROJEKT = "id_zuletzt_geoeffnetes_projekt"
val AKTUELLES_PROJEKT = "aktuelles_projekt"
val AKTUELLE_NOTIZ = "aktuelle_notiz"
val TILE_TYPE = "tile_type"
}
inner class NoteLocationListener : LocationListener {
@ -676,12 +677,15 @@ class GatherActivity : AppCompatActivity() {
intent.putExtra(INDEX_AKTUELLE_NOTIZ, notizen?.indexOf(aktuelleNotiz!!))
with(AlertDialog.Builder(this@GatherActivity)) {
setSingleChoiceItems(R.array.map_types,-1, DialogInterface.OnClickListener { dialog, id ->
Log.i(javaClass.simpleName,"Ausgewählter map typ: " + id)
if (id==0) {
Log.i(javaClass.simpleName, "Ausgewählter map typ: " + id)
if (id ==0 ) {
intent.setClass(this@GatherActivity, OsmWebViewActivity::class.java)
} else {
intent.setClass(this@GatherActivity, NoteMapActivity::class.java)
}
if (id == 2) {
intent.putExtra(TILE_TYPE, 1)
}
})
setPositiveButton("OK", DialogInterface.OnClickListener { dialog, id ->

@ -50,8 +50,7 @@ class NoteMapActivity : AppCompatActivity() {
val tileCache = File(osmConfig.osmdroidBasePath, "tile")
osmConfig.osmdroidTileCache = tileCache
val map = findViewById<MapView>(R.id.mapview)
/*map.setTileSource(GoogleSat)*/
map.setTileSource(TileSourceFactory.OpenTopo)
val extras = intent.extras ?: return
val notizen : ArrayList<Notiz>
@ -62,6 +61,13 @@ class NoteMapActivity : AppCompatActivity() {
notizen = intent.getParcelableArrayListExtra<Notiz>(GatherActivity.NOTIZEN) ?: return
}
val ourTileType = extras.getInt(GatherActivity.TILE_TYPE)
if (ourTileType != 0) {
map.setTileSource(GoogleSat)
} else {
map.setTileSource(TileSourceFactory.OpenTopo)
}
notizen.forEach {
val marker = Marker(map)
marker.position = GeoPoint(it.latitude, it.longitude)

@ -17,8 +17,9 @@
<string name="title_item_car_fast">Auto > 100km/h</string>
<string name="title_item_desktop">Am Rechner 0km/h</string>
<string-array name="map_types">
<item>WebViewActivity</item>
<item>NoteMapActivity</item>
<item>openlayers</item>
<item>osmdroid</item>
<item>osmdroid with sat tiles</item>
</string-array>
</resources>
Loading…
Cancel
Save