You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add compass accuracy threshold for iOS (#422)
Introduce compassAccuracyThreshold option (default 45, in degrees) to filter inaccurate iOS compass readings using webkitCompassAccuracy. Uncalibrated readings (-1) are always rejected. Set to false to disable filtering. Has no effect on Android, which exposes no standardized accuracy field.
Adds tests for accuracy filtering behavior and a TypeScript declaration for the new option.
Refs #332
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,7 @@ Possible options are listed in the following table. More details are [in the cod
104
104
|`returnToPrevBounds`|`boolean`| If set, save the map bounds just before centering to the user's location. When control is disabled, set the view back to the bounds that were saved. |`false`|
105
105
|`cacheLocation`|`boolean`| Keep a cache of the location after the user deactivates the control. If set to false, the user has to wait until the locate API returns a new location before they see where they are again. |`true`|
106
106
|`showCompass`|`boolean`| Show the compass bearing on top of the location marker |`true`|
107
+
|`compassAccuracyThreshold`|`number` or `false`| Maximum allowed iOS compass accuracy in degrees (`webkitCompassAccuracy`) for displaying the compass. `-1` (uncalibrated) is always rejected. Set to `false` to always show the compass when heading data is available. |`45`|
107
108
|`drawCircle`|`boolean`| If set, a circle that shows the location accuracy is drawn. |`true`|
108
109
|`drawMarker`|`boolean`| If set, the marker at the users' location is drawn. |`true`|
109
110
|`markerClass`|`class`| The class to be used to create the marker. |`LocationMarker`|
0 commit comments