Skip to content

Commit 8fa2317

Browse files
evil159github-actions[bot]
authored andcommitted
Scale bar nautical miles (#6897)
Adds `ScaleBarSettings.distanceUnits`/`ScaleBarViewOptions.units` along with adding support for nautical scale bar units. Now scale bar supports: metric, imperial and nautical units. Addresses: https://mapbox.atlassian.net/browse/MAPSSDK-869 cc @mapbox/maps-android cc @mapbox/maps-ios cc @mapbox/sdk-ci GitOrigin-RevId: 1abaf1d4b41491333bb9ab5061025ebacc5792b9
1 parent 1ce7b3c commit 8fa2317

File tree

27 files changed

+592
-68
lines changed

27 files changed

+592
-68
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Mapbox welcomes participation and contributions from everyone.
1111
## Bug fixes 🐞
1212
* Fix an issue where `MapView#snapshot` listener was invoked twice when the map was not ready.
1313

14+
* Introduced `ScaleBarSettings.distanceUnits` property supporting metric, imperial, and nautical units, replacing the boolean `isMetricUnits` property.
15+
1416
# 11.16.0-beta.1 September 23, 2025
1517

1618
## Features ✨ and improvements 🏁

app/src/androidTest/java/com/mapbox/maps/testapp/scalebar/generated/ScaleBarAttributeParserDefaultValueTest.kt

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/androidTest/java/com/mapbox/maps/testapp/scalebar/generated/ScaleBarAttributeParserTest.kt

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/res/layout/activity_scale_bar.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
app:mapbox_scaleBarBorderWidth="1dp"
1212
app:mapbox_scaleBarHeight="5dp"
1313
app:mapbox_scaleBarGravity="bottom|center_horizontal"
14-
app:mapbox_scaleBarIsMetricUnits="true"
14+
app:mapbox_scaleBarDistanceUnits="metric"
1515
app:mapbox_scaleBarMarginBottom="50dp"
1616
app:mapbox_scaleBarMarginRight="0dp"
1717
app:mapbox_scaleBarPrimaryColor="@android:color/black"

app/src/main/res/layout/generated_test_scalebar.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
mapbox:mapbox_scaleBarTextBorderWidth = "10dp"
1919
mapbox:mapbox_scaleBarTextSize = "10dp"
2020
mapbox:mapbox_scaleBarIsMetricUnits = "false"
21+
mapbox:mapbox_scaleBarDistanceUnits = "imperial"
2122
mapbox:mapbox_scaleBarRefreshInterval = "1000000"
2223
mapbox:mapbox_scaleBarShowTextBorder = "false"
2324
mapbox:mapbox_scaleBarRatio = "0.9"

plugin-attribution/src/test/java/com/mapbox/maps/plugin/attribution/generated/AttributionAttributeParserTest.kt

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin-compass/src/test/java/com/mapbox/maps/plugin/compass/generated/CompassAttributeParserTest.kt

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin-gestures/src/main/res/values/attrs.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
<attr name="mapbox_gesturesRotateDecelerationEnabled" format="boolean"/>
3737
<!-- Whether a deceleration animation following a scroll gesture is enabled. True by default. -->
3838
<attr name="mapbox_gesturesScrollDecelerationEnabled" format="boolean"/>
39-
<!-- Whether rotate threshold increases when pinching to zoom. true by default. -->
39+
<!-- Whether rotate threshold increases when pinching to zoom. true by default.
40+
{@deprecated This property has no effect} -->
4041
<attr name="mapbox_gesturesIncreaseRotateThresholdWhenPinchingToZoom" format="boolean"/>
4142
<!-- Whether pinch to zoom threshold increases when rotating. true by default. -->
4243
<attr name="mapbox_gesturesIncreasePinchToZoomThresholdWhenRotating" format="boolean"/>

plugin-logo/src/test/java/com/mapbox/maps/plugin/logo/generated/LogoAttributeParserTest.kt

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin-scalebar/api/Release/metalava.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
package com.mapbox.maps.plugin.scalebar {
33

44
public final class LocaleUnitResolver {
5+
method public com.mapbox.maps.plugin.DistanceUnits getDistanceUnits();
56
method public boolean isMetricSystem();
7+
property public final com.mapbox.maps.plugin.DistanceUnits distanceUnits;
68
property public final boolean isMetricSystem;
79
field public static final com.mapbox.maps.plugin.scalebar.LocaleUnitResolver INSTANCE;
810
}

0 commit comments

Comments
 (0)