Skip to content

Commit 6d4cd87

Browse files
committed
Update module version
1 parent 34edbfb commit 6d4cd87

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

Static/lib/azure-maps/azure-maps-geolocation-control.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ MIT License
560560
var self = this;
561561
var o = self._options;
562562
if (options) {
563+
var trackingChanged = false;
563564
if (options.style) {
564565
var color = 'white';
565566
if (self._hclStyle) {
@@ -615,9 +616,6 @@ MIT License
615616
self._onGpsSuccess();
616617
}
617618
}
618-
if (typeof options.trackUserLocation === 'boolean') {
619-
o.trackUserLocation = options.trackUserLocation;
620-
}
621619
if (options.positionOptions) {
622620
var opt = {};
623621
if (options.positionOptions.enableHighAccuracy) {
@@ -631,8 +629,7 @@ MIT License
631629
}
632630
if (Object.keys(opt).length > 0) {
633631
o.positionOptions = Object.assign(o.positionOptions, opt);
634-
self._stopTracking();
635-
self._updateState();
632+
trackingChanged = true;
636633
}
637634
}
638635
if (typeof options.enableCompass === 'boolean') {
@@ -653,6 +650,14 @@ MIT License
653650
if (typeof options.compassEventThrottleDelay === 'number' && options.compassEventThrottleDelay >= 100) {
654651
o.compassEventThrottleDelay = options.compassEventThrottleDelay;
655652
}
653+
if (typeof options.trackUserLocation === 'boolean') {
654+
o.trackUserLocation = options.trackUserLocation;
655+
trackingChanged = true;
656+
}
657+
if (o.trackUserLocation && trackingChanged) {
658+
self._stopTracking();
659+
self._updateState();
660+
}
656661
}
657662
};
658663
/**

0 commit comments

Comments
 (0)