react-native-maps 1.21.0-alpha.98 → 1.21.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/README.md +9 -4
- package/android/build.gradle +65 -72
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/RCTAppDependencyProvider.h +25 -0
- package/android/src/main/RCTAppDependencyProvider.mm +55 -0
- package/android/src/main/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/src/main/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/src/main/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/src/main/RCTThirdPartyComponentsProvider.mm +28 -0
- package/android/src/main/ReactAppDependencyProvider.podspec +34 -0
- package/android/src/main/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +17 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +23 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +23 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +209 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +45 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +22 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +26 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerDelegate.java +62 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerInterface.java +27 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerDelegate.java +56 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerInterface.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +5 -1
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +1 -1
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +9 -3
- package/android/src/main/java/com/rnmaps/fabric/UrlTileManager.java +124 -0
- package/android/src/main/java/com/rnmaps/fabric/WMSTileManager.java +114 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +19 -3
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +608 -603
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +2 -22
- package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +23 -1
- package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +18 -18
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +10 -14
- package/android/src/main/java/com/rnmaps/maps/MapView.java +58 -49
- package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +10 -10
- package/android/src/main/jni/CMakeLists.txt +36 -0
- package/android/src/main/jni/RNMapsSpecs-generated.cpp +68 -0
- package/android/src/main/jni/RNMapsSpecs.h +31 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +31 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +33 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +979 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +860 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +227 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +1297 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +26 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +131 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +137 -0
- package/ios/AirGoogleMaps/AIRGoogleMap.h +13 -13
- package/ios/AirGoogleMaps/{AIRGoogleMap.m → AIRGoogleMap.mm} +32 -34
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.mm +543 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +5 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +41 -33
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +23 -14
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +1 -0
- package/ios/AirMaps/AIRMap.h +8 -9
- package/ios/AirMaps/{AIRMap.m → AIRMap.mm} +18 -14
- package/ios/AirMaps/AIRMapManager.m +8 -19
- package/ios/AirMaps/AIRMapMarker.m +57 -44
- package/ios/AirMaps/AIRMapOverlay.m +2 -2
- package/ios/AirMaps/AIRMapWMSTile.m +8 -8
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +77 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +51 -0
- package/ios/AirMaps/RNMapsAirModule.h +2 -3
- package/ios/AirMaps/RNMapsAirModule.mm +14 -0
- package/ios/AirMaps/RNMapsDefines.h +1 -0
- package/ios/AirMaps/RNMapsMapView.h +5 -2
- package/ios/AirMaps/RNMapsMapView.mm +16 -6
- package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
- package/ios/AirMaps/RNMapsMarkerView.mm +12 -4
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +7 -0
- package/ios/AirMaps/module.modulemap +6 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +15 -55
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +26 -0
- package/ios/{AirMaps → generated}/RNMapsAirModuleDelegate.h +1 -1
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +977 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +846 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +194 -0
- package/ios/generated/RNMapsSpecs/Props.h +1224 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +591 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +24 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +109 -0
- package/ios/generated/RNMapsSpecs/States.cpp +16 -0
- package/ios/generated/RNMapsSpecs/States.h +113 -0
- package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
- package/ios/generated/RNMapsSpecsJSI.h +268 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/ios/generated/module.modulemap +15 -0
- package/package.json +30 -25
- package/react-native-google-maps.podspec +27 -0
- package/react-native-maps-generated.podspec +31 -0
- package/react-native-maps.podspec +52 -46
- package/react-native.config.js +16 -0
- package/src/AnimatedRegion.ts +169 -0
- package/src/Geojson.tsx +541 -0
- package/src/MapCallout.tsx +77 -0
- package/src/MapCalloutSubview.tsx +64 -0
- package/src/MapCircle.tsx +162 -0
- package/src/MapHeatmap.tsx +125 -0
- package/src/MapLocalTile.tsx +60 -0
- package/src/MapMarker.tsx +531 -0
- package/src/MapMarkerNativeComponent.ts +51 -0
- package/src/MapOverlay.tsx +178 -0
- package/src/MapPolygon.tsx +188 -0
- package/src/MapPolygon.types.ts +25 -0
- package/src/MapPolyline.tsx +215 -0
- package/src/MapUrlTile.tsx +169 -0
- package/src/MapView.tsx +1230 -0
- package/src/MapView.types.ts +212 -0
- package/src/MapView.web.ts +2 -0
- package/src/MapViewNativeComponent.ts +86 -0
- package/src/MapWMSTile.tsx +148 -0
- package/src/ProviderConstants.ts +2 -0
- package/src/createFabricMap.tsx +253 -0
- package/src/decorateMapComponent.ts +227 -0
- package/src/fixImageProp.ts +17 -0
- package/src/index.ts +52 -0
- package/src/sharedTypes.ts +101 -0
- package/{specs → src/specs}/NativeComponentCircle.ts +3 -4
- package/{specs → src/specs}/NativeComponentGoogleMapView.ts +15 -9
- package/{specs → src/specs}/NativeComponentMapView.ts +61 -32
- package/{specs → src/specs}/NativeComponentOverlay.ts +11 -2
- package/{specs → src/specs}/NativeComponentPolyline.ts +1 -1
- package/src/specs/NativeComponentUrlTile.ts +128 -0
- package/src/specs/NativeComponentWMSTile.ts +107 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -533
- package/lib/AnimatedRegion.d.ts +0 -19
- package/lib/AnimatedRegion.js +0 -134
- package/lib/Geojson.d.ts +0 -204
- package/lib/Geojson.js +0 -166
- package/lib/MapCallout.d.ts +0 -40
- package/lib/MapCallout.js +0 -51
- package/lib/MapCalloutSubview.d.ts +0 -34
- package/lib/MapCalloutSubview.js +0 -48
- package/lib/MapCircle.d.ts +0 -117
- package/lib/MapCircle.js +0 -53
- package/lib/MapHeatmap.d.ts +0 -78
- package/lib/MapHeatmap.js +0 -59
- package/lib/MapLocalTile.d.ts +0 -35
- package/lib/MapLocalTile.js +0 -44
- package/lib/MapMarker.d.ts +0 -322
- package/lib/MapMarker.js +0 -158
- package/lib/MapMarkerNativeComponent.d.ts +0 -15
- package/lib/MapMarkerNativeComponent.js +0 -15
- package/lib/MapOverlay.d.ts +0 -88
- package/lib/MapOverlay.js +0 -65
- package/lib/MapPolygon.d.ts +0 -140
- package/lib/MapPolygon.js +0 -53
- package/lib/MapPolygon.types.d.ts +0 -18
- package/lib/MapPolygon.types.js +0 -2
- package/lib/MapPolyline.d.ts +0 -156
- package/lib/MapPolyline.js +0 -53
- package/lib/MapUrlTile.d.ts +0 -134
- package/lib/MapUrlTile.js +0 -44
- package/lib/MapView.d.ts +0 -703
- package/lib/MapView.js +0 -427
- package/lib/MapView.types.d.ts +0 -161
- package/lib/MapView.types.js +0 -2
- package/lib/MapView.web.d.ts +0 -1
- package/lib/MapView.web.js +0 -9
- package/lib/MapViewNativeComponent.d.ts +0 -18
- package/lib/MapViewNativeComponent.js +0 -19
- package/lib/MapWMSTile.d.ts +0 -116
- package/lib/MapWMSTile.js +0 -44
- package/lib/ProviderConstants.d.ts +0 -2
- package/lib/ProviderConstants.js +0 -5
- package/lib/createFabricMap.d.ts +0 -24
- package/lib/createFabricMap.js +0 -188
- package/lib/decorateMapComponent.d.ts +0 -36
- package/lib/decorateMapComponent.js +0 -120
- package/lib/fixImageProp.d.ts +0 -4
- package/lib/fixImageProp.js +0 -16
- package/lib/index.d.ts +0 -38
- package/lib/index.js +0 -81
- package/lib/sharedTypes.d.ts +0 -81
- package/lib/sharedTypes.js +0 -2
- package/lib/sharedTypesInternal.js +0 -2
- package/lib/specs/NativeAirMapsModule.d.ts +0 -31
- package/lib/specs/NativeAirMapsModule.js +0 -4
- package/lib/specs/NativeComponentCallout.d.ts +0 -46
- package/lib/specs/NativeComponentCallout.js +0 -9
- package/lib/specs/NativeComponentCircle.d.ts +0 -74
- package/lib/specs/NativeComponentCircle.js +0 -7
- package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -713
- package/lib/specs/NativeComponentGoogleMapView.js +0 -22
- package/lib/specs/NativeComponentGooglePolygon.d.ts +0 -75
- package/lib/specs/NativeComponentGooglePolygon.js +0 -7
- package/lib/specs/NativeComponentMapView.d.ts +0 -847
- package/lib/specs/NativeComponentMapView.js +0 -20
- package/lib/specs/NativeComponentMarker.d.ts +0 -258
- package/lib/specs/NativeComponentMarker.js +0 -19
- package/lib/specs/NativeComponentOverlay.d.ts +0 -67
- package/lib/specs/NativeComponentOverlay.js +0 -7
- package/lib/specs/NativeComponentPolyline.d.ts +0 -101
- package/lib/specs/NativeComponentPolyline.js +0 -7
- /package/ios/AirMaps/{UIView +AirMap.m → UIView+AirMap.m} +0 -0
- /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
- /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
- /package/{specs → src/specs}/NativeAirMapsModule.ts +0 -0
- /package/{specs → src/specs}/NativeComponentCallout.ts +0 -0
- /package/{specs → src/specs}/NativeComponentGooglePolygon.ts +0 -0
- /package/{specs → src/specs}/NativeComponentMarker.ts +0 -0
package/lib/MapWMSTile.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ViewProps } from 'react-native';
|
|
3
|
-
import { ProviderContext, NativeComponent, MapManagerCommand, 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;
|
package/lib/MapWMSTile.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.MapWMSTile = void 0;
|
|
27
|
-
const React = __importStar(require("react"));
|
|
28
|
-
const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
|
|
29
|
-
class MapWMSTile extends React.Component {
|
|
30
|
-
getNativeComponent;
|
|
31
|
-
getMapManagerCommand;
|
|
32
|
-
getUIManagerCommand;
|
|
33
|
-
render() {
|
|
34
|
-
const AIRMapWMSTile = this.getNativeComponent();
|
|
35
|
-
return <AIRMapWMSTile {...this.props}/>;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.MapWMSTile = MapWMSTile;
|
|
39
|
-
exports.default = (0, decorateMapComponent_1.default)(MapWMSTile, 'WMSTile', {
|
|
40
|
-
google: {
|
|
41
|
-
ios: decorateMapComponent_1.SUPPORTED,
|
|
42
|
-
android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
|
|
43
|
-
},
|
|
44
|
-
});
|
package/lib/ProviderConstants.js
DELETED
package/lib/createFabricMap.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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 { MapBoundaries } from './specs/NativeAirMapsModule';
|
|
5
|
-
import { MapFabricNativeProps } from './specs/NativeComponentMapView';
|
|
6
|
-
export type FabricMapViewProps = MapFabricNativeProps;
|
|
7
|
-
export interface FabricMapHandle {
|
|
8
|
-
getCamera: () => Promise<Camera>;
|
|
9
|
-
setCamera: (camera: Partial<Camera>) => void;
|
|
10
|
-
animateToRegion: (region: Region, duration: number) => void;
|
|
11
|
-
animateCamera: (camera: Partial<Camera>, duration: number) => void;
|
|
12
|
-
getMarkersFrames: (onlyVisible: boolean) => Promise<unknown>;
|
|
13
|
-
fitToElements: (edgePadding: EdgePadding, animated: boolean) => void;
|
|
14
|
-
fitToSuppliedMarkers: (markers: string[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
15
|
-
fitToCoordinates: (coordinates: LatLng[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
16
|
-
getMapBoundaries: () => Promise<MapBoundaries>;
|
|
17
|
-
takeSnapshot: (config: SnapshotOptions) => Promise<string>;
|
|
18
|
-
getAddressFromCoordinates: (coordinate: LatLng) => Promise<Address>;
|
|
19
|
-
getPointForCoordinate: (coordinate: LatLng) => Promise<Point>;
|
|
20
|
-
getCoordinateForPoint: (point: Point) => Promise<LatLng>;
|
|
21
|
-
setIndoorActiveLevelIndex: (activeLevelIndex: number) => void;
|
|
22
|
-
}
|
|
23
|
-
declare const createFabricMap: (ViewComponent: React.ComponentType, Commands: any) => React.ForwardRefExoticComponent<MapFabricNativeProps & React.RefAttributes<FabricMapHandle>>;
|
|
24
|
-
export default createFabricMap;
|
package/lib/createFabricMap.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const react_native_1 = require("react-native");
|
|
31
|
-
const NativeAirMapsModule_1 = __importDefault(require("./specs/NativeAirMapsModule"));
|
|
32
|
-
const createFabricMap = (ViewComponent, Commands) => {
|
|
33
|
-
return (0, react_1.forwardRef)((props, ref) => {
|
|
34
|
-
const fabricRef = (0, react_1.useRef)(null);
|
|
35
|
-
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
36
|
-
async getMarkersFrames(onlyVisible) {
|
|
37
|
-
if (fabricRef.current) {
|
|
38
|
-
return NativeAirMapsModule_1.default.getMarkersFrames((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, onlyVisible);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
throw new Error('getMarkersFrames is only supported on iOS with Fabric.');
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
async getCoordinateForPoint(point) {
|
|
45
|
-
if (fabricRef.current) {
|
|
46
|
-
return NativeAirMapsModule_1.default.getCoordinateForPoint((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, point);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
throw new Error('getCoordinateForPoint is only supported on iOS with Fabric.');
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
async getPointForCoordinate(coordinate) {
|
|
53
|
-
if (fabricRef.current) {
|
|
54
|
-
return NativeAirMapsModule_1.default.getPointForCoordinate((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new Error('getPointForCoordinate is not supported on this platform.');
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
async getAddressFromCoordinates(coordinate) {
|
|
61
|
-
if (fabricRef.current) {
|
|
62
|
-
return NativeAirMapsModule_1.default.getAddressFromCoordinates((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
throw new Error('getAddressFromCoordinates is not supported on this platform');
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
async takeSnapshot(config) {
|
|
69
|
-
if (fabricRef.current) {
|
|
70
|
-
return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, JSON.stringify(config));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
throw new Error('takeSnapshot is only supported on iOS with Fabric.');
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
async getCamera() {
|
|
77
|
-
if (fabricRef.current) {
|
|
78
|
-
return NativeAirMapsModule_1.default.getCamera((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
throw new Error('getCamera is only supported on iOS with Fabric.');
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
async getMapBoundaries() {
|
|
85
|
-
if (fabricRef.current) {
|
|
86
|
-
return NativeAirMapsModule_1.default.getMapBoundaries((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
throw new Error('getMapBoundaries is only supported on iOS with Fabric.');
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
animateToRegion(region, duration) {
|
|
93
|
-
if (fabricRef.current) {
|
|
94
|
-
try {
|
|
95
|
-
Commands.animateToRegion(fabricRef.current, JSON.stringify(region), duration);
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
throw new Error('Failed to animateToRegion');
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
throw new Error('animateToRegion is only supported on iOS with Fabric.');
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
fitToElements(edgePadding, animated) {
|
|
106
|
-
if (fabricRef.current) {
|
|
107
|
-
try {
|
|
108
|
-
Commands.fitToElements(fabricRef.current, JSON.stringify(edgePadding), animated);
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
throw new Error('Failed to fitToElements');
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
throw new Error('fitToElements is only supported on iOS with Fabric.');
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
fitToSuppliedMarkers(markers, edgePadding, animated) {
|
|
119
|
-
if (fabricRef.current) {
|
|
120
|
-
try {
|
|
121
|
-
Commands.fitToSuppliedMarkers(fabricRef.current, JSON.stringify(markers), JSON.stringify(edgePadding), animated);
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
throw new Error('Failed to fitToSuppliedMarkers');
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
throw new Error('fitToSuppliedMarkers is only supported on iOS with Fabric.');
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
animateCamera(camera, duration) {
|
|
132
|
-
if (fabricRef.current) {
|
|
133
|
-
try {
|
|
134
|
-
Commands.animateCamera(fabricRef.current, JSON.stringify(camera), duration);
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
throw new Error('Failed to animateCamera');
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
throw new Error('animateCamera is only supported on iOS with Fabric.');
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
fitToCoordinates(coordinates, edgePadding, animated) {
|
|
145
|
-
if (fabricRef.current) {
|
|
146
|
-
try {
|
|
147
|
-
Commands.fitToCoordinates(fabricRef.current, JSON.stringify(coordinates), JSON.stringify(edgePadding), animated);
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
throw new Error('Failed to fitToCoordinates');
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
throw new Error('fitToCoordinates is only supported on iOS with Fabric.');
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
setIndoorActiveLevelIndex(activeLevelIndex) {
|
|
158
|
-
if (fabricRef.current) {
|
|
159
|
-
try {
|
|
160
|
-
Commands.setIndoorActiveLevelIndex(fabricRef.current, activeLevelIndex);
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
console.error('Failed to set camera:', error);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
console.warn('setIndoorActiveLevelIndex is not supported.');
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
setCamera(camera) {
|
|
171
|
-
if (fabricRef.current) {
|
|
172
|
-
try {
|
|
173
|
-
Commands.setCamera(fabricRef.current, JSON.stringify(camera));
|
|
174
|
-
}
|
|
175
|
-
catch (error) {
|
|
176
|
-
console.error('Failed to set camera:', error);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
console.warn('setCamera is not supported');
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
}));
|
|
184
|
-
// @ts-ignore
|
|
185
|
-
return <ViewComponent {...props} ref={fabricRef}/>;
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
exports.default = createFabricMap;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { HostComponent } from 'react-native';
|
|
3
|
-
import { Provider } from './sharedTypes';
|
|
4
|
-
import { MapCallout } from './MapCallout';
|
|
5
|
-
import { MapOverlay } from './MapOverlay';
|
|
6
|
-
import { MapCalloutSubview } from './MapCalloutSubview';
|
|
7
|
-
import { MapCircle } from './MapCircle';
|
|
8
|
-
import { MapHeatmap } from './MapHeatmap';
|
|
9
|
-
import { MapLocalTile } from './MapLocalTile';
|
|
10
|
-
import { MapMarker } from './MapMarker';
|
|
11
|
-
import { MapPolygon } from './MapPolygon';
|
|
12
|
-
import { MapPolyline } from './MapPolyline';
|
|
13
|
-
import { MapUrlTile } from './MapUrlTile';
|
|
14
|
-
import { MapWMSTile } from './MapWMSTile';
|
|
15
|
-
import { Commands } from './MapViewNativeComponent';
|
|
16
|
-
export declare const SUPPORTED: ImplementationStatus;
|
|
17
|
-
export declare const USES_DEFAULT_IMPLEMENTATION: ImplementationStatus;
|
|
18
|
-
export declare const NOT_SUPPORTED: ImplementationStatus;
|
|
19
|
-
export declare const ProviderContext: import("react").Context<Provider>;
|
|
20
|
-
export declare function getNativeMapName(provider: Provider): "AIRMap" | "AIRGoogleMap";
|
|
21
|
-
export declare const createNotSupportedComponent: (message: string) => () => null;
|
|
22
|
-
export declare const googleMapIsInstalled: boolean;
|
|
23
|
-
export default function decorateMapComponent<Type extends Component>(Component: Type, componentName: ComponentName, providers: Providers): Type;
|
|
24
|
-
type ImplementationStatus = 'SUPPORTED' | 'USES_DEFAULT_IMPLEMENTATION' | 'NOT_SUPPORTED';
|
|
25
|
-
type Providers = {
|
|
26
|
-
google: {
|
|
27
|
-
ios: ImplementationStatus;
|
|
28
|
-
android: ImplementationStatus;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export type UIManagerCommand = number;
|
|
32
|
-
export type MapManagerCommand = keyof typeof Commands;
|
|
33
|
-
export type NativeComponent<H = unknown> = HostComponent<H> | ReturnType<typeof createNotSupportedComponent>;
|
|
34
|
-
type Component = typeof MapCallout | typeof MapCalloutSubview | typeof MapCircle | typeof MapHeatmap | typeof MapLocalTile | typeof MapMarker | typeof MapOverlay | typeof MapPolygon | typeof MapPolyline | typeof MapUrlTile | typeof MapWMSTile;
|
|
35
|
-
type ComponentName = 'Callout' | 'CalloutSubview' | 'Circle' | 'Heatmap' | 'LocalTile' | 'Marker' | 'Overlay' | 'Polygon' | 'Polyline' | 'UrlTile' | 'WMSTile';
|
|
36
|
-
export {};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.googleMapIsInstalled = exports.createNotSupportedComponent = exports.getNativeMapName = exports.ProviderContext = exports.NOT_SUPPORTED = exports.USES_DEFAULT_IMPLEMENTATION = exports.SUPPORTED = void 0;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const react_native_1 = require("react-native");
|
|
9
|
-
const ProviderConstants_1 = require("./ProviderConstants");
|
|
10
|
-
const NativeComponentGooglePolygon_1 = __importDefault(require("./specs/NativeComponentGooglePolygon"));
|
|
11
|
-
const NativeComponentMarker_1 = __importDefault(require("./specs/NativeComponentMarker"));
|
|
12
|
-
const NativeComponentCallout_1 = __importDefault(require("./specs/NativeComponentCallout"));
|
|
13
|
-
const NativeComponentPolyline_1 = __importDefault(require("./specs/NativeComponentPolyline"));
|
|
14
|
-
const NativeComponentCircle_1 = __importDefault(require("./specs/NativeComponentCircle"));
|
|
15
|
-
const NativeComponentOverlay_1 = __importDefault(require("./specs/NativeComponentOverlay"));
|
|
16
|
-
exports.SUPPORTED = 'SUPPORTED';
|
|
17
|
-
exports.USES_DEFAULT_IMPLEMENTATION = 'USES_DEFAULT_IMPLEMENTATION';
|
|
18
|
-
exports.NOT_SUPPORTED = 'NOT_SUPPORTED';
|
|
19
|
-
exports.ProviderContext = (0, react_1.createContext)(undefined);
|
|
20
|
-
function getNativeMapName(provider) {
|
|
21
|
-
if (react_native_1.Platform.OS === 'android') {
|
|
22
|
-
return 'AIRMap';
|
|
23
|
-
}
|
|
24
|
-
if (provider === ProviderConstants_1.PROVIDER_GOOGLE) {
|
|
25
|
-
return 'AIRGoogleMap';
|
|
26
|
-
}
|
|
27
|
-
return 'AIRMap';
|
|
28
|
-
}
|
|
29
|
-
exports.getNativeMapName = getNativeMapName;
|
|
30
|
-
function getNativeComponentName(provider, component) {
|
|
31
|
-
return `${getNativeMapName(provider)}${component}`;
|
|
32
|
-
}
|
|
33
|
-
const createNotSupportedComponent = (message) => () => {
|
|
34
|
-
console.error(message);
|
|
35
|
-
return null;
|
|
36
|
-
};
|
|
37
|
-
exports.createNotSupportedComponent = createNotSupportedComponent;
|
|
38
|
-
exports.googleMapIsInstalled = !!react_native_1.UIManager.hasViewManagerConfig(getNativeMapName(ProviderConstants_1.PROVIDER_GOOGLE));
|
|
39
|
-
function decorateMapComponent(Component, componentName, providers) {
|
|
40
|
-
const components = {};
|
|
41
|
-
const getDefaultComponent = () => (0, react_native_1.requireNativeComponent)(getNativeComponentName(undefined, componentName));
|
|
42
|
-
Component.contextType = exports.ProviderContext;
|
|
43
|
-
Component.prototype.getNativeComponent =
|
|
44
|
-
function getNativeComponent() {
|
|
45
|
-
const provider = this.context;
|
|
46
|
-
if (componentName === 'Marker' &&
|
|
47
|
-
(react_native_1.Platform.OS !== 'ios' || provider !== ProviderConstants_1.PROVIDER_GOOGLE)) {
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
return NativeComponentMarker_1.default;
|
|
50
|
-
}
|
|
51
|
-
if (componentName === 'Polygon' &&
|
|
52
|
-
((provider === ProviderConstants_1.PROVIDER_GOOGLE &&
|
|
53
|
-
react_native_1.Platform.OS === 'ios' &&
|
|
54
|
-
exports.googleMapIsInstalled) ||
|
|
55
|
-
react_native_1.Platform.OS === 'android')) {
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
return NativeComponentGooglePolygon_1.default;
|
|
58
|
-
}
|
|
59
|
-
if (react_native_1.Platform.OS === 'android') {
|
|
60
|
-
if (componentName === 'Callout') {
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
return NativeComponentCallout_1.default;
|
|
63
|
-
}
|
|
64
|
-
else if (componentName === 'Polyline') {
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
return NativeComponentPolyline_1.default;
|
|
67
|
-
}
|
|
68
|
-
else if (componentName === 'Circle') {
|
|
69
|
-
// @ts-ignore
|
|
70
|
-
return NativeComponentCircle_1.default;
|
|
71
|
-
}
|
|
72
|
-
else if (componentName === 'Overlay') {
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
return NativeComponentOverlay_1.default;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const key = provider || 'default';
|
|
78
|
-
if (components[key]) {
|
|
79
|
-
return components[key];
|
|
80
|
-
}
|
|
81
|
-
if (provider === ProviderConstants_1.PROVIDER_DEFAULT) {
|
|
82
|
-
components[key] = getDefaultComponent();
|
|
83
|
-
return components[key];
|
|
84
|
-
}
|
|
85
|
-
const providerInfo = providers[provider];
|
|
86
|
-
// quick fix. Previous code assumed android | ios
|
|
87
|
-
if (react_native_1.Platform.OS !== 'android' && react_native_1.Platform.OS !== 'ios') {
|
|
88
|
-
throw new Error(`react-native-maps doesn't support ${react_native_1.Platform.OS}`);
|
|
89
|
-
}
|
|
90
|
-
const platformSupport = providerInfo[react_native_1.Platform.OS];
|
|
91
|
-
const nativeComponentName = getNativeComponentName(provider, componentName);
|
|
92
|
-
if (platformSupport === exports.NOT_SUPPORTED) {
|
|
93
|
-
components[key] = (0, exports.createNotSupportedComponent)(`react-native-maps: ${nativeComponentName} is not supported on ${react_native_1.Platform.OS}`);
|
|
94
|
-
}
|
|
95
|
-
else if (platformSupport === exports.SUPPORTED) {
|
|
96
|
-
if (provider !== ProviderConstants_1.PROVIDER_GOOGLE ||
|
|
97
|
-
(react_native_1.Platform.OS === 'ios' && exports.googleMapIsInstalled)) {
|
|
98
|
-
components[key] = (0, react_native_1.requireNativeComponent)(nativeComponentName);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
// (platformSupport === USES_DEFAULT_IMPLEMENTATION)
|
|
103
|
-
if (!components.default) {
|
|
104
|
-
components.default = getDefaultComponent();
|
|
105
|
-
}
|
|
106
|
-
components[key] = components.default;
|
|
107
|
-
}
|
|
108
|
-
return components[key];
|
|
109
|
-
};
|
|
110
|
-
Component.prototype.getUIManagerCommand = function getUIManagerCommand(name) {
|
|
111
|
-
const nativeComponentName = getNativeComponentName(this.context, componentName);
|
|
112
|
-
return react_native_1.UIManager.getViewManagerConfig(nativeComponentName).Commands[name];
|
|
113
|
-
};
|
|
114
|
-
Component.prototype.getMapManagerCommand = function getMapManagerCommand(name) {
|
|
115
|
-
const nativeComponentName = `${getNativeComponentName(this.context, componentName)}Manager`;
|
|
116
|
-
return react_native_1.NativeModules[nativeComponentName][name];
|
|
117
|
-
};
|
|
118
|
-
return Component;
|
|
119
|
-
}
|
|
120
|
-
exports.default = decorateMapComponent;
|
package/lib/fixImageProp.d.ts
DELETED
package/lib/fixImageProp.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixImageProp = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
function fixImageProp(image) {
|
|
6
|
-
if (typeof image === 'string') {
|
|
7
|
-
return { uri: image };
|
|
8
|
-
}
|
|
9
|
-
if (typeof image === 'number') {
|
|
10
|
-
// Handle local image asset (require('./image.png'))
|
|
11
|
-
const resolvedImage = react_native_1.Image.resolveAssetSource(image);
|
|
12
|
-
return resolvedImage?.uri ? { uri: resolvedImage.uri } : image;
|
|
13
|
-
}
|
|
14
|
-
return image;
|
|
15
|
-
}
|
|
16
|
-
exports.fixImageProp = fixImageProp;
|
package/lib/index.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import MapView, { AnimatedMapView as Animated, MAP_TYPES, 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/types").Animated.AnimatedComponent<typeof import("./MapMarker").MapMarker>;
|
|
37
|
-
export declare const OverlayAnimated: import("react-native/types").Animated.AnimatedComponent<typeof import("./MapOverlay").MapOverlay>;
|
|
38
|
-
export default MapView;
|