forked from react-native-maps/react-native-maps
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMapLocalTile.tsx
59 lines (50 loc) · 1.43 KB
/
MapLocalTile.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
import * as React from 'react';
import {ViewProps} from 'react-native';
import decorateMapComponent, {
USES_DEFAULT_IMPLEMENTATION,
SUPPORTED,
ProviderContext,
NativeComponent,
MapManagerCommand,
UIManagerCommand,
} from './decorateMapComponent';
export type MapLocalTileProps = ViewProps & {
/**
* @platform iOS: Apple Maps only
* @platform Android: Supported
*/
pathTemplate: string;
/**
* @platform iOS: Apple Maps only
* @platform Android: Supported
*/
tileSize?: number;
/**
* Set to true to use pathTemplate to open files from Android's AssetManager. The default is false.
* @platform android
*/
useAssets?: boolean;
/**
* @platform iOS: Not supported
* @platform Android: Supported
*/
zIndex?: number;
};
type NativeProps = MapLocalTileProps;
export class MapLocalTile extends React.Component<MapLocalTileProps> {
// declaration only, as they are set through decorateMap
declare context: React.ContextType<typeof ProviderContext>;
getNativeComponent!: () => NativeComponent<NativeProps>;
getMapManagerCommand!: (name: string) => MapManagerCommand;
getUIManagerCommand!: (name: string) => UIManagerCommand;
render() {
const AIRMapLocalTile = this.getNativeComponent();
return <AIRMapLocalTile {...this.props} />;
}
}
export default decorateMapComponent(MapLocalTile, 'LocalTile', {
google: {
ios: SUPPORTED,
android: USES_DEFAULT_IMPLEMENTATION,
},
});