react-native-maps 2.0.0-beta.6 → 2.0.0-beta.8
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/README.md +1 -5
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +0 -55
- package/android/src/main/java/com/rnmaps/maps/MapTileProvider.java +3 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +15 -122
- package/android/src/main/java/com/rnmaps/maps/MapViewModule.java +300 -82
- package/ios/GoogleMaps/RNMGoogleMapManager.m +0 -157
- package/ios/GoogleMaps/RNMGoogleMapViewModule.m +197 -0
- package/ios/Maps/RNMMapManager.m +0 -119
- package/ios/Maps/RNMMapViewModule.m +162 -0
- package/lib/MapView.d.ts +5 -5
- package/lib/MapView.js +18 -13
- package/lib/MapView.types.d.ts +1 -1
- package/lib/MapViewNativeComponent.d.ts +2 -7
- package/lib/MapViewNativeComponent.js +0 -5
- package/lib/NativeGoogleMapViewModule.d.ts +6 -1
- package/lib/NativeMapViewModule.d.ts +6 -1
- package/package.json +1 -1
package/lib/MapView.d.ts
CHANGED
|
@@ -581,11 +581,11 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
581
581
|
private _onChange;
|
|
582
582
|
getCamera(): Promise<Camera>;
|
|
583
583
|
setCamera(camera: Partial<Camera>): void;
|
|
584
|
-
animateCamera(camera: Partial<Camera>, duration?: number): void
|
|
585
|
-
animateToRegion(region: Region, duration?: number): void
|
|
586
|
-
fitToElements(options?: FitToOptions): void
|
|
587
|
-
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): void
|
|
588
|
-
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): void
|
|
584
|
+
animateCamera(camera: Partial<Camera>, duration?: number): Promise<void>;
|
|
585
|
+
animateToRegion(region: Region, duration?: number): Promise<void>;
|
|
586
|
+
fitToElements(options?: FitToOptions): Promise<void>;
|
|
587
|
+
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): Promise<void>;
|
|
588
|
+
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): Promise<void>;
|
|
589
589
|
/**
|
|
590
590
|
* Get visible boudaries
|
|
591
591
|
*
|
package/lib/MapView.js
CHANGED
|
@@ -95,32 +95,37 @@ class MapView extends React.Component {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
animateCamera(camera, duration = 500) {
|
|
98
|
-
if (this.
|
|
99
|
-
|
|
98
|
+
if (this._gogleMapsOniOS()) {
|
|
99
|
+
return googleMapViewModuleMethod('animateCamera')(this._getHandle(), camera, duration);
|
|
100
100
|
}
|
|
101
|
+
return mapViewModuleMethod('animateCamera')(this._getHandle(), camera, duration);
|
|
101
102
|
}
|
|
102
103
|
animateToRegion(region, duration = 500) {
|
|
103
|
-
if (this.
|
|
104
|
-
|
|
104
|
+
if (this._gogleMapsOniOS()) {
|
|
105
|
+
return googleMapViewModuleMethod('animateToRegion')(this._getHandle(), region, duration);
|
|
105
106
|
}
|
|
107
|
+
return mapViewModuleMethod('animateToRegion')(this._getHandle(), region, duration);
|
|
106
108
|
}
|
|
107
109
|
fitToElements(options = {}) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
111
|
+
if (this._gogleMapsOniOS()) {
|
|
112
|
+
return googleMapViewModuleMethod('fitToElements')(this._getHandle(), edgePadding, duration);
|
|
111
113
|
}
|
|
114
|
+
return mapViewModuleMethod('fitToElements')(this._getHandle(), edgePadding, duration);
|
|
112
115
|
}
|
|
113
116
|
fitToSuppliedMarkers(markers, options = {}) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
118
|
+
if (this._gogleMapsOniOS()) {
|
|
119
|
+
return googleMapViewModuleMethod('fitToSuppliedMarkers')(this._getHandle(), markers, edgePadding, duration);
|
|
117
120
|
}
|
|
121
|
+
return mapViewModuleMethod('fitToSuppliedMarkers')(this._getHandle(), markers, edgePadding, duration);
|
|
118
122
|
}
|
|
119
123
|
fitToCoordinates(coordinates = [], options = {}) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
125
|
+
if (this._gogleMapsOniOS()) {
|
|
126
|
+
return googleMapViewModuleMethod('fitToCoordinates')(this._getHandle(), coordinates, edgePadding, duration);
|
|
123
127
|
}
|
|
128
|
+
return mapViewModuleMethod('fitToCoordinates')(this._getHandle(), coordinates, edgePadding, duration);
|
|
124
129
|
}
|
|
125
130
|
/**
|
|
126
131
|
* Get visible boudaries
|
package/lib/MapView.types.d.ts
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HostComponent } from 'react-native';
|
|
3
3
|
import { NativeProps } from './MapView';
|
|
4
|
-
import { Camera
|
|
5
|
-
import { LatLng
|
|
4
|
+
import { Camera } from './MapView.types';
|
|
5
|
+
import { LatLng } from './sharedTypes';
|
|
6
6
|
export type MapViewNativeComponentType = HostComponent<NativeProps>;
|
|
7
7
|
interface NativeCommands {
|
|
8
|
-
animateToRegion: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, region: Region, duration: number) => void;
|
|
9
8
|
setCamera: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, camera: Partial<Camera>) => void;
|
|
10
|
-
animateCamera: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, camera: Partial<Camera>, duration: number) => void;
|
|
11
|
-
fitToElements: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, edgePadding: EdgePadding, animated: boolean) => void;
|
|
12
|
-
fitToSuppliedMarkers: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, markers: string[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
13
|
-
fitToCoordinates: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, coordinates: LatLng[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
14
9
|
setMapBoundaries: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, northEast: LatLng, southWest: LatLng) => void;
|
|
15
10
|
setIndoorActiveLevelIndex: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, activeLevelIndex: number) => void;
|
|
16
11
|
}
|
|
@@ -7,12 +7,7 @@ exports.Commands = void 0;
|
|
|
7
7
|
const codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
|
|
8
8
|
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
9
9
|
supportedCommands: [
|
|
10
|
-
'animateToRegion',
|
|
11
10
|
'setCamera',
|
|
12
|
-
'animateCamera',
|
|
13
|
-
'fitToElements',
|
|
14
|
-
'fitToSuppliedMarkers',
|
|
15
|
-
'fitToCoordinates',
|
|
16
11
|
'setMapBoundaries',
|
|
17
12
|
'setIndoorActiveLevelIndex',
|
|
18
13
|
],
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { BoundingBox, Camera, MarkersFrames } from './MapView.types';
|
|
2
|
+
import { BoundingBox, Camera, EdgePadding, MarkersFrames } from './MapView.types';
|
|
3
3
|
import { LatLng, Point, Region } from './sharedTypes';
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
|
+
animateCamera: (viewTag: number, camera: Partial<Camera>, duration: number) => Promise<void>;
|
|
6
|
+
animateToRegion: (viewTag: number, region: Region, duration: number) => Promise<void>;
|
|
5
7
|
coordinateForPoint: (viewTag: number, point: Point) => Promise<LatLng>;
|
|
8
|
+
fitToCoordinates: (viewTag: number, coordinates: LatLng[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
9
|
+
fitToElements: (viewTag: number, edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
10
|
+
fitToSuppliedMarkers: (viewTag: number, markers: string[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
6
11
|
getCamera: (viewTag: number) => Promise<Camera>;
|
|
7
12
|
getMapBoundaries: (viewTag: number) => Promise<BoundingBox>;
|
|
8
13
|
getMarkersFrames: (viewTag: number, onlyVisible: boolean) => Promise<MarkersFrames>;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { Address, BoundingBox, Camera, MarkersFrames } from './MapView.types';
|
|
2
|
+
import { Address, BoundingBox, Camera, EdgePadding, MarkersFrames } from './MapView.types';
|
|
3
3
|
import { LatLng, Point, Region } from './sharedTypes';
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
|
+
animateCamera: (viewTag: number, camera: Partial<Camera>, duration: number) => Promise<void>;
|
|
6
|
+
animateToRegion: (viewTag: number, region: Region, duration: number) => Promise<void>;
|
|
5
7
|
coordinateForPoint: (viewTag: number, point: Point) => Promise<LatLng>;
|
|
6
8
|
/** android only */
|
|
7
9
|
enableLatestRenderer: () => Promise<string>;
|
|
10
|
+
fitToCoordinates: (viewTag: number, coordinates: LatLng[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
11
|
+
fitToElements: (viewTag: number, edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
12
|
+
fitToSuppliedMarkers: (viewTag: number, markers: string[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
8
13
|
getAddressFromCoordinates: (viewTag: number, coordinate: LatLng) => Promise<Address>;
|
|
9
14
|
getCamera: (viewTag: number) => Promise<Camera>;
|
|
10
15
|
getMapBoundaries: (viewTag: number) => Promise<BoundingBox>;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
8
|
-
"version": "2.0.0-beta.
|
|
8
|
+
"version": "2.0.0-beta.8",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|