Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add showUserHeading property to GeolocateControl #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/src/interop/ui/control/geolocate_control_interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ class GeolocateControlOptionsJsImpl {
external bool get trackUserLocation;
external bool get showAccuracyCircle;
external bool get showUserLocation;
external bool get showUserHeading;

external factory GeolocateControlOptionsJsImpl({
PositionOptionsJsImpl? positionOptions,
dynamic fitBoundsOptions,
bool? trackUserLocation,
bool? showAccuracyCircle,
bool? showUserLocation,
bool? showUserHeading,
});
}

Expand Down
5 changes: 4 additions & 1 deletion lib/src/ui/control/geolocate_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ class GeolocateControlOptions
bool get trackUserLocation => jsObject.trackUserLocation;
bool get showAccuracyCircle => jsObject.showAccuracyCircle;
bool get showUserLocation => jsObject.showUserLocation;
bool get showUserHeading => jsObject.showUserHeading;

factory GeolocateControlOptions({
required PositionOptions positionOptions,
dynamic fitBoundsOptions,
bool? trackUserLocation,
bool? showAccuracyCircle,
bool? showUserLocation,
bool? showUserHeading,
}) =>
GeolocateControlOptions.fromJsObject(GeolocateControlOptionsJsImpl(
positionOptions: positionOptions.jsObject,
fitBoundsOptions: fitBoundsOptions,
trackUserLocation: trackUserLocation,
showAccuracyCircle: showAccuracyCircle,
showUserLocation: showUserLocation,
showUserHeading: showUserHeading,
));

/// Creates a new MapOptions from a [jsObject].
Expand All @@ -40,7 +43,7 @@ class PositionOptions extends JsObjectWrapper<PositionOptionsJsImpl> {
factory PositionOptions({
bool? enableHighAccuracy,
num? maximumAge,
num? timeout,
num? timeout = 6000,
}) =>
PositionOptions.fromJsObject(PositionOptionsJsImpl(
enableHighAccuracy: enableHighAccuracy,
Expand Down