react-native-maps 1.21.0-alpha.6 → 1.21.0-alpha.7
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/ios/AirGoogleMaps/AIRGoogleMap.h +6 -1
- package/ios/AirGoogleMaps/AIRGoogleMap.m +90 -7
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.h +13 -0
- package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.m +10 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +7 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +13 -91
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapOverlay.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapPolygonManager.m +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +3 -2
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +2 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m +2 -2
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +16 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +529 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +2 -2
- package/ios/AirMaps/AIRMap.m +2 -2
- package/ios/AirMaps/AIRMapManager.m +4 -4
- package/ios/AirMaps/RNMapsAirModule.h +3 -0
- package/ios/AirMaps/RNMapsMapView.h +3 -0
- package/ios/AirMaps/RNMapsMapView.mm +2 -25
- package/lib/FabricMapView.d.ts +7 -2
- package/lib/FabricMapView.js +7 -1
- package/lib/MapOverlay.d.ts +1 -1
- package/lib/MapView.d.ts +2 -2
- package/lib/MapView.js +5 -12
- package/lib/specs/NativeComponentGoogleMapView.d.ts +713 -0
- package/lib/specs/NativeComponentGoogleMapView.js +21 -0
- package/lib/specs/NativeComponentMapView.d.ts +4 -11
- package/package.json +7 -7
package/lib/FabricMapView.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MapBoundaries } from './specs/NativeAirMapsModule';
|
|
3
3
|
import type { MapFabricNativeProps, Camera, Point } from './specs/NativeComponentMapView';
|
|
4
|
-
import { LatLng, Region } from './sharedTypes';
|
|
4
|
+
import { LatLng, Provider, Region } from './sharedTypes';
|
|
5
5
|
import { Address, EdgePadding, SnapshotOptions } from './MapView.types';
|
|
6
6
|
export interface FabricMapHandle {
|
|
7
7
|
getCamera: () => Promise<Camera>;
|
|
@@ -18,5 +18,10 @@ export interface FabricMapHandle {
|
|
|
18
18
|
getPointForCoordinate: (coordinate: LatLng) => Promise<Point>;
|
|
19
19
|
getCoordinateForPoint: (point: Point) => Promise<LatLng>;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type FabricMapViewProps = MapFabricNativeProps & {
|
|
22
|
+
provider?: Provider;
|
|
23
|
+
};
|
|
24
|
+
export declare const FabricMap: React.ForwardRefExoticComponent<MapFabricNativeProps & {
|
|
25
|
+
provider?: Provider;
|
|
26
|
+
} & React.RefAttributes<FabricMapHandle>>;
|
|
22
27
|
export default FabricMap;
|
package/lib/FabricMapView.js
CHANGED
|
@@ -30,6 +30,7 @@ exports.FabricMap = void 0;
|
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const NativeAirMapsModule_1 = __importDefault(require("./specs/NativeAirMapsModule"));
|
|
32
32
|
const NativeComponentMapView_1 = __importStar(require("./specs/NativeComponentMapView"));
|
|
33
|
+
const NativeComponentGoogleMapView_1 = __importDefault(require("./specs/NativeComponentGoogleMapView"));
|
|
33
34
|
const react_native_1 = require("react-native");
|
|
34
35
|
exports.FabricMap = (0, react_1.forwardRef)((props, ref) => {
|
|
35
36
|
const fabricRef = (0, react_1.useRef)(null);
|
|
@@ -170,6 +171,11 @@ exports.FabricMap = (0, react_1.forwardRef)((props, ref) => {
|
|
|
170
171
|
}
|
|
171
172
|
},
|
|
172
173
|
}));
|
|
173
|
-
|
|
174
|
+
if (props.provider === 'google') {
|
|
175
|
+
return <NativeComponentGoogleMapView_1.default {...props} ref={fabricRef}/>;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
return <NativeComponentMapView_1.default {...props} ref={fabricRef}/>;
|
|
179
|
+
}
|
|
174
180
|
});
|
|
175
181
|
exports.default = exports.FabricMap;
|
package/lib/MapOverlay.d.ts
CHANGED
package/lib/MapView.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type MapViewProps = ViewProps & {
|
|
|
11
11
|
* If `true` map will be cached and displayed as an image instead of being interactable, for performance usage.
|
|
12
12
|
*
|
|
13
13
|
* @default false
|
|
14
|
-
* @platform iOS: Apple
|
|
14
|
+
* @platform iOS: Apple Maps only
|
|
15
15
|
* @platform Android: Supported
|
|
16
16
|
*/
|
|
17
17
|
cacheEnabled?: boolean;
|
|
@@ -92,7 +92,7 @@ export type MapViewProps = ViewProps & {
|
|
|
92
92
|
*/
|
|
93
93
|
kmlSrc?: string;
|
|
94
94
|
/**
|
|
95
|
-
* If set, changes the position of the "Legal" label link in Apple
|
|
95
|
+
* If set, changes the position of the "Legal" label link in Apple Maps.
|
|
96
96
|
*
|
|
97
97
|
* @platform iOS: Apple Maps only
|
|
98
98
|
* @platform Android: Not supported
|
package/lib/MapView.js
CHANGED
|
@@ -30,7 +30,6 @@ exports.AnimatedMapView = exports.MAP_TYPES = void 0;
|
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const react_native_1 = require("react-native");
|
|
32
32
|
const decorateMapComponent_1 = require("./decorateMapComponent");
|
|
33
|
-
const ProviderConstants = __importStar(require("./ProviderConstants"));
|
|
34
33
|
const MapViewNativeComponent_1 = require("./MapViewNativeComponent");
|
|
35
34
|
const FabricMapView_1 = __importDefault(require("./FabricMapView"));
|
|
36
35
|
exports.MAP_TYPES = {
|
|
@@ -43,7 +42,6 @@ exports.MAP_TYPES = {
|
|
|
43
42
|
SATELLITE_FLYOVER: 'satelliteFlyover',
|
|
44
43
|
HYBRID_FLYOVER: 'hybridFlyover',
|
|
45
44
|
};
|
|
46
|
-
const GOOGLE_MAPS_ONLY_TYPES = [exports.MAP_TYPES.TERRAIN, exports.MAP_TYPES.NONE];
|
|
47
45
|
class MapView extends React.Component {
|
|
48
46
|
static Animated;
|
|
49
47
|
map;
|
|
@@ -343,12 +341,11 @@ class MapView extends React.Component {
|
|
|
343
341
|
}
|
|
344
342
|
};
|
|
345
343
|
render() {
|
|
346
|
-
if (react_native_1.Platform.OS === 'ios'
|
|
347
|
-
this.props.provider === ProviderConstants.PROVIDER_DEFAULT) {
|
|
344
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
348
345
|
const AIRMap = FabricMapView_1.default;
|
|
349
346
|
// Define props specifically for MapFabricNativeProps
|
|
350
347
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
351
|
-
const { onCalloutPress, onIndoorBuildingFocused, onKmlReady, onLongPress, onMarkerDeselect, onMarkerPress, onMarkerSelect, onRegionChangeStart, onRegionChange, onRegionChangeComplete, onPress, region, ...restProps } = this.props;
|
|
348
|
+
const { onCalloutPress, onIndoorBuildingFocused, onKmlReady, onLongPress, onMarkerDeselect, onMarkerPress, onMarkerSelect, onRegionChangeStart, onRegionChange, onRegionChangeComplete, onPress, minZoomLevel, maxZoomLevel, region, ...restProps } = this.props;
|
|
352
349
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
353
350
|
const userInterfaceStyle = this.props.userInterfaceStyle || 'system';
|
|
354
351
|
const props = {
|
|
@@ -361,6 +358,8 @@ class MapView extends React.Component {
|
|
|
361
358
|
onMarkerSelect: this.handleMarkerSelect,
|
|
362
359
|
onMarkerDeselect: this.handleMarkerDeselect,
|
|
363
360
|
userInterfaceStyle: userInterfaceStyle,
|
|
361
|
+
minZoom: minZoomLevel,
|
|
362
|
+
maxZoom: maxZoomLevel,
|
|
364
363
|
onRegionChange: this.handleRegionChange,
|
|
365
364
|
...restProps,
|
|
366
365
|
};
|
|
@@ -372,13 +371,7 @@ class MapView extends React.Component {
|
|
|
372
371
|
longitudeDelta: this.props.region.longitudeDelta,
|
|
373
372
|
};
|
|
374
373
|
}
|
|
375
|
-
if (this.state.isReady) {
|
|
376
|
-
if (props.mapType && GOOGLE_MAPS_ONLY_TYPES.includes(props.mapType)) {
|
|
377
|
-
props.mapType = exports.MAP_TYPES.STANDARD;
|
|
378
|
-
console.log('ready');
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
else {
|
|
374
|
+
if (!this.state.isReady) {
|
|
382
375
|
props.style = this.props.style;
|
|
383
376
|
props.initialCamera = this.props.initialCamera;
|
|
384
377
|
props.onLayout = this.props.onLayout;
|