mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: move setTileSource() out of defaultMapSettings()
This commit is contained in:
parent
674d56cb1b
commit
8d52664010
1 changed files with 3 additions and 3 deletions
|
|
@ -472,7 +472,8 @@ fun MapView(model: UIViewModel = viewModel()) {
|
|||
* Reset map to default settings & visible buttons
|
||||
*/
|
||||
fun defaultMapSettings() = map.apply {
|
||||
setTileSource(loadOnlineTileSourceBase())
|
||||
// Required to get online tiles
|
||||
Configuration.getInstance().userAgentValue = BuildConfig.APPLICATION_ID
|
||||
setDestroyMode(false) // keeps map instance alive when in the background.
|
||||
isVerticalMapRepetitionEnabled = false // disables map repetition
|
||||
overlayManager = DefaultOverlayManager(TilesOverlay(tileProvider, context))
|
||||
|
|
@ -574,8 +575,7 @@ fun MapView(model: UIViewModel = viewModel()) {
|
|||
AndroidView(
|
||||
factory = {
|
||||
map.apply {
|
||||
// Required to get online tiles
|
||||
Configuration.getInstance().userAgentValue = BuildConfig.APPLICATION_ID
|
||||
setTileSource(loadOnlineTileSourceBase())
|
||||
defaultMapSettings()
|
||||
if (nodeMarkers.isNotEmpty()) zoomToBoundingBox(
|
||||
BoundingBox.fromGeoPoints(nodeMarkers.map { it.position }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue