@@ -793,289 +793,151 @@ export abstract class MapboxViewCommonBase extends ContentView implements Mapbox
793
793
794
794
protected mapbox : MapboxApi ;
795
795
796
- abstract getNativeMapView ( ) : any ;
797
-
798
- // -----------------------------------------------------------------
796
+ telemetry :boolean
799
797
798
+ abstract getNativeMapView ( ) : any ;
800
799
/**
801
800
* map event
802
801
*
803
802
* The base NativeScript ContentView class has on() and off() methods.
804
803
*/
805
804
806
805
public onMapEvent ( eventName , id , callback ) : void {
807
- console . log ( 'MapboxViewCommonBase:on(): top' ) ;
808
806
809
807
return this . mapbox . onMapEvent ( eventName , id , callback , this . getNativeMapView ( ) ) ;
810
808
}
811
-
812
- // -----------------------------------------------------------------
813
-
814
809
public offMapEvent ( eventName , id ) : void {
815
810
return this . mapbox . offMapEvent ( eventName , id , this . getNativeMapView ( ) ) ;
816
811
}
817
-
818
- // -----------------------------------------------------------------
819
-
820
812
addMarkers ( markers : MapboxMarker [ ] ) : Promise < any > {
821
813
return this . mapbox . addMarkers ( markers , this . getNativeMapView ( ) ) ;
822
814
}
823
-
824
- // -----------------------------------------------------------------
825
-
826
815
removeMarkers ( options ?: any ) : Promise < any > {
827
816
return this . mapbox . removeMarkers ( options , this . getNativeMapView ( ) ) ;
828
817
}
829
-
830
- // -----------------------------------------------------------------
831
-
832
818
setOnMapClickListener ( listener : ( data : LatLng ) => boolean ) : Promise < any > {
833
819
return this . mapbox . setOnMapClickListener ( listener , this . getNativeMapView ( ) ) ;
834
820
}
835
-
836
- // -----------------------------------------------------------------
837
-
838
821
setOnMapLongClickListener ( listener : ( data : LatLng ) => boolean ) : Promise < any > {
839
822
return this . mapbox . setOnMapLongClickListener ( listener , this . getNativeMapView ( ) ) ;
840
823
}
841
-
842
- // -----------------------------------------------------------------
843
-
844
824
setOnScrollListener ( listener : ( data ?: LatLng ) => void , nativeMap ?: any ) : Promise < void > {
845
825
return this . mapbox . setOnScrollListener ( listener , this . getNativeMapView ( ) ) ;
846
826
}
847
-
848
- // -----------------------------------------------------------------
849
-
850
827
setOnMoveBeginListener ( listener : ( data ?: LatLng ) => void , nativeMap ?: any ) : Promise < void > {
851
828
return this . mapbox . setOnMoveBeginListener ( listener , this . getNativeMapView ( ) ) ;
852
829
}
853
-
854
- // -----------------------------------------------------------------
855
-
856
830
setOnFlingListener ( listener : ( ) => void , nativeMap ?: any ) : Promise < any > {
857
831
return this . mapbox . setOnFlingListener ( listener , this . getNativeMapView ( ) ) ;
858
832
}
859
-
860
- // -----------------------------------------------------------------
861
-
862
833
setOnCameraMoveListener ( listener : ( ) => void , nativeMap ?: any ) : Promise < any > {
863
834
return this . mapbox . setOnCameraMoveListener ( listener , this . getNativeMapView ( ) ) ;
864
835
}
865
-
866
- // -----------------------------------------------------------------
867
-
868
836
setOnCameraMoveCancelListener ( listener : ( ) => void , nativeMap ?: any ) : Promise < any > {
869
837
return this . mapbox . setOnCameraMoveCancelListener ( listener , this . getNativeMapView ( ) ) ;
870
838
}
871
-
872
- // -----------------------------------------------------------------
873
-
874
839
setOnCameraIdleListener ( listener : ( ) => void , nativeMap ?: any ) : Promise < any > {
875
840
return this . mapbox . setOnCameraIdleListener ( listener , this . getNativeMapView ( ) ) ;
876
841
}
877
-
878
- // -----------------------------------------------------------------
879
-
880
842
getViewport ( ) : Promise < Viewport > {
881
843
return this . mapbox . getViewport ( this . getNativeMapView ( ) ) ;
882
844
}
883
-
884
- // -----------------------------------------------------------------
885
-
886
845
setViewport ( options : SetViewportOptions ) : Promise < any > {
887
846
return this . mapbox . setViewport ( options , this . getNativeMapView ( ) ) ;
888
847
}
889
-
890
- // -----------------------------------------------------------------
891
-
892
848
setMapStyle ( style : string | MapStyle ) : Promise < any > {
893
849
return this . mapbox . setMapStyle ( style , this . getNativeMapView ( ) ) ;
894
850
}
895
-
896
- // -----------------------------------------------------------------
897
-
898
851
getCenter ( ) : Promise < LatLng > {
899
852
return this . mapbox . getCenter ( this . getNativeMapView ( ) ) ;
900
853
}
901
-
902
- // -----------------------------------------------------------------
903
-
904
854
setCenter ( options : SetCenterOptions ) : Promise < any > {
905
855
return this . mapbox . setCenter ( options , this . getNativeMapView ( ) ) ;
906
856
}
907
-
908
- // -----------------------------------------------------------------
909
-
910
857
getZoomLevel ( ) : Promise < number > {
911
858
return this . mapbox . getZoomLevel ( this . getNativeMapView ( ) ) ;
912
859
}
913
-
914
- // -----------------------------------------------------------------
915
-
916
860
setZoomLevel ( options : SetZoomLevelOptions ) : Promise < any > {
917
861
return this . mapbox . setZoomLevel ( options , this . getNativeMapView ( ) ) ;
918
862
}
919
-
920
- // -----------------------------------------------------------------
921
-
922
863
getTilt ( ) : Promise < number > {
923
864
return this . mapbox . getTilt ( this . getNativeMapView ( ) ) ;
924
865
}
925
-
926
- // -----------------------------------------------------------------
927
-
928
866
setTilt ( options : SetTiltOptions ) : Promise < any > {
929
867
return this . mapbox . setTilt ( options , this . getNativeMapView ( ) ) ;
930
868
}
931
-
932
- // -----------------------------------------------------------------
933
-
934
869
getUserLocation ( ) : Promise < UserLocation > {
935
870
return this . mapbox . getUserLocation ( this . getNativeMapView ( ) ) ;
936
871
}
937
-
938
- // -----------------------------------------------------------------
939
-
940
872
showUserLocationMarker ( options ) : void {
941
873
this . mapbox . showUserLocationMarker ( options , this . getNativeMapView ( ) ) ;
942
874
}
943
-
944
- // -----------------------------------------------------------------
945
-
946
875
hideUserLocationMarker ( ) : void {
947
876
this . mapbox . hideUserLocationMarker ( this . getNativeMapView ( ) ) ;
948
877
}
949
-
950
- // -----------------------------------------------------------------
951
-
952
878
changeUserLocationMarkerMode ( renderModeString , cameraModeString : UserLocationCameraMode ) : void {
953
879
this . mapbox . changeUserLocationMarkerMode ( renderModeString , cameraModeString , this . getNativeMapView ( ) ) ;
954
880
}
955
-
956
- // -----------------------------------------------------------------
957
-
958
881
forceUserLocationUpdate ( location ) : void {
959
882
this . mapbox . forceUserLocationUpdate ( location , this . getNativeMapView ( ) ) ;
960
883
}
961
-
962
- // -----------------------------------------------------------------
963
-
964
884
trackUser ( options : TrackUserOptions ) : Promise < any > {
965
885
return this . mapbox . trackUser ( options , this . getNativeMapView ( ) ) ;
966
886
}
967
-
968
- // -----------------------------------------------------------------
969
-
970
887
addSource ( id : string , options : AddSourceOptions ) : Promise < any > {
971
888
return this . mapbox . addSource ( id , options , this . getNativeMapView ( ) ) ;
972
889
}
973
-
974
890
removeSource ( id : string ) : Promise < any > {
975
891
return this . mapbox . removeSource ( id , this . getNativeMapView ( ) ) ;
976
892
}
977
-
978
- // -----------------------------------------------------------------
979
-
980
893
addLayer ( style ) : Promise < any > {
981
894
return this . mapbox . addLayer ( style , this . getNativeMapView ( ) ) ;
982
895
}
983
-
984
- // -----------------------------------------------------------------
985
-
986
896
removeLayer ( id : string ) : Promise < any > {
987
897
return this . mapbox . removeLayer ( id , this . getNativeMapView ( ) ) ;
988
898
}
989
-
990
- // -----------------------------------------------------------------
991
-
992
899
addLinePoint ( id : string , point ) : Promise < any > {
993
900
return this . mapbox . addLinePoint ( id , point , this . getNativeMapView ( ) ) ;
994
901
}
995
-
996
- // -----------------------------------------------------------------
997
-
998
902
queryRenderedFeatures ( options : QueryRenderedFeaturesOptions ) : Promise < Feature [ ] > {
999
903
return this . mapbox . queryRenderedFeatures ( options , this . getNativeMapView ( ) ) ;
1000
904
}
1001
-
1002
- // -----------------------------------------------------------------
1003
-
1004
905
addPolygon ( options : AddPolygonOptions ) : Promise < any > {
1005
906
return this . mapbox . addPolygon ( options , this . getNativeMapView ( ) ) ;
1006
907
}
1007
-
1008
- // -----------------------------------------------------------------
1009
-
1010
908
removePolygons ( ids ?: any [ ] ) : Promise < any > {
1011
909
return this . mapbox . removePolygons ( ids , this . getNativeMapView ( ) ) ;
1012
910
}
1013
-
1014
- // -----------------------------------------------------------------
1015
-
1016
911
addPolyline ( options : AddPolylineOptions ) : Promise < any > {
1017
912
return this . mapbox . addPolyline ( options , this . getNativeMapView ( ) ) ;
1018
913
}
1019
-
1020
- // -----------------------------------------------------------------
1021
-
1022
914
removePolylines ( ids ?: any [ ] ) : Promise < any > {
1023
915
return this . mapbox . removePolylines ( ids , this . getNativeMapView ( ) ) ;
1024
916
}
1025
-
1026
- // -----------------------------------------------------------------
1027
-
1028
917
animateCamera ( options : AnimateCameraOptions ) : Promise < any > {
1029
918
return this . mapbox . animateCamera ( options , this . getNativeMapView ( ) ) ;
1030
919
}
1031
-
1032
- // -----------------------------------------------------------------
1033
-
1034
920
destroy ( ) : Promise < any > {
1035
921
return this . mapbox . destroy ( this . getNativeMapView ( ) ) ;
1036
922
}
1037
-
1038
- // -----------------------------------------------------------------
1039
-
1040
923
onStart ( ) : Promise < any > {
1041
924
return this . mapbox . onStart ( this . getNativeMapView ( ) ) ;
1042
925
}
1043
-
1044
- // -----------------------------------------------------------------
1045
-
1046
926
onResume ( nativeMap ?: any ) : Promise < any > {
1047
- console . log ( 'MapboxViewCommonBase:onResume(): with nativeView:' , this . getNativeMapView ( ) ) ;
1048
-
1049
927
return this . mapbox . onResume ( this . getNativeMapView ( ) ) ;
1050
928
}
1051
-
1052
- // -----------------------------------------------------------------
1053
-
1054
929
onPause ( nativeMap ?: any ) : Promise < any > {
1055
- console . log ( 'MapboxViewCommonBase:onPause(): with nativeView:' , this . getNativeMapView ( ) ) ;
1056
-
1057
930
return this . mapbox . onPause ( this . getNativeMapView ( ) ) ;
1058
931
}
1059
-
1060
- // -----------------------------------------------------------------
1061
-
1062
932
onStop ( nativeMap ?: any ) : Promise < any > {
1063
933
return this . mapbox . onStop ( this . getNativeMapView ( ) ) ;
1064
934
}
1065
-
1066
- // -----------------------------------------------------------------
1067
-
1068
935
onLowMemory ( nativeMap ?: any ) : Promise < any > {
1069
936
return this . mapbox . onLowMemory ( this . getNativeMapView ( ) ) ;
1070
937
}
1071
-
1072
- // -----------------------------------------------------------------
1073
-
1074
938
onDestroy ( nativeMap ?: any ) : Promise < any > {
1075
939
return this . mapbox . onDestroy ( this . getNativeMapView ( ) ) ;
1076
940
}
1077
-
1078
- // onSaveInstanceState( Bundle outState)
1079
941
}
1080
942
1081
943
// -----------------------------------------------------------------
@@ -1125,6 +987,13 @@ export const hideAttributionProperty = new Property<MapboxViewCommonBase, boolea
1125
987
} ) ;
1126
988
hideAttributionProperty . register ( MapboxViewCommonBase ) ;
1127
989
990
+ export const telemetryProperty = new Property < MapboxViewCommonBase , boolean > ( {
991
+ name : 'telemetry' ,
992
+ defaultValue : false ,
993
+ valueConverter : booleanConverter ,
994
+ } ) ;
995
+ telemetryProperty . register ( MapboxViewCommonBase ) ;
996
+
1128
997
export const hideCompassProperty = new Property < MapboxViewCommonBase , boolean > ( {
1129
998
name : 'hideCompass' ,
1130
999
defaultValue : MapboxCommon . defaults . hideCompass ,
@@ -1194,13 +1063,11 @@ export abstract class MapboxViewBase extends MapboxViewCommonBase {
1194
1063
}
1195
1064
1196
1065
[ mapStyleProperty . setNative ] ( value : string ) {
1197
- console . log ( "MapboxViewBase::mapStyle.setNative(): setting value '" + value + "'" ) ;
1198
1066
this . config . style = value ;
1199
1067
this . config . mapStyle = value ;
1200
1068
}
1201
1069
1202
1070
[ accessTokenProperty . setNative ] ( value : string ) {
1203
- console . log ( "MapboxViewBase::accessTokenProperty.setNative(): setting value '" + value + "'" ) ;
1204
1071
this . config . accessToken = value ;
1205
1072
}
1206
1073
0 commit comments