mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Added Wikimedia OSM tile source
This commit is contained in:
1 parent
8ea5dd062b
commit
4f5d0c1a6d
1 file changed
+7
-2
@@ -27,7 +27,7 @@ import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.osmdroid.config.Configuration
|
||||
import org.osmdroid.tileprovider.tilesource.TileSourceFactory
|
||||
import org.osmdroid.tileprovider.tilesource.XYTileSource
|
||||
import org.osmdroid.util.BoundingBox
|
||||
import org.osmdroid.util.GeoPoint
|
||||
import org.osmdroid.views.CustomZoomButtonsController
|
||||
@@ -88,7 +88,7 @@ class MapOsmFragment : Fragment(R.layout.fragment_map_osm) {
|
||||
private fun setupMapView() {
|
||||
binding.mapView.apply {
|
||||
setMultiTouchControls(true)
|
||||
setTileSource(TileSourceFactory.MAPNIK)
|
||||
setTileSource(getTileSource())
|
||||
minZoomLevel = 2.5
|
||||
maxZoomLevel = 6.0
|
||||
controller.setZoom(minZoomLevel)
|
||||
@@ -109,6 +109,11 @@ class MapOsmFragment : Fragment(R.layout.fragment_map_osm) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTileSource(): XYTileSource {
|
||||
val tileSourceArray = arrayOf("https://maps.wikimedia.org/osm-intl/")
|
||||
return XYTileSource("wiki", 2, 6, 256, ".png", tileSourceArray)
|
||||
}
|
||||
|
||||
private fun setupObservers() {
|
||||
viewModel.getGSP().observe(viewLifecycleOwner, Observer { stationPosition ->
|
||||
when (stationPosition) {
|
||||
|
||||
Reference in new issue
Block a user