react-native-maps 1.26.11 → 1.26.13
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/rnmaps/fabric/MapViewManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +2 -4
- package/dist/plugin/src/android.d.ts +4 -0
- package/dist/plugin/src/index.d.ts +4 -0
- package/dist/plugin/src/ios.d.ts +15 -0
- package/dist/plugin/src/types.d.ts +4 -0
- package/dist/src/AnimatedRegion.d.ts +19 -0
- package/dist/src/Geojson.d.ts +204 -0
- package/dist/src/MapCallout.d.ts +40 -0
- package/dist/src/MapCalloutSubview.d.ts +34 -0
- package/dist/src/MapCircle.d.ts +117 -0
- package/dist/src/MapHeatmap.d.ts +78 -0
- package/dist/src/MapLocalTile.d.ts +35 -0
- package/dist/src/MapMarker.d.ts +322 -0
- package/dist/src/MapMarkerNativeComponent.d.ts +14 -0
- package/dist/src/MapOverlay.d.ts +88 -0
- package/dist/src/MapPolygon.d.ts +140 -0
- package/dist/src/MapPolygon.types.d.ts +18 -0
- package/dist/src/MapPolyline.d.ts +156 -0
- package/dist/src/MapUrlTile.d.ts +134 -0
- package/dist/src/MapView.d.ts +723 -0
- package/dist/src/MapView.types.d.ts +160 -0
- package/dist/src/MapView.web.d.ts +1 -0
- package/dist/src/MapViewNativeComponent.d.ts +17 -0
- package/dist/src/MapWMSTile.d.ts +116 -0
- package/dist/src/ProviderConstants.d.ts +2 -0
- package/dist/src/createFabricMap.d.ts +25 -0
- package/dist/src/decorateMapComponent.d.ts +35 -0
- package/dist/src/fixImageProp.d.ts +4 -0
- package/dist/src/index.d.ts +38 -0
- package/dist/src/sharedTypes.d.ts +87 -0
- package/dist/src/sharedTypesInternal.d.ts +1 -0
- package/dist/src/specs/NativeAirMapsModule.d.ts +31 -0
- package/dist/src/specs/NativeComponentCallout.d.ts +46 -0
- package/dist/src/specs/NativeComponentCircle.d.ts +74 -0
- package/dist/src/specs/NativeComponentGoogleMapView.d.ts +709 -0
- package/dist/src/specs/NativeComponentGooglePolygon.d.ts +83 -0
- package/dist/src/specs/NativeComponentMapView.d.ts +897 -0
- package/dist/src/specs/NativeComponentMarker.d.ts +278 -0
- package/dist/src/specs/NativeComponentOverlay.d.ts +76 -0
- package/dist/src/specs/NativeComponentPolyline.d.ts +101 -0
- package/dist/src/specs/NativeComponentUrlTile.d.ts +109 -0
- package/dist/src/specs/NativeComponentWMSTile.d.ts +91 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { ClickEvent, LatLng, Point, Region } from './sharedTypes';
|
|
2
|
+
import type { NativeSyntheticEvent } from 'react-native';
|
|
3
|
+
export type Camera = {
|
|
4
|
+
/**
|
|
5
|
+
* Apple Maps
|
|
6
|
+
*/
|
|
7
|
+
altitude?: number;
|
|
8
|
+
center: LatLng;
|
|
9
|
+
heading: number;
|
|
10
|
+
pitch: number;
|
|
11
|
+
/**
|
|
12
|
+
* Google Maps
|
|
13
|
+
*/
|
|
14
|
+
zoom?: number;
|
|
15
|
+
};
|
|
16
|
+
export type MapStyleElement = {
|
|
17
|
+
featureType?: string;
|
|
18
|
+
elementType?: string;
|
|
19
|
+
stylers: object[];
|
|
20
|
+
};
|
|
21
|
+
export type EdgePadding = {
|
|
22
|
+
top: number;
|
|
23
|
+
right: number;
|
|
24
|
+
bottom: number;
|
|
25
|
+
left: number;
|
|
26
|
+
};
|
|
27
|
+
export type MapType = 'hybrid' | 'mutedStandard' | 'none' | 'satellite' | 'standard' | 'terrain' | 'satelliteFlyover' | 'hybridFlyover';
|
|
28
|
+
export type MapTypes = {
|
|
29
|
+
STANDARD: 'standard';
|
|
30
|
+
SATELLITE: 'satellite';
|
|
31
|
+
HYBRID: 'hybrid';
|
|
32
|
+
TERRAIN: 'terrain';
|
|
33
|
+
NONE: 'none';
|
|
34
|
+
MUTEDSTANDARD: 'mutedStandard';
|
|
35
|
+
SATELLITE_FLYOVER: 'satelliteFlyover';
|
|
36
|
+
HYBRID_FLYOVER: 'hybridFlyover';
|
|
37
|
+
};
|
|
38
|
+
export type IndoorLevel = {
|
|
39
|
+
index: number;
|
|
40
|
+
name: string;
|
|
41
|
+
shortName: string;
|
|
42
|
+
};
|
|
43
|
+
export type ActiveIndoorLevel = {
|
|
44
|
+
activeLevelIndex: number;
|
|
45
|
+
name: string;
|
|
46
|
+
shortName: string;
|
|
47
|
+
};
|
|
48
|
+
export type IndoorLevelActivatedEvent = NativeSyntheticEvent<{
|
|
49
|
+
indoorLevel: ActiveIndoorLevel;
|
|
50
|
+
}>;
|
|
51
|
+
export type IndoorBuilding = {
|
|
52
|
+
underground: boolean;
|
|
53
|
+
activeLevelIndex: number;
|
|
54
|
+
levels: IndoorLevel[];
|
|
55
|
+
};
|
|
56
|
+
export type IndoorBuildingEvent = NativeSyntheticEvent<{
|
|
57
|
+
IndoorBuilding: IndoorBuilding;
|
|
58
|
+
}>;
|
|
59
|
+
export type KmlMarker = {
|
|
60
|
+
id: string;
|
|
61
|
+
title: string;
|
|
62
|
+
description: string;
|
|
63
|
+
coordinate: LatLng;
|
|
64
|
+
position: Point;
|
|
65
|
+
};
|
|
66
|
+
export type KmlMapEvent = NativeSyntheticEvent<{
|
|
67
|
+
markers: KmlMarker[];
|
|
68
|
+
}>;
|
|
69
|
+
export type LongPressEvent = ClickEvent<{
|
|
70
|
+
/**
|
|
71
|
+
* @platform Android
|
|
72
|
+
*/
|
|
73
|
+
action?: 'long-press';
|
|
74
|
+
}>;
|
|
75
|
+
export type PanDragEvent = ClickEvent;
|
|
76
|
+
export type PoiClickEvent = NativeSyntheticEvent<{
|
|
77
|
+
placeId: string;
|
|
78
|
+
name: string;
|
|
79
|
+
coordinate: LatLng;
|
|
80
|
+
/**
|
|
81
|
+
* @platform Android
|
|
82
|
+
*/
|
|
83
|
+
position?: Point;
|
|
84
|
+
}>;
|
|
85
|
+
export type MapPressEvent = ClickEvent<{
|
|
86
|
+
/**
|
|
87
|
+
* @platform Android
|
|
88
|
+
*/
|
|
89
|
+
action?: 'press' | 'marker-press';
|
|
90
|
+
}>;
|
|
91
|
+
export type Details = {
|
|
92
|
+
isGesture?: boolean;
|
|
93
|
+
};
|
|
94
|
+
export type UserLocationChangeEvent = NativeSyntheticEvent<{
|
|
95
|
+
coordinate?: LatLng & {
|
|
96
|
+
altitude: number;
|
|
97
|
+
timestamp: number;
|
|
98
|
+
accuracy: number;
|
|
99
|
+
speed: number;
|
|
100
|
+
heading: number;
|
|
101
|
+
/**
|
|
102
|
+
* @platform iOS
|
|
103
|
+
*/
|
|
104
|
+
altitudeAccuracy?: number;
|
|
105
|
+
/**
|
|
106
|
+
* @platform Android
|
|
107
|
+
*/
|
|
108
|
+
isFromMockProvider?: boolean;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* @platform iOS
|
|
112
|
+
*/
|
|
113
|
+
error?: {
|
|
114
|
+
message: string;
|
|
115
|
+
};
|
|
116
|
+
}>;
|
|
117
|
+
export type ChangeEvent = NativeSyntheticEvent<{
|
|
118
|
+
region: Region;
|
|
119
|
+
isGesture?: boolean;
|
|
120
|
+
}>;
|
|
121
|
+
export type FitToOptions = {
|
|
122
|
+
edgePadding?: EdgePadding;
|
|
123
|
+
animated?: boolean;
|
|
124
|
+
};
|
|
125
|
+
export type BoundingBox = {
|
|
126
|
+
northEast: LatLng;
|
|
127
|
+
southWest: LatLng;
|
|
128
|
+
};
|
|
129
|
+
export type SnapshotOptions = {
|
|
130
|
+
/** optional, when omitted the view-width is used */
|
|
131
|
+
width?: number;
|
|
132
|
+
/** optional, when omitted the view-height is used */
|
|
133
|
+
height?: number;
|
|
134
|
+
/** __iOS only__, optional region to render */
|
|
135
|
+
region?: Region;
|
|
136
|
+
/** image formats, defaults to 'png' */
|
|
137
|
+
format?: 'png' | 'jpg';
|
|
138
|
+
/** image quality: 0..1 (only relevant for jpg, default: 1) */
|
|
139
|
+
quality?: number;
|
|
140
|
+
/** result types, defaults to 'file' */
|
|
141
|
+
result?: 'file' | 'base64';
|
|
142
|
+
};
|
|
143
|
+
export type Address = {
|
|
144
|
+
administrativeArea: string;
|
|
145
|
+
country: string;
|
|
146
|
+
countryCode: string;
|
|
147
|
+
locality: string;
|
|
148
|
+
name: string;
|
|
149
|
+
postalCode: string;
|
|
150
|
+
subAdministrativeArea: string;
|
|
151
|
+
subLocality: string;
|
|
152
|
+
thoroughfare: string;
|
|
153
|
+
subThoroughfare?: string;
|
|
154
|
+
};
|
|
155
|
+
export type CameraZoomRange = {
|
|
156
|
+
minCenterCoordinateDistance?: number;
|
|
157
|
+
maxCenterCoordinateDistance?: number;
|
|
158
|
+
animated?: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type NativeCommandName = 'animateCamera' | 'animateToRegion' | 'coordinateForPoint' | 'fitToCoordinates' | 'fitToElements' | 'fitToSuppliedMarkers' | 'getAddressFromCoordinates' | 'getCamera' | 'getMapBoundaries' | 'getMarkersFrames' | 'pointForCoordinate' | 'setCamera' | 'setIndoorActiveLevelIndex' | 'setMapBoundaries' | 'takeSnapshot';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from 'react-native-web/dist/modules/UnimplementedView';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { NativeProps } from './MapView';
|
|
3
|
+
import type { Camera, EdgePadding } from './MapView.types';
|
|
4
|
+
import type { LatLng, Region } from './sharedTypes';
|
|
5
|
+
export type MapViewNativeComponentType = HostComponent<NativeProps>;
|
|
6
|
+
interface NativeCommands {
|
|
7
|
+
animateToRegion: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, region: Region, duration: number) => void;
|
|
8
|
+
setCamera: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, camera: Partial<Camera>) => void;
|
|
9
|
+
animateCamera: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, camera: Partial<Camera>, duration: number) => void;
|
|
10
|
+
fitToElements: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, edgePadding: EdgePadding, animated: boolean) => void;
|
|
11
|
+
fitToSuppliedMarkers: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, markers: string[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
12
|
+
fitToCoordinates: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, coordinates: LatLng[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
13
|
+
setMapBoundaries: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, northEast: LatLng, southWest: LatLng) => void;
|
|
14
|
+
setIndoorActiveLevelIndex: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, activeLevelIndex: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const Commands: NativeCommands;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import { ProviderContext, type NativeComponent, type MapManagerCommand, type UIManagerCommand } from './decorateMapComponent';
|
|
4
|
+
export type MapWMSTileProps = ViewProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The maximum native zoom level for this tile overlay i.e. the highest zoom level that the tile server provides.
|
|
7
|
+
* Tiles are auto-scaled for higher zoom levels.
|
|
8
|
+
*
|
|
9
|
+
* @platform iOS: Apple Maps only
|
|
10
|
+
* @platform Android: Supported
|
|
11
|
+
*/
|
|
12
|
+
maximumNativeZ?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The maximum zoom level for this tile overlay.
|
|
15
|
+
*
|
|
16
|
+
* @platform iOS: Supported
|
|
17
|
+
* @platform Android: Supported
|
|
18
|
+
*/
|
|
19
|
+
maximumZ?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The minimum zoom level for this tile overlay.
|
|
22
|
+
*
|
|
23
|
+
* @platform iOS: Supported
|
|
24
|
+
* @platform Android: Supported
|
|
25
|
+
*/
|
|
26
|
+
minimumZ?: number;
|
|
27
|
+
/**
|
|
28
|
+
* In offline-mode tiles are not fetched from the tile servers, rather only tiles stored in the cache directory are used.
|
|
29
|
+
* Furthermore, automated tile scaling is activated: if tile at a desired zoom level is not found from the cache directory,
|
|
30
|
+
* then lower zoom level tile is used (up to 4 levels lower) and scaled.
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
* @platform iOS: Apple Maps only
|
|
34
|
+
* @platform Android: Supported
|
|
35
|
+
*/
|
|
36
|
+
offlineMode?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Map layer opacity. Value between 0 - 1, with 0 meaning fully transparent.
|
|
39
|
+
*
|
|
40
|
+
* @platform iOS: Supported
|
|
41
|
+
* @platform Android: Supported
|
|
42
|
+
*/
|
|
43
|
+
opacity?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Corresponds to MKTileOverlay canReplaceMapContent i.e. if true then underlying iOS basemap is not shown.
|
|
46
|
+
*
|
|
47
|
+
* @default false
|
|
48
|
+
* @platform iOS: Apple Maps only
|
|
49
|
+
* @platform Android: Not supported
|
|
50
|
+
*/
|
|
51
|
+
shouldReplaceMapContent?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Defines maximum age in seconds for a cached tile before it's refreshed.
|
|
54
|
+
*
|
|
55
|
+
* NB! Refresh logic is "serve-stale-while-refresh"
|
|
56
|
+
* i.e. to ensure map availability a stale (over max age) tile is served
|
|
57
|
+
* while a tile refresh process is started in the background.
|
|
58
|
+
*
|
|
59
|
+
* @platform iOS: Apple Maps only
|
|
60
|
+
* @platform Android: Supported
|
|
61
|
+
*/
|
|
62
|
+
tileCacheMaxAge?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Enable caching of tiles in the specified directory.
|
|
65
|
+
* Directory can be specified either as a normal path or in URL format (`file://`).
|
|
66
|
+
*
|
|
67
|
+
* Tiles are stored in tileCachePath directory as `/{z}/{x}/{y}` i.e. in sub-directories 2-levels deep,
|
|
68
|
+
* filename is tile y-coordinate without any filetype-extension.
|
|
69
|
+
*
|
|
70
|
+
* NB! All cache management needs to be implemented by client e.g. deleting tiles to manage use of storage space etc.
|
|
71
|
+
*
|
|
72
|
+
* @platform iOS: Apple Maps only
|
|
73
|
+
* @platform Android: Supported
|
|
74
|
+
*/
|
|
75
|
+
tileCachePath?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Tile size, default size is 256 (for tiles of 256 _ 256 pixels).
|
|
78
|
+
* High-res (aka 'retina') tiles are 512 (tiles of 512 _ 512 pixels)
|
|
79
|
+
*
|
|
80
|
+
* @platform iOS: Supported
|
|
81
|
+
* @platform Android: Supported
|
|
82
|
+
*/
|
|
83
|
+
tileSize?: number;
|
|
84
|
+
/**
|
|
85
|
+
* The url template of the map tileserver.
|
|
86
|
+
* (URLTile) The patterns {x} {y} {z} will be replaced at runtime.
|
|
87
|
+
* For example, http://c.tile.openstreetmap.org/{z}/{x}/{y}.png.
|
|
88
|
+
*
|
|
89
|
+
* It is also possible to refer to tiles in local filesystem with file:///top-level-directory/sub-directory/{z}/{x}/{y}.png URL-format.
|
|
90
|
+
* (WMSTile) The patterns {minX} {maxX} {minY} {maxY} {width} {height} will be replaced at runtime according to EPSG:900913 specification bounding box.
|
|
91
|
+
* For example, https://demo.geo-solutions.it/geoserver/tiger/wms?service=WMS&version=1.1.0&request=GetMap&layers=tiger:poi&styles=&bbox={minX},{minY},{maxX},{maxY}&width={width}&height={height}&srs=EPSG:900913&format=image/png&transparent=true&format_options=dpi:213.
|
|
92
|
+
*
|
|
93
|
+
* @platform iOS: Supported
|
|
94
|
+
* @platform Android: Supported
|
|
95
|
+
*/
|
|
96
|
+
urlTemplate: string;
|
|
97
|
+
/**
|
|
98
|
+
* The order in which this tile overlay is drawn with respect to other overlays.
|
|
99
|
+
* An overlay with a larger z-index is drawn over overlays with smaller z-indices.
|
|
100
|
+
* The order of overlays with the same z-index is arbitrary.
|
|
101
|
+
*
|
|
102
|
+
* @platform iOS: Google Maps only
|
|
103
|
+
* @platform Android: Supported
|
|
104
|
+
*/
|
|
105
|
+
zIndex?: number;
|
|
106
|
+
};
|
|
107
|
+
type NativeProps = MapWMSTileProps;
|
|
108
|
+
export declare class MapWMSTile extends React.Component<MapWMSTileProps> {
|
|
109
|
+
context: React.ContextType<typeof ProviderContext>;
|
|
110
|
+
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
111
|
+
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
112
|
+
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
113
|
+
render(): React.JSX.Element;
|
|
114
|
+
}
|
|
115
|
+
declare const _default: typeof MapWMSTile;
|
|
116
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LatLng, Point, Region } from './sharedTypes';
|
|
3
|
+
import type { Address, Camera, EdgePadding, SnapshotOptions } from './MapView.types';
|
|
4
|
+
import { type MapBoundaries } from './specs/NativeAirMapsModule';
|
|
5
|
+
import FabricMapView, { Commands as FabricCommands, type MapFabricNativeProps } from './specs/NativeComponentMapView';
|
|
6
|
+
import GoogleMapView, { Commands as GoogleCommands, type MapFabricNativeProps as GoogleMapFabricNativeProps } from './specs/NativeComponentGoogleMapView';
|
|
7
|
+
export type MapViewProps = MapFabricNativeProps | GoogleMapFabricNativeProps;
|
|
8
|
+
export interface FabricMapHandle {
|
|
9
|
+
getCamera: () => Promise<Camera>;
|
|
10
|
+
setCamera: (camera: Partial<Camera>) => void;
|
|
11
|
+
animateToRegion: (region: Region, duration: number) => void;
|
|
12
|
+
animateCamera: (camera: Partial<Camera>, duration: number) => void;
|
|
13
|
+
getMarkersFrames: (onlyVisible: boolean) => Promise<unknown>;
|
|
14
|
+
fitToElements: (edgePadding: EdgePadding, animated: boolean) => void;
|
|
15
|
+
fitToSuppliedMarkers: (markers: string[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
16
|
+
fitToCoordinates: (coordinates: LatLng[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
17
|
+
getMapBoundaries: () => Promise<MapBoundaries>;
|
|
18
|
+
takeSnapshot: (config: SnapshotOptions) => Promise<string>;
|
|
19
|
+
getAddressFromCoordinates: (coordinate: LatLng) => Promise<Address>;
|
|
20
|
+
getPointForCoordinate: (coordinate: LatLng) => Promise<Point>;
|
|
21
|
+
getCoordinateForPoint: (point: Point) => Promise<LatLng>;
|
|
22
|
+
setIndoorActiveLevelIndex: (activeLevelIndex: number) => void;
|
|
23
|
+
}
|
|
24
|
+
declare const createFabricMap: (ViewComponent: typeof GoogleMapView | typeof FabricMapView, Commands: typeof FabricCommands | typeof GoogleCommands) => React.ForwardRefExoticComponent<MapViewProps & React.RefAttributes<FabricMapHandle | null>>;
|
|
25
|
+
export default createFabricMap;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type HostComponent } from 'react-native';
|
|
2
|
+
import type { Provider } from './sharedTypes';
|
|
3
|
+
import { MapCallout } from './MapCallout';
|
|
4
|
+
import { MapOverlay } from './MapOverlay';
|
|
5
|
+
import { MapCalloutSubview } from './MapCalloutSubview';
|
|
6
|
+
import { MapCircle } from './MapCircle';
|
|
7
|
+
import { MapHeatmap } from './MapHeatmap';
|
|
8
|
+
import { MapLocalTile } from './MapLocalTile';
|
|
9
|
+
import { MapMarker } from './MapMarker';
|
|
10
|
+
import { MapPolygon } from './MapPolygon';
|
|
11
|
+
import { MapPolyline } from './MapPolyline';
|
|
12
|
+
import { MapUrlTile } from './MapUrlTile';
|
|
13
|
+
import { MapWMSTile } from './MapWMSTile';
|
|
14
|
+
import { Commands } from './MapViewNativeComponent';
|
|
15
|
+
export declare const SUPPORTED: ImplementationStatus;
|
|
16
|
+
export declare const USES_DEFAULT_IMPLEMENTATION: ImplementationStatus;
|
|
17
|
+
export declare const NOT_SUPPORTED: ImplementationStatus;
|
|
18
|
+
export declare const ProviderContext: import("react").Context<Provider>;
|
|
19
|
+
export declare function getNativeMapName(provider: Provider): "AIRMap" | "AIRGoogleMap";
|
|
20
|
+
export declare const createNotSupportedComponent: (message: string) => (() => null);
|
|
21
|
+
export declare const googleMapIsInstalled: boolean;
|
|
22
|
+
export default function decorateMapComponent<Type extends Component>(Component: Type, componentName: ComponentName, providers: Providers): Type;
|
|
23
|
+
type ImplementationStatus = 'SUPPORTED' | 'USES_DEFAULT_IMPLEMENTATION' | 'NOT_SUPPORTED';
|
|
24
|
+
type Providers = {
|
|
25
|
+
google: {
|
|
26
|
+
ios: ImplementationStatus;
|
|
27
|
+
android: ImplementationStatus;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type UIManagerCommand = number;
|
|
31
|
+
export type MapManagerCommand = keyof typeof Commands;
|
|
32
|
+
export type NativeComponent<H = unknown> = HostComponent<H> | ReturnType<typeof createNotSupportedComponent>;
|
|
33
|
+
type Component = typeof MapCallout | typeof MapCalloutSubview | typeof MapCircle | typeof MapHeatmap | typeof MapLocalTile | typeof MapMarker | typeof MapOverlay | typeof MapPolygon | typeof MapPolyline | typeof MapUrlTile | typeof MapWMSTile;
|
|
34
|
+
type ComponentName = 'Callout' | 'CalloutSubview' | 'Circle' | 'Heatmap' | 'LocalTile' | 'Marker' | 'Overlay' | 'Polygon' | 'Polyline' | 'UrlTile' | 'WMSTile';
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import MapView, { AnimatedMapView as Animated, MAP_TYPES, type MapViewProps } from './MapView';
|
|
2
|
+
import Marker from './MapMarker';
|
|
3
|
+
export { MapMarker } from './MapMarker';
|
|
4
|
+
export type { MapMarkerProps } from './MapMarker';
|
|
5
|
+
import Overlay from './MapOverlay';
|
|
6
|
+
export { MapOverlay } from './MapOverlay';
|
|
7
|
+
export type { MapOverlayProps } from './MapOverlay';
|
|
8
|
+
export { default as Polyline, MapPolyline } from './MapPolyline';
|
|
9
|
+
export type { MapPolylineProps } from './MapPolyline';
|
|
10
|
+
export { default as Heatmap, MapHeatmap } from './MapHeatmap';
|
|
11
|
+
export type { MapHeatmapProps } from './MapHeatmap';
|
|
12
|
+
export { default as Polygon, MapPolygon } from './MapPolygon';
|
|
13
|
+
export type { MapPolygonProps } from './MapPolygon';
|
|
14
|
+
export { default as Circle, MapCircle } from './MapCircle';
|
|
15
|
+
export type { MapCircleProps } from './MapCircle';
|
|
16
|
+
export { default as UrlTile, MapUrlTile } from './MapUrlTile';
|
|
17
|
+
export type { MapUrlTileProps } from './MapUrlTile';
|
|
18
|
+
export { default as WMSTile, MapWMSTile } from './MapWMSTile';
|
|
19
|
+
export type { MapWMSTileProps } from './MapWMSTile';
|
|
20
|
+
export { default as LocalTile, MapLocalTile } from './MapLocalTile';
|
|
21
|
+
export type { MapLocalTileProps } from './MapLocalTile';
|
|
22
|
+
export { default as Callout, MapCallout } from './MapCallout';
|
|
23
|
+
export type { MapCalloutProps } from './MapCallout';
|
|
24
|
+
export { default as CalloutSubview, MapCalloutSubview, } from './MapCalloutSubview';
|
|
25
|
+
export type { MapCalloutSubviewProps } from './MapCalloutSubview';
|
|
26
|
+
export { default as AnimatedRegion } from './AnimatedRegion';
|
|
27
|
+
export { default as Geojson } from './Geojson';
|
|
28
|
+
export type { GeojsonProps } from './Geojson';
|
|
29
|
+
export { Marker, Overlay };
|
|
30
|
+
export type { MapViewProps };
|
|
31
|
+
export { Animated, MAP_TYPES };
|
|
32
|
+
export * from './ProviderConstants';
|
|
33
|
+
export * from './MapView.types';
|
|
34
|
+
export * from './MapPolygon.types';
|
|
35
|
+
export * from './sharedTypes';
|
|
36
|
+
export declare const MarkerAnimated: import("react-native").Animated.AnimatedComponent<typeof import("./MapMarker").MapMarker>;
|
|
37
|
+
export declare const OverlayAnimated: import("react-native").Animated.AnimatedComponent<typeof import("./MapOverlay").MapOverlay>;
|
|
38
|
+
export default MapView;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { NativeSyntheticEvent } from 'react-native';
|
|
2
|
+
export type Provider = 'google' | undefined;
|
|
3
|
+
export type LatLng = {
|
|
4
|
+
latitude: number;
|
|
5
|
+
longitude: number;
|
|
6
|
+
};
|
|
7
|
+
export type Point = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export type Region = LatLng & {
|
|
12
|
+
latitudeDelta: number;
|
|
13
|
+
longitudeDelta: number;
|
|
14
|
+
};
|
|
15
|
+
export type Frame = Point & {
|
|
16
|
+
height: number;
|
|
17
|
+
width: number;
|
|
18
|
+
};
|
|
19
|
+
export type CalloutPressEvent = NativeSyntheticEvent<{
|
|
20
|
+
action: 'callout-press';
|
|
21
|
+
/**
|
|
22
|
+
* @platform iOS
|
|
23
|
+
*/
|
|
24
|
+
frame?: Frame;
|
|
25
|
+
/**
|
|
26
|
+
* @platform iOS
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
29
|
+
/**
|
|
30
|
+
* @platform iOS
|
|
31
|
+
*/
|
|
32
|
+
point?: Point;
|
|
33
|
+
/**
|
|
34
|
+
* @platform Android
|
|
35
|
+
*/
|
|
36
|
+
coordinate?: LatLng;
|
|
37
|
+
/**
|
|
38
|
+
* @platform Android
|
|
39
|
+
*/
|
|
40
|
+
position?: Point;
|
|
41
|
+
}>;
|
|
42
|
+
export type LineCapType = 'butt' | 'round' | 'square';
|
|
43
|
+
export type LineJoinType = 'miter' | 'round' | 'bevel';
|
|
44
|
+
export type ClickEvent<T = {}> = NativeSyntheticEvent<{
|
|
45
|
+
coordinate: LatLng;
|
|
46
|
+
position: Point;
|
|
47
|
+
} & T>;
|
|
48
|
+
export type MarkerDeselectEvent = Omit<ClickEvent<{
|
|
49
|
+
action: 'marker-deselect';
|
|
50
|
+
id: string;
|
|
51
|
+
}>, 'position'>;
|
|
52
|
+
export type MarkerSelectEvent = Omit<ClickEvent<{
|
|
53
|
+
id: string;
|
|
54
|
+
action: 'marker-select';
|
|
55
|
+
}>, 'position'>;
|
|
56
|
+
export type MarkerDragEvent = ClickEvent<{
|
|
57
|
+
/**
|
|
58
|
+
* @platform iOS
|
|
59
|
+
*/
|
|
60
|
+
id?: string;
|
|
61
|
+
}>;
|
|
62
|
+
export type MarkerDragStartEndEvent = NativeSyntheticEvent<{
|
|
63
|
+
coordinate: LatLng;
|
|
64
|
+
/**
|
|
65
|
+
* @platform iOS
|
|
66
|
+
*/
|
|
67
|
+
id?: string;
|
|
68
|
+
/**
|
|
69
|
+
* @platform Android
|
|
70
|
+
*/
|
|
71
|
+
position?: Point;
|
|
72
|
+
}>;
|
|
73
|
+
export type MarkerPressEvent = NativeSyntheticEvent<{
|
|
74
|
+
id: string;
|
|
75
|
+
action: 'marker-press';
|
|
76
|
+
coordinate: LatLng;
|
|
77
|
+
/**
|
|
78
|
+
* @platform Android
|
|
79
|
+
*/
|
|
80
|
+
position?: Point;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* Represents the available categories for points of interest on the Apple Maps.
|
|
84
|
+
* Use an array of these strings for the `pointsOfInterestFilter` prop.
|
|
85
|
+
* More: https://developer.apple.com/documentation/mapkit/mkpointofinterestcategory
|
|
86
|
+
*/
|
|
87
|
+
export type MKPointOfInterestCategoryType = 'museum' | 'musicVenue' | 'theater' | 'library' | 'planetarium' | 'school' | 'university' | 'movieTheater' | 'nightlife' | 'fireStation' | 'hospital' | 'pharmacy' | 'police' | 'castle' | 'fortress' | 'landmark' | 'nationalMonument' | 'bakery' | 'brewery' | 'cafe' | 'distillery' | 'foodMarket' | 'restaurant' | 'winery' | 'animalService' | 'atm' | 'automotiveRepair' | 'bank' | 'beauty' | 'evCharger' | 'fitnessCenter' | 'laundry' | 'mailbox' | 'postOffice' | 'restroom' | 'spa' | 'store' | 'amusementPark' | 'aquarium' | 'beach' | 'campground' | 'fairground' | 'marina' | 'nationalPark' | 'park' | 'rvPark' | 'zoo' | 'baseball' | 'basketball' | 'bowling' | 'goKart' | 'golf' | 'hiking' | 'miniGolf' | 'rockClimbing' | 'skatePark' | 'skating' | 'skiing' | 'soccer' | 'stadium' | 'tennis' | 'volleyball' | 'airport' | 'carRental' | 'conventionCenter' | 'gasStation' | 'hotel' | 'parking' | 'publicTransport' | 'fishing' | 'kayaking' | 'surfing' | 'swimming';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Modify<T, R> = Omit<T, keyof R> & R;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
import type { Camera } from './NativeComponentMapView';
|
|
4
|
+
import type { Address } from '../MapView.types';
|
|
5
|
+
type LatLng = {
|
|
6
|
+
latitude: Double;
|
|
7
|
+
longitude: Double;
|
|
8
|
+
};
|
|
9
|
+
type Point = Readonly<{
|
|
10
|
+
x: Double;
|
|
11
|
+
y: Double;
|
|
12
|
+
}>;
|
|
13
|
+
export type Region = Readonly<LatLng & {
|
|
14
|
+
latitudeDelta: Double;
|
|
15
|
+
longitudeDelta: Double;
|
|
16
|
+
}>;
|
|
17
|
+
export type MapBoundaries = {
|
|
18
|
+
northEast: LatLng;
|
|
19
|
+
southWest: LatLng;
|
|
20
|
+
};
|
|
21
|
+
export interface Spec extends TurboModule {
|
|
22
|
+
getCamera(tag: Double): Promise<Camera>;
|
|
23
|
+
getMarkersFrames(tag: Double, onlyVisible: boolean): Promise<unknown>;
|
|
24
|
+
getMapBoundaries(tag: Double): Promise<MapBoundaries>;
|
|
25
|
+
takeSnapshot(tag: Double, config: string): Promise<string>;
|
|
26
|
+
getAddressFromCoordinates(tag: Double, coordinate: LatLng): Promise<Address>;
|
|
27
|
+
getPointForCoordinate(tag: Double, coordinate: LatLng): Promise<Point>;
|
|
28
|
+
getCoordinateForPoint(tag: Double, point: Point): Promise<LatLng>;
|
|
29
|
+
}
|
|
30
|
+
declare const _default: Spec;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
import type { Double, BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export type LatLng = Readonly<{
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}>;
|
|
7
|
+
export type CalloutPressEvent = BubblingEventHandler<Readonly<{
|
|
8
|
+
action?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
coordinate: {
|
|
11
|
+
latitude: Double;
|
|
12
|
+
longitude: Double;
|
|
13
|
+
};
|
|
14
|
+
position?: {
|
|
15
|
+
x: Double;
|
|
16
|
+
y: Double;
|
|
17
|
+
};
|
|
18
|
+
}>>;
|
|
19
|
+
export interface CalloutFabricNativeProps extends ViewProps {
|
|
20
|
+
/**
|
|
21
|
+
* If `true`, clicks on transparent areas in callout will be passed to map.
|
|
22
|
+
*
|
|
23
|
+
* @default false
|
|
24
|
+
* @platform iOS: Supported
|
|
25
|
+
* @platform Android: Not supported
|
|
26
|
+
*/
|
|
27
|
+
alphaHitTest?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback that is called when the user presses on the callout
|
|
30
|
+
*
|
|
31
|
+
* @platform iOS: Apple Maps only
|
|
32
|
+
* @platform Android: Supported
|
|
33
|
+
*/
|
|
34
|
+
onPress?: CalloutPressEvent;
|
|
35
|
+
/**
|
|
36
|
+
* If `false`, a default "tooltip" bubble window will be drawn around this callouts children.
|
|
37
|
+
* If `true`, the child views can fully customize their appearance, including any "bubble" like styles.
|
|
38
|
+
*
|
|
39
|
+
* @default false
|
|
40
|
+
* @platform iOS: Supported
|
|
41
|
+
* @platform Android: Supported
|
|
42
|
+
*/
|
|
43
|
+
tooltip?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare const _default: HostComponent<CalloutFabricNativeProps>;
|
|
46
|
+
export default _default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps, ColorValue } from 'react-native';
|
|
2
|
+
import type { Double, Float, BubblingEventHandler, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export type LatLng = Readonly<{
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}>;
|
|
7
|
+
export type CirclePressEventHandler = BubblingEventHandler<Readonly<{
|
|
8
|
+
action?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
coordinate: {
|
|
11
|
+
latitude: Double;
|
|
12
|
+
longitude: Double;
|
|
13
|
+
};
|
|
14
|
+
position?: {
|
|
15
|
+
x: Double;
|
|
16
|
+
y: Double;
|
|
17
|
+
};
|
|
18
|
+
}>>;
|
|
19
|
+
export interface CircleFabricNativeProps extends ViewProps {
|
|
20
|
+
/**
|
|
21
|
+
* The coordinates of the center of the circle.
|
|
22
|
+
*
|
|
23
|
+
* @platform iOS: Supported
|
|
24
|
+
* @platform Android: Supported
|
|
25
|
+
*/
|
|
26
|
+
center: LatLng;
|
|
27
|
+
/**
|
|
28
|
+
* The stroke color to use for the path.
|
|
29
|
+
*
|
|
30
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
31
|
+
* @platform iOS: Supported
|
|
32
|
+
* @platform Android: Supported
|
|
33
|
+
*/
|
|
34
|
+
fillColor?: ColorValue;
|
|
35
|
+
/**
|
|
36
|
+
* The radius of the circle to be drawn (in meters)
|
|
37
|
+
*
|
|
38
|
+
* @platform iOS: Supported
|
|
39
|
+
* @platform Android: Supported
|
|
40
|
+
*/
|
|
41
|
+
radius: Double;
|
|
42
|
+
/**
|
|
43
|
+
* The stroke color to use for the path.
|
|
44
|
+
*
|
|
45
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
46
|
+
* @platform iOS: Supported
|
|
47
|
+
* @platform Android: Supported
|
|
48
|
+
*/
|
|
49
|
+
strokeColor?: ColorValue;
|
|
50
|
+
/**
|
|
51
|
+
* Callback that is called when user taps on the map.
|
|
52
|
+
*
|
|
53
|
+
* @platform iOS: Supported
|
|
54
|
+
* @platform Android: Supported
|
|
55
|
+
*/
|
|
56
|
+
onPress?: CirclePressEventHandler;
|
|
57
|
+
/**
|
|
58
|
+
* The stroke width to use for the path.
|
|
59
|
+
*
|
|
60
|
+
* @default 1
|
|
61
|
+
* @platform iOS: Supported
|
|
62
|
+
* @platform Android: Supported
|
|
63
|
+
*/
|
|
64
|
+
strokeWidth?: WithDefault<Float, 1.0>;
|
|
65
|
+
/**
|
|
66
|
+
* Boolean to allow a polygon to be tappable and use the onPress function.
|
|
67
|
+
*
|
|
68
|
+
* @platform iOS: Google Maps only
|
|
69
|
+
* @platform Android: Supported
|
|
70
|
+
*/
|
|
71
|
+
tappable?: boolean;
|
|
72
|
+
}
|
|
73
|
+
declare const _default: HostComponent<CircleFabricNativeProps>;
|
|
74
|
+
export default _default;
|