From cee1b0e9f3179b049b13047168f4d73350c9755d Mon Sep 17 00:00:00 2001 From: Jackson Rosenthal Date: Wed, 2 Mar 2022 18:46:50 -0500 Subject: [PATCH] Testing map with custom style pack --- .../com/geeksville/mesh/ui/MapFragment.kt | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt index be5fa7295..222a02681 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt @@ -578,22 +578,25 @@ class MapFragment : ScreenFragment("Map"), Logging { "Save", null ) .setNeutralButton("View Regions") { _, _ -> - val regions = layoutInflater.inflate(R.layout.adapter_region_layout, null) - val regionFragment = AlertDialog.Builder(context) - regionFragment.setView(regions) - regionFragment.create() - regionFragment.show() - +// val regions = layoutInflater.inflate(R.layout.adapter_region_layout, null) +// val regionFragment = AlertDialog.Builder(context) +// regionFragment.setView(regions) +// regionFragment.create() +// regionFragment.show() // Open up Downloaded Region managers -// mapView?.getMapboxMap().also { -// it?.flyTo( -// CameraOptions.Builder() -// .zoom(ZOOM) -// .center(point) -// .build(), MapAnimationOptions.mapAnimationOptions { duration(1000) }) -// it?.loadStyleUri(mapView?.getMapboxMap()?.getStyle()?.styleURI.toString()) -// } + mapView?.getMapboxMap().also { + it?.flyTo( + CameraOptions.Builder() + .zoom(ZOOM) + .center(point) + .build(), MapAnimationOptions.mapAnimationOptions { duration(1000) }) + if (userStyleURI != null) { + it?.loadStyleUri(userStyleURI.toString()) + } else { + it?.loadStyleUri(mapView?.getMapboxMap()?.getStyle()?.styleURI.toString()) + } + } } .setNegativeButton( R.string.cancel