@rnmapbox/maps 10.3.0-rc.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewContent.kt +55 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewContentManager.kt +7 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt +0 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/location/RNMBXNativeUserLocationManager.kt +25 -24
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/NativeMapViewModule.kt +3 -2
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt +57 -39
- package/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt +0 -9
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/atmosphere/RNMBXAtmosphere.kt +4 -4
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/atmosphere/RNMBXAtmosphereManager.kt +2 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/light/RNMBXLightManager.kt +2 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXSource.kt +2 -6
- package/android/src/main/java/com/rnmapbox/rnmbx/components/styles/terrain/RNMBXTerrainManager.kt +2 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/events/FeatureClickEvent.java +5 -6
- package/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXModule.kt +1 -0
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/ConvertUtils.kt +0 -30
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/Dynamic.kt +3 -1
- package/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableArray.kt +16 -14
- package/ios/RNMBX/RNMBXMapViewModule.mm +1 -1
- package/ios/RNMBX/RNMBXModule.swift +1 -0
- package/lib/module/Mapbox.native.js.map +1 -1
- package/lib/module/components/MapView.js +95 -113
- package/lib/module/components/MapView.js.map +1 -1
- package/lib/module/components/MarkerView.js +93 -76
- package/lib/module/components/MarkerView.js.map +1 -1
- package/lib/module/modules/offline/offlineManager.js +2 -12
- package/lib/module/modules/offline/offlineManager.js.map +1 -1
- package/lib/module/specs/RNMBXMarkerViewContentNativeComponent.ts +13 -1
- package/lib/typescript/src/Mapbox.native.d.ts +1 -1
- package/lib/typescript/src/Mapbox.native.d.ts.map +1 -1
- package/lib/typescript/src/components/Camera.d.ts +2 -2
- package/lib/typescript/src/components/Camera.d.ts.map +1 -1
- package/lib/typescript/src/components/MapView.d.ts +53 -41
- package/lib/typescript/src/components/MapView.d.ts.map +1 -1
- package/lib/typescript/src/components/MarkerView.d.ts +10 -17
- package/lib/typescript/src/components/MarkerView.d.ts.map +1 -1
- package/lib/typescript/src/modules/offline/offlineManager.d.ts.map +1 -1
- package/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts +6 -0
- package/lib/typescript/src/specs/RNMBXMarkerViewContentNativeComponent.d.ts.map +1 -1
- package/package.json +1 -1
- package/setup-jest.js +1 -1
- package/src/Mapbox.native.ts +5 -1
- package/src/components/Camera.tsx +2 -2
- package/src/components/MapView.tsx +137 -154
- package/src/components/MarkerView.tsx +118 -95
- package/src/modules/offline/offlineManager.ts +2 -14
- package/src/specs/RNMBXMarkerViewContentNativeComponent.ts +13 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {
|
|
3
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { PixelRatio, StyleSheet } from 'react-native';
|
|
5
5
|
import RNMBXMakerViewContentComponent from '../specs/RNMBXMarkerViewContentNativeComponent';
|
|
6
6
|
import NativeMarkerViewComponent from '../specs/RNMBXMarkerViewNativeComponent';
|
|
7
|
-
import { toJSONString } from "../utils/index.js";
|
|
8
|
-
import { makePoint } from "../utils/geoUtils.js";
|
|
9
|
-
import PointAnnotation from "./PointAnnotation.js";
|
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
|
|
8
|
+
// Device pixel ratio is constant for the lifetime of the app.
|
|
9
|
+
const PIXEL_RATIO = PixelRatio.get();
|
|
10
|
+
const DEFAULT_ANCHOR = {
|
|
11
|
+
x: 0.5,
|
|
12
|
+
y: 0.5
|
|
13
|
+
};
|
|
12
14
|
/**
|
|
13
15
|
* MarkerView represents an interactive React Native marker on the map.
|
|
14
16
|
*
|
|
@@ -19,79 +21,94 @@ const Mapbox = NativeModules.RNMBXModule;
|
|
|
19
21
|
* This is implemented with view annotations on [Android](https://docs.mapbox.com/android/maps/guides/annotations/view-annotations/)
|
|
20
22
|
* and [iOS](https://docs.mapbox.com/ios/maps/guides/annotations/view-annotations).
|
|
21
23
|
*
|
|
22
|
-
* This component has no dedicated `onPress` method. Instead,
|
|
23
|
-
* with the React views passed in as `children
|
|
24
|
+
* This component has no dedicated `onPress` method. Instead, handle gestures
|
|
25
|
+
* with the React views passed in as `children` — Pressable, TouchableOpacity,
|
|
26
|
+
* etc. all work including their visual feedback (opacity, scale, etc.).
|
|
24
27
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, this.props.style],
|
|
70
|
-
coordinate: [Number(this.props.coordinate[0]), Number(this.props.coordinate[1])],
|
|
71
|
-
anchor: anchor,
|
|
72
|
-
allowOverlap: this.props.allowOverlap,
|
|
73
|
-
allowOverlapWithPuck: this.props.allowOverlapWithPuck,
|
|
74
|
-
isSelected: this.props.isSelected,
|
|
75
|
-
onTouchEnd: e => {
|
|
76
|
-
e.stopPropagation();
|
|
77
|
-
},
|
|
78
|
-
children: /*#__PURE__*/_jsx(RNMBXMakerViewContentComponent, {
|
|
79
|
-
collapsable: false,
|
|
80
|
-
style: {
|
|
81
|
-
flex: 0,
|
|
82
|
-
alignSelf: 'flex-start'
|
|
83
|
-
},
|
|
84
|
-
onStartShouldSetResponder: _event => {
|
|
85
|
-
return true;
|
|
86
|
-
},
|
|
87
|
-
onTouchEnd: e => {
|
|
88
|
-
e.stopPropagation();
|
|
89
|
-
},
|
|
90
|
-
children: this.props.children
|
|
91
|
-
})
|
|
28
|
+
const MarkerView = ({
|
|
29
|
+
anchor = DEFAULT_ANCHOR,
|
|
30
|
+
allowOverlap = false,
|
|
31
|
+
allowOverlapWithPuck = false,
|
|
32
|
+
isSelected = false,
|
|
33
|
+
coordinate,
|
|
34
|
+
style,
|
|
35
|
+
children
|
|
36
|
+
}) => {
|
|
37
|
+
// Android new-arch (Fabric) fix: UIManager.measure reads from the Fabric shadow
|
|
38
|
+
// tree, which doesn't include Mapbox's native setTranslationX/Y positioning.
|
|
39
|
+
// Strategy: intercept setTranslationX/Y on the native side (see
|
|
40
|
+
// RNMBXMarkerViewContent.kt), relay the values as an onAnnotationPosition event,
|
|
41
|
+
// then apply them as a React `transform` on RNMBXMarkerView so the shadow tree
|
|
42
|
+
// reflects the actual on-screen position. This makes
|
|
43
|
+
// Pressability._responderRegion correct and onPress / touch feedback work.
|
|
44
|
+
//
|
|
45
|
+
// Key details:
|
|
46
|
+
// • position:'absolute' on RNMBXMarkerView → all markers have Yoga pos (0,0)
|
|
47
|
+
// in MapView, so the only shadow-tree offset is the transform itself.
|
|
48
|
+
// • Transform goes on RNMBXMarkerView (not RNMBXMarkerViewContent) so Fabric
|
|
49
|
+
// never fights Mapbox's native positioning.
|
|
50
|
+
// • PIXEL_RATIO: Android translationX/Y is in device pixels; React transform
|
|
51
|
+
// expects logical pixels (points).
|
|
52
|
+
const [annotationTranslate, setAnnotationTranslate] = useState(null);
|
|
53
|
+
|
|
54
|
+
// Mirror of Kotlin-side dedup: skip setState when position hasn't changed so
|
|
55
|
+
// we don't trigger a re-render for no-op native position re-applications.
|
|
56
|
+
const lastTranslateRef = useRef(null);
|
|
57
|
+
const handleTouchEnd = useCallback(e => {
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
}, []);
|
|
60
|
+
const handleAnnotationPosition = useCallback(e => {
|
|
61
|
+
const x = e.nativeEvent.x / PIXEL_RATIO;
|
|
62
|
+
const y = e.nativeEvent.y / PIXEL_RATIO;
|
|
63
|
+
const last = lastTranslateRef.current;
|
|
64
|
+
if (last !== null && last.x === x && last.y === y) return;
|
|
65
|
+
lastTranslateRef.current = {
|
|
66
|
+
x,
|
|
67
|
+
y
|
|
68
|
+
};
|
|
69
|
+
setAnnotationTranslate({
|
|
70
|
+
x,
|
|
71
|
+
y
|
|
92
72
|
});
|
|
73
|
+
}, []);
|
|
74
|
+
if (anchor.x < 0 || anchor.y < 0 || anchor.x > 1 || anchor.y > 1) {
|
|
75
|
+
console.warn(`[MarkerView] Anchor with value (${anchor.x}, ${anchor.y}) should not be outside the range [(0, 0), (1, 1)]`);
|
|
93
76
|
}
|
|
94
|
-
|
|
77
|
+
const nativeCoordinate = useMemo(() => [Number(coordinate[0]), Number(coordinate[1])],
|
|
78
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
+
[coordinate[0], coordinate[1]]);
|
|
80
|
+
const nativeStyle = useMemo(() => [styles.absolutePosition, style, annotationTranslate != null ? {
|
|
81
|
+
transform: [{
|
|
82
|
+
translateX: annotationTranslate.x
|
|
83
|
+
}, {
|
|
84
|
+
translateY: annotationTranslate.y
|
|
85
|
+
}]
|
|
86
|
+
} : undefined], [style, annotationTranslate]);
|
|
87
|
+
return /*#__PURE__*/_jsx(RNMBXMarkerView, {
|
|
88
|
+
style: nativeStyle,
|
|
89
|
+
coordinate: nativeCoordinate,
|
|
90
|
+
anchor: anchor,
|
|
91
|
+
allowOverlap: allowOverlap,
|
|
92
|
+
allowOverlapWithPuck: allowOverlapWithPuck,
|
|
93
|
+
isSelected: isSelected,
|
|
94
|
+
onTouchEnd: handleTouchEnd,
|
|
95
|
+
children: /*#__PURE__*/_jsx(RNMBXMakerViewContentComponent, {
|
|
96
|
+
collapsable: false,
|
|
97
|
+
style: styles.contentContainer,
|
|
98
|
+
onAnnotationPosition: handleAnnotationPosition,
|
|
99
|
+
children: children
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
};
|
|
95
103
|
const RNMBXMarkerView = NativeMarkerViewComponent;
|
|
104
|
+
const styles = StyleSheet.create({
|
|
105
|
+
absolutePosition: {
|
|
106
|
+
position: 'absolute'
|
|
107
|
+
},
|
|
108
|
+
contentContainer: {
|
|
109
|
+
flex: 0,
|
|
110
|
+
alignSelf: 'flex-start'
|
|
111
|
+
}
|
|
112
|
+
});
|
|
96
113
|
export default MarkerView;
|
|
97
114
|
//# sourceMappingURL=MarkerView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","useRef","useState","PixelRatio","StyleSheet","RNMBXMakerViewContentComponent","NativeMarkerViewComponent","jsx","_jsx","PIXEL_RATIO","get","DEFAULT_ANCHOR","x","y","MarkerView","anchor","allowOverlap","allowOverlapWithPuck","isSelected","coordinate","style","children","annotationTranslate","setAnnotationTranslate","lastTranslateRef","handleTouchEnd","e","stopPropagation","handleAnnotationPosition","nativeEvent","last","current","console","warn","nativeCoordinate","Number","nativeStyle","styles","absolutePosition","transform","translateX","translateY","undefined","RNMBXMarkerView","onTouchEnd","collapsable","contentContainer","onAnnotationPosition","create","position","flex","alignSelf"],"sourceRoot":"../../../src","sources":["components/MarkerView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SACEC,UAAU,EACVC,UAAU,QAGL,cAAc;AAErB,OAAOC,8BAA8B,MAAM,gDAAgD;AAC3F,OAAOC,yBAAyB,MAAM,yCAAyC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhF;AACA,MAAMC,WAAW,GAAGN,UAAU,CAACO,GAAG,CAAC,CAAC;AAEpC,MAAMC,cAAc,GAAG;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE;AAAI,CAAC;AAsCzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAGA,CAAC;EAClBC,MAAM,GAAGJ,cAAc;EACvBK,YAAY,GAAG,KAAK;EACpBC,oBAAoB,GAAG,KAAK;EAC5BC,UAAU,GAAG,KAAK;EAClBC,UAAU;EACVC,KAAK;EACLC;AACK,CAAC,KAAK;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,CAACC,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGrB,QAAQ,CAGpD,IAAI,CAAC;;EAEf;EACA;EACA,MAAMsB,gBAAgB,GAAGvB,MAAM,CAAkC,IAAI,CAAC;EAEtE,MAAMwB,cAAc,GAAG1B,WAAW,CAAE2B,CAAkC,IAAK;IACzEA,CAAC,CAACC,eAAe,CAAC,CAAC;EACrB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,wBAAwB,GAAG7B,WAAW,CACzC2B,CAAi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C,CAAC,GACD6B,SAAS,CACd,EACD,CAACtB,KAAK,EAAEE,mBAAmB,CAC7B,CAAC;EAED,oBACEd,IAAA,CAACmC,eAAe;IACdvB,KAAK,EAAEgB,WAAY;IACnBjB,UAAU,EAAEe,gBAAiB;IAC7BnB,MAAM,EAAEA,MAAO;IACfC,YAAY,EAAEA,YAAa;IAC3BC,oBAAoB,EAAEA,oBAAqB;IAC3CC,UAAU,EAAEA,UAAW;IACvB0B,UAAU,EAAEnB,cAAe;IAAAJ,QAAA,eAE3Bb,IAAA,CAACH,8BAA8B;MAC7BwC,WAAW,EAAE,KAAM;MACnBzB,KAAK,EAAEiB,MAAM,CAACS,gBAAiB;MAC/BC,oBAAoB,EAAEnB,wBAAyB;MAAAP,QAAA,EAE9CA;IAAQ,CACqB;EAAC,CAClB,CAAC;AAEtB,CAAC;AAED,MAAMsB,eAAe,GAAGrC,yBAAyB;AAEjD,MAAM+B,MAAM,GAAGjC,UAAU,CAAC4C,MAAM,CAAC;EAC/BV,gBAAgB,EAAE;IAAEW,QAAQ,EAAE;EAAW,CAAC;EAC1CH,gBAAgB,EAAE;IAAEI,IAAI,EAAE,CAAC;IAAEC,SAAS,EAAE;EAAa;AACvD,CAAC,CAAC;AAEF,eAAerC,UAAU","ignoreList":[]}
|
|
@@ -116,12 +116,7 @@ class OfflineManager {
|
|
|
116
116
|
* @return {void}
|
|
117
117
|
*/
|
|
118
118
|
async invalidateAmbientCache() {
|
|
119
|
-
|
|
120
|
-
console.warn('RNMapbox: invalidateAmbientCache is not implemented on v10');
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
await this._initialize();
|
|
124
|
-
await MapboxOfflineManager.invalidateAmbientCache();
|
|
119
|
+
console.warn('RNMapbox: invalidateAmbientCache is not implemented on v10');
|
|
125
120
|
}
|
|
126
121
|
|
|
127
122
|
/**
|
|
@@ -136,12 +131,7 @@ class OfflineManager {
|
|
|
136
131
|
* @return {void}
|
|
137
132
|
*/
|
|
138
133
|
async clearAmbientCache() {
|
|
139
|
-
|
|
140
|
-
console.warn('RNMapbox: clearAmbientCache is not implemented on v10');
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
await this._initialize();
|
|
144
|
-
await MapboxOfflineManager.clearAmbientCache();
|
|
134
|
+
console.warn('RNMapbox: clearAmbientCache is not implemented on v10');
|
|
145
135
|
}
|
|
146
136
|
|
|
147
137
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","NativeEventEmitter","isUndefined","isFunction","isAndroid","default","OfflineCreatePackOptions","OfflinePack","RNMBXModule","MapboxOfflineManager","RNMBXOfflineModule","OfflineModuleEventEmitter","OfflineManager","constructor","_hasInitialized","_offlinePacks","_progressListeners","_errorListeners","_onProgress","bind","_onError","subscriptionProgress","subscriptionError","createPack","options","progressListener","errorListener","_initialize","packOptions","name","Error","subscribe","nativeOfflinePack","invalidatePack","offlinePack","deletePack","invalidateAmbientCache","
|
|
1
|
+
{"version":3,"names":["NativeModules","NativeEventEmitter","isUndefined","isFunction","isAndroid","default","OfflineCreatePackOptions","OfflinePack","RNMBXModule","MapboxOfflineManager","RNMBXOfflineModule","OfflineModuleEventEmitter","OfflineManager","constructor","_hasInitialized","_offlinePacks","_progressListeners","_errorListeners","_onProgress","bind","_onError","subscriptionProgress","subscriptionError","createPack","options","progressListener","errorListener","_initialize","packOptions","name","Error","subscribe","nativeOfflinePack","invalidatePack","offlinePack","deletePack","invalidateAmbientCache","console","warn","clearAmbientCache","migrateOfflineCache","setMaximumAmbientCacheSize","size","resetDatabase","getPacks","Object","keys","map","getPack","mergeOfflineRegions","path","setTileCountLimit","limit","setProgressEventThrottle","throttleValue","packName","totalProgressListeners","length","addListener","OfflineCallbackName","Progress","totalErrorListeners","setPackObserver","e","log","unsubscribe","remove","forceInit","nativeOfflinePacks","state","payload","_hasListeners","pack","OfflinePackDownloadState","Complete","listenerMap","offlineManager"],"sourceRoot":"../../../../src","sources":["modules/offline/offlineManager.ts"],"mapp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+1,19 @@
|
|
|
1
1
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
2
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
+
// @ts-ignore - CI environment type resolution issue for CodegenTypes
|
|
4
|
+
import { DirectEventHandler, Float } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
type OnAnnotationPositionEvent = {
|
|
7
|
+
x: Float;
|
|
8
|
+
y: Float;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface NativeProps extends ViewProps {
|
|
12
|
+
// Fired by native when Mapbox repositions the annotation via setTranslationX/Y.
|
|
13
|
+
// JS uses this to keep the Fabric shadow tree transform in sync so that
|
|
14
|
+
// UIManager.measure returns the correct on-screen position for Pressable hit-testing.
|
|
15
|
+
onAnnotationPosition?: DirectEventHandler<OnAnnotationPositionEvent>;
|
|
16
|
+
}
|
|
5
17
|
|
|
6
18
|
// @ts-ignore-error - Codegen requires single cast but TypeScript prefers double cast
|
|
7
19
|
export default codegenNativeComponent<NativeProps>(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from './RNMBXModule';
|
|
2
2
|
export { Camera, UserTrackingMode, type CameraPadding, type CameraAnimationMode, type CameraBounds, type CameraStop, } from './components/Camera';
|
|
3
3
|
export { Atmosphere } from './components/Atmosphere';
|
|
4
|
-
export { default as MapView, type MapState } from './components/MapView';
|
|
4
|
+
export { default as MapView, type MapState, type ScreenPointPayload, } from './components/MapView';
|
|
5
5
|
export { default as Light } from './components/Light';
|
|
6
6
|
export { default as PointAnnotation } from './components/PointAnnotation';
|
|
7
7
|
export { default as Annotation } from './components/Annotation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mapbox.native.d.ts","sourceRoot":"","sources":["../../../src/Mapbox.native.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KA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AAI,wBAAwB,EACzD,wBAAwB,IAAI,mBAAmB,EAC/C,yBAAyB,IAAI,oBAAoB,EACjD,kBAAkB,IAAI,aAAa,EACnC,oBAAoB,IAAI,eAAe,EACvC,yBAAyB,IAAI,oBAAoB,EACjD,sBAAsB,IAAI,iBAAiB,EAC3C,oBAAoB,IAAI,eAAe,GACxC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,sBAAsB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,8BAA8B,MAAM,iDAAiD,CAAC;AAG7F,yFAAyF;AAEzF,eAAO,MAAM,gBAAgB,sBAG5B,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,kBAAkB,oIAAe,CAAC;AAG/C,oBAAY,QAAQ;IAClB,MAAM,uCAAuC;IAC7C,IAAI,oCAAoC;IACxC,KAAK,qCAAqC;IAC1C,QAAQ,wCAAwC;IAChD,SAAS,wCAAwC;IACjD,eAAe,iDAAiD;IAChE,UAAU,qDAAqD;IAC/D,YAAY,uDAAuD;CACpE;AAED,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,yBAAmB,CAAC;AAElD,oBAAoB;AAEpB,eAAO,MAAM,cAAc;;;CAG1B,CAAC"}
|
|
@@ -45,9 +45,9 @@ export type CameraStop = {
|
|
|
45
45
|
/** The corners of a box around which the map should bound. Contains padding props for backwards
|
|
46
46
|
* compatibility; the root `padding` prop should be used instead. */
|
|
47
47
|
bounds?: CameraBoundsWithPadding;
|
|
48
|
-
/**
|
|
48
|
+
/** Heading (bearing, orientation) of the map, measured in degrees clockwise from true north. */
|
|
49
49
|
heading?: number;
|
|
50
|
-
/** The pitch
|
|
50
|
+
/** The pitch toward the horizon measured in degrees, with 0 degrees resulting in a top-down view for a two-dimensional map. */
|
|
51
51
|
pitch?: number;
|
|
52
52
|
/** The zoom level of the map. */
|
|
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,EAAE,8BAA8B,CAAC;CAC3D;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,QAAQ,CAAC;IACb,EAAE,EAAE,QAAQ,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC;AAE5E,MAAM,MAAM,WAAW,GAAG;IACxB,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,MAAM,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,0EA8blB,CAAC;AAgBF,MAAM,MAAM,MAAM,GAAG,SAAS,CAAC"}
|
|
@@ -19,6 +19,10 @@ export type RegionPayload = {
|
|
|
19
19
|
visibleBounds: GeoJSON.Position[];
|
|
20
20
|
pitch: number;
|
|
21
21
|
};
|
|
22
|
+
export type ScreenPointPayload = {
|
|
23
|
+
readonly screenPointX: number;
|
|
24
|
+
readonly screenPointY: number;
|
|
25
|
+
};
|
|
22
26
|
export type GestureSettings = {
|
|
23
27
|
/**
|
|
24
28
|
* Whether double tapping the map with one touch results in a zoom-in animation.
|
|
@@ -234,13 +238,13 @@ type Props = ViewProps & {
|
|
|
234
238
|
*/
|
|
235
239
|
gestureSettings?: GestureSettings;
|
|
236
240
|
/**
|
|
237
|
-
* Map press listener,
|
|
241
|
+
* Map press listener, called when a user presses the map.
|
|
238
242
|
*/
|
|
239
|
-
onPress?: (feature: GeoJSON.Feature) => void;
|
|
243
|
+
onPress?: (feature: GeoJSON.Feature<GeoJSON.Point, ScreenPointPayload>) => void;
|
|
240
244
|
/**
|
|
241
|
-
* Map long press listener,
|
|
245
|
+
* Map long press listener, called when a user long presses the map.
|
|
242
246
|
*/
|
|
243
|
-
onLongPress?: (feature: GeoJSON.Feature) => void;
|
|
247
|
+
onLongPress?: (feature: GeoJSON.Feature<GeoJSON.Point, ScreenPointPayload>) => void;
|
|
244
248
|
/**
|
|
245
249
|
* <v10 only
|
|
246
250
|
*
|
|
@@ -343,7 +347,7 @@ type Props = ViewProps & {
|
|
|
343
347
|
_nativeImpl?: NativeMapViewActual;
|
|
344
348
|
};
|
|
345
349
|
declare const CallbablePropKeys: readonly ["onRegionWillChange", "onRegionIsChanging", "onRegionDidChange", "onUserLocationUpdate", "onWillStartLoadingMap", "onMapLoadingError", "onDidFinishLoadingMap", "onDidFailLoadingMap", "onWillStartRenderingFrame", "onDidFinishRenderingFrame", "onDidFinishRenderingFrameFully", "onWillStartRenderingMap", "onDidFinishRenderingMap", "onDidFinishRenderingMapFully", "onDidFinishLoadingStyle", "onMapIdle", "onCameraChanged"];
|
|
346
|
-
type CallbablePropKeys =
|
|
350
|
+
type CallbablePropKeys = typeof CallbablePropKeys[number];
|
|
347
351
|
type Debounced<F> = F & {
|
|
348
352
|
clear(): void;
|
|
349
353
|
flush(): void;
|
|
@@ -416,44 +420,48 @@ declare class MapView extends MapView_base {
|
|
|
416
420
|
componentDidUpdate(prevProps: Props): void;
|
|
417
421
|
_setHandledMapChangedEvents(props: Props): void;
|
|
418
422
|
/**
|
|
419
|
-
* Converts a geographic coordinate to a
|
|
423
|
+
* Converts a geographic coordinate to a screen coordinate relative to the map view.
|
|
420
424
|
*
|
|
421
425
|
* @example
|
|
422
|
-
* const
|
|
426
|
+
* const longitude = 144.949901;
|
|
427
|
+
* const latitude = -37.817070;
|
|
428
|
+
* const [x, y] = await this._map.getPointInView([longitude, latitude]);
|
|
423
429
|
*
|
|
424
|
-
* @param {
|
|
425
|
-
* @return {
|
|
430
|
+
* @param {Position} coordinate - A point expressed in the map view's coordinate system `[longitude, latitude]`.
|
|
431
|
+
* @return {Position} A point expressed in screen coordinates relative to the map view `[x, y]`.
|
|
426
432
|
*/
|
|
427
433
|
getPointInView(coordinate: Position): Promise<Position>;
|
|
428
434
|
/**
|
|
429
|
-
* Converts a
|
|
435
|
+
* Converts a screen coordinate relative to the map view to a geographic coordinate.
|
|
430
436
|
*
|
|
431
437
|
* @example
|
|
432
|
-
* const
|
|
438
|
+
* const x = 100; const y = 100;
|
|
439
|
+
* const [longitude, latitude] = await this._map.getCoordinateFromView([x, y]);
|
|
433
440
|
*
|
|
434
|
-
* @param {
|
|
435
|
-
* @return {
|
|
441
|
+
* @param {Position} point - A point expressed in screen coordinates relative to the map view `[x, y]`.
|
|
442
|
+
* @return {Position} A point expressed in the map view's coordinate system `[longitude, latitude]`.
|
|
436
443
|
*/
|
|
437
444
|
getCoordinateFromView(point: Position): Promise<Position>;
|
|
438
445
|
/**
|
|
439
|
-
* The coordinate bounds
|
|
446
|
+
* The coordinate bounds of the map viewport.
|
|
440
447
|
*
|
|
441
448
|
* @example
|
|
442
|
-
* const
|
|
449
|
+
* const [[rightLon, topLat], [leftLon, bottomLat]] = await this._map.getVisibleBounds();
|
|
443
450
|
*
|
|
444
|
-
* @return {
|
|
451
|
+
* @return {[Position, Position]} The geographic coordinate bounds of the map viewport `[[rightLon, topLat], [leftLon, bottomLat]]`.
|
|
445
452
|
*/
|
|
446
453
|
getVisibleBounds(): Promise<[Position, Position]>;
|
|
447
454
|
/**
|
|
448
455
|
* Returns an array of rendered map features that intersect with a given point.
|
|
449
456
|
*
|
|
450
457
|
* @example
|
|
451
|
-
*
|
|
458
|
+
* const x = 30; const y = 40;
|
|
459
|
+
* this._map.queryRenderedFeaturesAtPoint([x, y], ['==', 'type', 'Point'], ['id1', 'id2'])
|
|
452
460
|
*
|
|
453
|
-
* @param {
|
|
454
|
-
* @param {
|
|
455
|
-
* @param {
|
|
456
|
-
* @return {FeatureCollection}
|
|
461
|
+
* @param {Position} coordinate - A point expressed in the map view’s coordinate system `[x, y]`;
|
|
462
|
+
* @param {FilterExpression | []} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
|
|
463
|
+
* @param {string[]} layerIDs - A array of layer IDs by which to filter the features.
|
|
464
|
+
* @return {FeatureCollection} A GeoJSON feature collection containing the query results.
|
|
457
465
|
*/
|
|
458
466
|
queryRenderedFeaturesAtPoint(coordinate: Position, filter?: FilterExpression | [], layerIDs?: string[]): Promise<GeoJSON.FeatureCollection | undefined>;
|
|
459
467
|
/**
|
|
@@ -462,12 +470,14 @@ declare class MapView extends MapView_base {
|
|
|
462
470
|
* passing an empty array will query the entire visible bounds of the map.
|
|
463
471
|
*
|
|
464
472
|
* @example
|
|
465
|
-
*
|
|
473
|
+
* const left = 40; const top = 30;
|
|
474
|
+
* const right = 10; const bottom = 20;
|
|
475
|
+
* this._map.queryRenderedFeaturesInRect([top, left, bottom, right], ['==', 'type', 'Point'], ['id1', 'id2'])
|
|
466
476
|
*
|
|
467
|
-
* @param {
|
|
468
|
-
* @param {
|
|
469
|
-
* @param {
|
|
470
|
-
* @return {FeatureCollection}
|
|
477
|
+
* @param {BBox | []} bbox - A rectangle expressed in density-independent screen coordinates relative to the map view `[top, left, bottom, right]` or `[minY, minX, maxY, maxX]` (not geographic coordinates). An empty array queries the visible map area.
|
|
478
|
+
* @param {FilterExpression} filter - An array of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
|
|
479
|
+
* @param {string[] | null} layerIDs - A array of layer IDs by which to filter the features.
|
|
480
|
+
* @return {FeatureCollection} A GeoJSON feature collection containing the query results.
|
|
471
481
|
*/
|
|
472
482
|
queryRenderedFeaturesInRect(bbox: BBox | [], filter?: FilterExpression | [], layerIDs?: string[] | null): Promise<GeoJSON.FeatureCollection | undefined>;
|
|
473
483
|
/**
|
|
@@ -477,9 +487,9 @@ declare class MapView extends MapView_base {
|
|
|
477
487
|
* this._map.querySourceFeatures('your-source-id', [], ['your-source-layer'])
|
|
478
488
|
*
|
|
479
489
|
* @param {String} sourceId - Style source identifier used to query for source features.
|
|
480
|
-
* @param {
|
|
481
|
-
* @param {
|
|
482
|
-
* @return {FeatureCollection}
|
|
490
|
+
* @param {FilterExpression | []} filter - A filter to limit query results.
|
|
491
|
+
* @param {string[]} sourceLayerIDs - The name of the source layers to query. For vector tile sources, this parameter is required. For GeoJSON sources, it is ignored.
|
|
492
|
+
* @return {FeatureCollection} A GeoJSON feature collection.
|
|
483
493
|
*/
|
|
484
494
|
querySourceFeatures(sourceId: string, filter?: FilterExpression | [], sourceLayerIDs?: string[]): Promise<GeoJSON.FeatureCollection>;
|
|
485
495
|
/**
|
|
@@ -489,9 +499,11 @@ declare class MapView extends MapView_base {
|
|
|
489
499
|
setCamera(): void;
|
|
490
500
|
_runNative<ReturnType>(methodName: string, args?: NativeArg[]): Promise<ReturnType>;
|
|
491
501
|
/**
|
|
492
|
-
* Takes snapshot of map with current tiles and returns a
|
|
493
|
-
*
|
|
494
|
-
*
|
|
502
|
+
* Takes snapshot of map with current tiles and returns a Base64-encoded PNG image,
|
|
503
|
+
* or an file-system URI to a temporary PNG file if `writeToDisk` is `true`.
|
|
504
|
+
*
|
|
505
|
+
* @param {boolean} writeToDisk If `true`, creates a temporary PNG file and returns a file-system URI, otherwise returns a Base64-encoded PNG image. (Defaults to `false`)
|
|
506
|
+
* @return {string} A a Base64-encoded PNG image or a file-system URI to a temporary PNG file.
|
|
495
507
|
*/
|
|
496
508
|
takeSnap(writeToDisk?: boolean): Promise<string>;
|
|
497
509
|
/**
|
|
@@ -500,16 +512,16 @@ declare class MapView extends MapView_base {
|
|
|
500
512
|
* @example
|
|
501
513
|
* const zoom = await this._map.getZoom();
|
|
502
514
|
*
|
|
503
|
-
* @return {
|
|
515
|
+
* @return {number} The current zoom of the map view.
|
|
504
516
|
*/
|
|
505
517
|
getZoom(): Promise<number>;
|
|
506
518
|
/**
|
|
507
|
-
* Returns the map's
|
|
519
|
+
* Returns the map's center point expressed as geographic coordinates `[longitude, latitude]`.
|
|
508
520
|
*
|
|
509
521
|
* @example
|
|
510
522
|
* const center = await this._map.getCenter();
|
|
511
523
|
*
|
|
512
|
-
* @return {
|
|
524
|
+
* @return {Position} The map's center point expressed as geographic coordinates `[longitude, latitude]`.
|
|
513
525
|
*/
|
|
514
526
|
getCenter(): Promise<Position>;
|
|
515
527
|
/**
|
|
@@ -526,8 +538,8 @@ declare class MapView extends MapView_base {
|
|
|
526
538
|
* The elevation is returned in meters relative to mean sea-level.
|
|
527
539
|
* Returns null if terrain is disabled or if terrain data for the location hasn't been loaded yet.
|
|
528
540
|
*
|
|
529
|
-
* @param {
|
|
530
|
-
* @return {
|
|
541
|
+
* @param {Position} coordinate - The geographic coordinates `[longitude, latitude]` at which to query elevation.
|
|
542
|
+
* @return {number} Elevation in meters relative to mean sea-level.
|
|
531
543
|
*/
|
|
532
544
|
queryTerrainElevation(coordinate: Position): Promise<number>;
|
|
533
545
|
/**
|
|
@@ -537,8 +549,8 @@ declare class MapView extends MapView_base {
|
|
|
537
549
|
* await this._map.setSourceVisibility(false, 'composite', 'building')
|
|
538
550
|
*
|
|
539
551
|
* @param {boolean} visible - Visibility of the layers
|
|
540
|
-
* @param {
|
|
541
|
-
* @param {
|
|
552
|
+
* @param {string} sourceId - Target source identifier (e.g. 'composite')
|
|
553
|
+
* @param {string | null} sourceLayerId - Target source-layer identifier (e.g. 'building'). If `null`, the change affects all layers in the target source.
|
|
542
554
|
*/
|
|
543
555
|
setSourceVisibility(visible: boolean, sourceId: string, sourceLayerId?: string | null): void;
|
|
544
556
|
/**
|
|
@@ -578,10 +590,10 @@ declare class MapView extends MapView_base {
|
|
|
578
590
|
removeFeatureState(featureId: string, stateKey: string | null, sourceId: string, sourceLayerId?: string | null): Promise<void>;
|
|
579
591
|
_decodePayload<T>(payload: T | string): T;
|
|
580
592
|
_onPress(e: NativeSyntheticEvent<{
|
|
581
|
-
payload: GeoJSON.Feature | string;
|
|
593
|
+
payload: GeoJSON.Feature<GeoJSON.Point, ScreenPointPayload> | string;
|
|
582
594
|
}>): void;
|
|
583
595
|
_onLongPress(e: NativeSyntheticEvent<{
|
|
584
|
-
payload: GeoJSON.Feature | string;
|
|
596
|
+
payload: GeoJSON.Feature<GeoJSON.Point, ScreenPointPayload> | string;
|
|
585
597
|
}>): void;
|
|
586
598
|
_onRegionWillChange(payload: GeoJSON.Feature<GeoJSON.Point, RegionPayload & {
|
|
587
599
|
isAnimatingFromUserInteraction: boolean;
|