Skip to content

Commit 1eb8828

Browse files
committed
Enable map rotation
1 parent b740162 commit 1eb8828

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

app/src/main/kotlin/map/MapFragment.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ class MapFragment : Fragment() {
225225
}
226226

227227
it.setStyle(Style.Builder().fromUri(prefs.mapStyle.uri(requireContext())))
228-
it.uiSettings.isCompassEnabled = false
229-
it.uiSettings.isRotateGesturesEnabled = false
228+
it.uiSettings.setCompassMargins(dpToPx(0), dpToPx(120 + 16), dpToPx(16), dpToPx(0))
230229
it.uiSettings.isLogoEnabled = false
231230
it.uiSettings.isAttributionEnabled = false
231+
it.uiSettings.isTiltGesturesEnabled = false
232232
it.addMarkerClickListener()
233233

234234
it.getStyle { style ->
@@ -741,7 +741,8 @@ class MapFragment : Fragment() {
741741
PropertyFactory.circleColor(prefs.badgeBackgroundColor(requireContext())),
742742
PropertyFactory.circleRadius(9f),
743743
PropertyFactory.circleOpacity(1f),
744-
PropertyFactory.circleTranslate(arrayOf(13f, -43f))
744+
PropertyFactory.circleTranslate(arrayOf(13f, -43f)),
745+
PropertyFactory.circleTranslateAnchor("viewport")
745746
)
746747
setFilter(
747748
Expression.all(
@@ -767,6 +768,7 @@ class MapFragment : Fragment() {
767768
PropertyFactory.textSize(11f),
768769
PropertyFactory.textColor(prefs.badgeTextColor(requireContext())),
769770
PropertyFactory.textTranslate(arrayOf(13f, -43f)),
771+
PropertyFactory.textTranslateAnchor("viewport"),
770772
PropertyFactory.textAllowOverlap(true)
771773
)
772774
setFilter(
@@ -965,7 +967,8 @@ class MapFragment : Fragment() {
965967
PropertyFactory.circleColor(prefs.badgeBackgroundColor(requireContext())),
966968
PropertyFactory.circleRadius(9f),
967969
PropertyFactory.circleOpacity(1f),
968-
PropertyFactory.circleTranslate(arrayOf(13f, -43f))
970+
PropertyFactory.circleTranslate(arrayOf(13f, -43f)),
971+
PropertyFactory.circleTranslateAnchor("viewport")
969972
)
970973
setFilter(
971974
Expression.all(
@@ -991,6 +994,7 @@ class MapFragment : Fragment() {
991994
PropertyFactory.textSize(11f),
992995
PropertyFactory.textColor(prefs.badgeTextColor(requireContext())),
993996
PropertyFactory.textTranslate(arrayOf(13f, -43f)),
997+
PropertyFactory.textTranslateAnchor("viewport"),
994998
PropertyFactory.textAllowOverlap(true)
995999
)
9961000
setFilter(

0 commit comments

Comments
 (0)