@@ -581,21 +581,6 @@ const _getMapStyle = (input: any): NSURL => {
581
581
}
582
582
} ;
583
583
584
- function _getTrackingMode ( input : UserLocationCameraMode ) : MGLUserTrackingMode {
585
- /*
586
- if (input === "FOLLOW") {
587
- return MGLUserTrackingMode.Follow;
588
- } else if (input === "FOLLOW_WITH_HEADING") {
589
- return MGLUserTrackingMode.FollowWithHeading;
590
- } else if (input === "FOLLOW_WITH_COURSE") {
591
- return MGLUserTrackingMode.FollowWithCourse;
592
- } else {
593
- return MGLUserTrackingMode.None;
594
- }
595
- */
596
- return MGLUserTrackingMode . None ;
597
- }
598
-
599
584
function _getLocation ( loc : MGLUserLocation ) {
600
585
if ( loc === null ) {
601
586
return null ;
@@ -1775,35 +1760,36 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
1775
1760
* @todo come up with a reasonable set of cross platform defaults.
1776
1761
*/
1777
1762
_stringToCameraMode ( mode : UserLocationCameraMode ) : any {
1778
- switch ( mode ) {
1779
- case ' NONE' :
1763
+ switch ( mode ) {
1764
+ case " NONE" :
1780
1765
return MGLUserTrackingMode . None ;
1781
1766
1782
- case 'NONE_COMPASS' :
1783
- if ( Trace . isEnabled ( ) ) {
1784
- CLog ( CLogTypes . info , '_stringToCameraMode(): NONE_COMPASS unsupported on iOS' ) ;
1785
- }
1767
+ case "NONE_COMPASS" :
1768
+ console . log ( "MapboxView::_stringToCameraMode(): NONE_COMPASS unsupported on iOS" ) ;
1786
1769
return MGLUserTrackingMode . None ;
1787
1770
1788
- case 'NONE_GPS' :
1789
- if ( Trace . isEnabled ( ) ) {
1790
- CLog ( CLogTypes . info , '_stringToCameraMode(): NONE_GPS unsupported on iOS' ) ;
1791
- }
1771
+ case "NONE_GPS" :
1772
+ console . log ( "MapboxView::_stringToCameraMode(): NONE_GPS unsupported on iOS" ) ;
1792
1773
return MGLUserTrackingMode . None ;
1793
1774
1794
- case ' TRACKING' :
1775
+ case " TRACKING" :
1795
1776
return MGLUserTrackingMode . Follow ;
1796
1777
1797
- case ' TRACKING_COMPASS' :
1778
+ case " TRACKING_COMPASS" :
1798
1779
return MGLUserTrackingMode . FollowWithHeading ;
1799
1780
1800
- case ' TRACKING_GPS' :
1781
+ case " TRACKING_GPS" :
1801
1782
// a reasonable approximation.
1802
1783
return MGLUserTrackingMode . Follow ;
1803
1784
1804
- case ' TRACKING_GPS_NORTH' :
1785
+ case " TRACKING_GPS_NORTH" :
1805
1786
return MGLUserTrackingMode . FollowWithCourse ;
1787
+
1788
+ default :
1789
+ console . log ( `_stringToCameraMode: invalid cameraMode: ${ mode } ` ) ;
1806
1790
}
1791
+
1792
+ return MGLUserTrackingMode . None ;
1807
1793
}
1808
1794
1809
1795
_stringToRenderMode ( mode ) : any {
@@ -3095,7 +3081,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
3095
3081
return ;
3096
3082
}
3097
3083
3098
- theMap . setUserTrackingModeAnimated ( _getTrackingMode ( options . cameraMode ) , options . animated !== false ) ;
3084
+ theMap . setUserTrackingModeAnimated ( this . _stringToCameraMode ( options . cameraMode ) , options . animated !== false ) ;
3099
3085
3100
3086
resolve ( ) ;
3101
3087
} catch ( ex ) {
0 commit comments