react-native-maps 1.21.0-alpha.14 → 1.21.0-alpha.140
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/build.gradle +73 -53
- package/android/gradlew +1 -2
- 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 +46 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +23 -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/CalloutManager.java +77 -0
- package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
- package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +624 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +258 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +235 -2
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +95 -0
- package/android/src/main/java/com/rnmaps/fabric/PolygonManager.java +89 -0
- package/android/src/main/java/com/rnmaps/fabric/PolylineManager.java +121 -0
- 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/fabric/event/OnCalloutPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnKmlReadyEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPanDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +55 -3
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
- package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +637 -556
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +267 -151
- package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +31 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +207 -141
- package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -16
- 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 +1649 -1336
- 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 +1263 -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 +10 -11
- package/ios/AirGoogleMaps/AIRGoogleMap.m +104 -71
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +254 -250
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -3
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +3 -0
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
- package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +4 -4
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +1 -1
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +123 -43
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +26 -0
- package/ios/AirMaps/AIRMap.h +8 -9
- package/ios/AirMaps/AIRMap.m +222 -239
- package/ios/AirMaps/AIRMapManager.m +10 -7
- package/ios/AirMaps/AIRMapMarker.h +1 -0
- package/ios/AirMaps/AIRMapMarker.m +142 -67
- package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +28 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +68 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +43 -0
- package/ios/AirMaps/RNMapsAirModule.h +1 -1
- package/ios/AirMaps/RNMapsAirModule.mm +4 -3
- package/ios/AirMaps/RNMapsDefines.h +1 -0
- package/ios/AirMaps/RNMapsMapView.h +1 -1
- package/ios/AirMaps/RNMapsMapView.mm +119 -95
- package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +430 -0
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +28 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +20 -0
- 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 +2 -2
- 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/package.json +26 -19
- package/react-native-google-maps.podspec +26 -0
- package/react-native-maps-generated.podspec +31 -0
- package/react-native-maps.podspec +55 -15
- 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 +156 -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/src/specs/NativeAirMapsModule.ts +36 -0
- package/src/specs/NativeComponentCallout.ts +63 -0
- package/src/specs/NativeComponentCircle.ts +93 -0
- package/src/specs/NativeComponentGoogleMapView.ts +922 -0
- package/src/specs/NativeComponentGooglePolygon.ts +94 -0
- package/src/specs/NativeComponentMapView.ts +1100 -0
- package/src/specs/NativeComponentMarker.ts +326 -0
- package/src/specs/NativeComponentOverlay.ts +89 -0
- package/src/specs/NativeComponentPolyline.ts +124 -0
- package/src/specs/NativeComponentUrlTile.ts +128 -0
- package/src/specs/NativeComponentWMSTile.ts +107 -0
- 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 -309
- package/lib/MapMarker.js +0 -116
- package/lib/MapMarkerNativeComponent.d.ts +0 -15
- package/lib/MapMarkerNativeComponent.js +0 -17
- package/lib/MapOverlay.d.ts +0 -87
- package/lib/MapOverlay.js +0 -63
- 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 -715
- package/lib/MapView.js +0 -447
- 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 -23
- package/lib/createFabricMap.js +0 -175
- package/lib/decorateMapComponent.d.ts +0 -36
- package/lib/decorateMapComponent.js +0 -80
- 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/NativeComponentGoogleMapView.d.ts +0 -713
- package/lib/specs/NativeComponentGoogleMapView.js +0 -21
- package/lib/specs/NativeComponentMapView.d.ts +0 -855
- package/lib/specs/NativeComponentMapView.js +0 -21
- /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
- /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type {HostComponent, ViewProps} from 'react-native';
|
|
2
|
+
|
|
3
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
4
|
+
import {Int32, WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
|
+
|
|
6
|
+
export interface WMSTileFabricNativeProps extends ViewProps {
|
|
7
|
+
/**
|
|
8
|
+
* The maximum native zoom level for this tile overlay i.e. the highest zoom level that the tile server provides.
|
|
9
|
+
* Tiles are auto-scaled for higher zoom levels.
|
|
10
|
+
*
|
|
11
|
+
* @platform iOS: Apple Maps only
|
|
12
|
+
* @platform Android: Supported
|
|
13
|
+
*/
|
|
14
|
+
maximumNativeZ?: WithDefault<Int32, 100>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The maximum zoom level for this tile overlay.
|
|
18
|
+
*
|
|
19
|
+
* @platform iOS: Supported
|
|
20
|
+
* @platform Android: Supported
|
|
21
|
+
*/
|
|
22
|
+
maximumZ?: WithDefault<Int32, 100>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The minimum zoom level for this tile overlay.
|
|
26
|
+
*
|
|
27
|
+
* @platform iOS: Supported
|
|
28
|
+
* @platform Android: Supported
|
|
29
|
+
*/
|
|
30
|
+
minimumZ?: Int32;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* In offline-mode tiles are not fetched from the tile servers, rather only tiles stored in the cache directory are used.
|
|
34
|
+
* Furthermore, automated tile scaling is activated: if tile at a desired zoom level is not found from the cache directory,
|
|
35
|
+
* then lower zoom level tile is used (up to 4 levels lower) and scaled.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
* @platform iOS: Apple Maps only
|
|
39
|
+
* @platform Android: Supported
|
|
40
|
+
*/
|
|
41
|
+
offlineMode?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Corresponds to MKTileOverlay canReplaceMapContent i.e. if true then underlying iOS basemap is not shown.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
* @platform iOS: Apple Maps only
|
|
48
|
+
* @platform Android: Not supported
|
|
49
|
+
*/
|
|
50
|
+
shouldReplaceMapContent?: boolean;
|
|
51
|
+
|
|
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?: Int32;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Enable caching of tiles in the specified directory.
|
|
66
|
+
* Directory can be specified either as a normal path or in URL format (`file://`).
|
|
67
|
+
*
|
|
68
|
+
* Tiles are stored in tileCachePath directory as `/{z}/{x}/{y}` i.e. in sub-directories 2-levels deep,
|
|
69
|
+
* filename is tile y-coordinate without any filetype-extension.
|
|
70
|
+
*
|
|
71
|
+
* NB! All cache management needs to be implemented by client e.g. deleting tiles to manage use of storage space etc.
|
|
72
|
+
*
|
|
73
|
+
* @platform iOS: Apple Maps only
|
|
74
|
+
* @platform Android: Supported
|
|
75
|
+
*/
|
|
76
|
+
tileCachePath?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Tile size, default size is 256 (for tiles of 256 _ 256 pixels).
|
|
80
|
+
* High-res (aka 'retina') tiles are 512 (tiles of 512 _ 512 pixels)
|
|
81
|
+
*
|
|
82
|
+
* @platform iOS: Supported
|
|
83
|
+
* @platform Android: Supported
|
|
84
|
+
*/
|
|
85
|
+
tileSize?: WithDefault<Int32, 256>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The url template of the map tileserver.
|
|
89
|
+
* (URLTile) The patterns {x} {y} {z} will be replaced at runtime.
|
|
90
|
+
* For example, http://c.tile.openstreetmap.org/{z}/{x}/{y}.png.
|
|
91
|
+
*
|
|
92
|
+
* It is also possible to refer to tiles in local filesystem with file:///top-level-directory/sub-directory/{z}/{x}/{y}.png URL-format.
|
|
93
|
+
* (WMSTile) The patterns {minX} {maxX} {minY} {maxY} {width} {height} will be replaced at runtime according to EPSG:900913 specification bounding box.
|
|
94
|
+
* 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.
|
|
95
|
+
*
|
|
96
|
+
* @platform iOS: Supported
|
|
97
|
+
* @platform Android: Supported
|
|
98
|
+
*/
|
|
99
|
+
urlTemplate: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default codegenNativeComponent<WMSTileFabricNativeProps>(
|
|
103
|
+
'RNMapsWMSTile',
|
|
104
|
+
{
|
|
105
|
+
excludedPlatforms: ['iOS'],
|
|
106
|
+
},
|
|
107
|
+
) as HostComponent<WMSTileFabricNativeProps>;
|
package/lib/AnimatedRegion.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Animated } from 'react-native';
|
|
2
|
-
import { Region } from './sharedTypes';
|
|
3
|
-
declare const AnimatedWithChildren: any;
|
|
4
|
-
type Props = Partial<Region> | undefined;
|
|
5
|
-
export default class AnimatedMapRegion extends AnimatedWithChildren {
|
|
6
|
-
constructor(valueIn?: Props);
|
|
7
|
-
setValue(value: Region): void;
|
|
8
|
-
setOffset(offset: Region): void;
|
|
9
|
-
flattenOffset(): void;
|
|
10
|
-
private __getValue;
|
|
11
|
-
private __attach;
|
|
12
|
-
private __detach;
|
|
13
|
-
stopAnimation(callback: (region: Region) => void): void;
|
|
14
|
-
addListener(callback: (region: Region) => void): string;
|
|
15
|
-
removeListener(id: string): void;
|
|
16
|
-
spring(config: Animated.SpringAnimationConfig & Region): Animated.CompositeAnimation;
|
|
17
|
-
timing(config: Animated.TimingAnimationConfig & Region): Animated.CompositeAnimation;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
package/lib/AnimatedRegion.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const react_native_1 = require("react-native");
|
|
4
|
-
const AnimatedWithChildren = Object.getPrototypeOf(react_native_1.Animated.ValueXY);
|
|
5
|
-
if (__DEV__) {
|
|
6
|
-
if (AnimatedWithChildren.name !== 'AnimatedWithChildren') {
|
|
7
|
-
console.error('AnimatedRegion could not obtain AnimatedWithChildren base class');
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
const configTypes = [
|
|
11
|
-
'latitude',
|
|
12
|
-
'longitude',
|
|
13
|
-
'latitudeDelta',
|
|
14
|
-
'longitudeDelta',
|
|
15
|
-
];
|
|
16
|
-
const defaultValues = {
|
|
17
|
-
// probably want to come up with better defaults
|
|
18
|
-
latitude: 0,
|
|
19
|
-
longitude: 0,
|
|
20
|
-
latitudeDelta: 0,
|
|
21
|
-
longitudeDelta: 0,
|
|
22
|
-
};
|
|
23
|
-
let _uniqueId = 1;
|
|
24
|
-
const getAnimatedValue = (valueIn, fallback) => {
|
|
25
|
-
if (valueIn instanceof react_native_1.Animated.Value) {
|
|
26
|
-
return valueIn;
|
|
27
|
-
}
|
|
28
|
-
else if (typeof valueIn === 'number') {
|
|
29
|
-
return new react_native_1.Animated.Value(valueIn);
|
|
30
|
-
}
|
|
31
|
-
return new react_native_1.Animated.Value(fallback);
|
|
32
|
-
};
|
|
33
|
-
class AnimatedMapRegion extends AnimatedWithChildren {
|
|
34
|
-
constructor(valueIn = {}) {
|
|
35
|
-
super();
|
|
36
|
-
this.latitude = getAnimatedValue(valueIn.latitude, defaultValues.latitude);
|
|
37
|
-
this.longitude = getAnimatedValue(valueIn.longitude, defaultValues.longitude);
|
|
38
|
-
this.latitudeDelta = getAnimatedValue(valueIn.latitudeDelta, defaultValues.latitudeDelta);
|
|
39
|
-
this.longitudeDelta = getAnimatedValue(valueIn.longitudeDelta, defaultValues.longitudeDelta);
|
|
40
|
-
this._regionListeners = {};
|
|
41
|
-
}
|
|
42
|
-
setValue(value) {
|
|
43
|
-
this.latitude._value = value.latitude;
|
|
44
|
-
this.longitude._value = value.longitude;
|
|
45
|
-
this.latitudeDelta._value = value.latitudeDelta;
|
|
46
|
-
this.longitudeDelta._value = value.longitudeDelta;
|
|
47
|
-
}
|
|
48
|
-
setOffset(offset) {
|
|
49
|
-
this.latitude.setOffset(offset.latitude);
|
|
50
|
-
this.longitude.setOffset(offset.longitude);
|
|
51
|
-
this.latitudeDelta.setOffset(offset.latitudeDelta);
|
|
52
|
-
this.longitudeDelta.setOffset(offset.longitudeDelta);
|
|
53
|
-
}
|
|
54
|
-
flattenOffset() {
|
|
55
|
-
this.latitude.flattenOffset();
|
|
56
|
-
this.longitude.flattenOffset();
|
|
57
|
-
this.latitudeDelta.flattenOffset();
|
|
58
|
-
this.longitudeDelta.flattenOffset();
|
|
59
|
-
}
|
|
60
|
-
__getValue() {
|
|
61
|
-
return {
|
|
62
|
-
latitude: this.latitude.__getValue(),
|
|
63
|
-
longitude: this.longitude.__getValue(),
|
|
64
|
-
latitudeDelta: this.latitudeDelta.__getValue(),
|
|
65
|
-
longitudeDelta: this.longitudeDelta.__getValue(),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
__attach() {
|
|
69
|
-
this.latitude.__addChild(this);
|
|
70
|
-
this.longitude.__addChild(this);
|
|
71
|
-
this.latitudeDelta.__addChild(this);
|
|
72
|
-
this.longitudeDelta.__addChild(this);
|
|
73
|
-
}
|
|
74
|
-
__detach() {
|
|
75
|
-
this.latitude.__removeChild(this);
|
|
76
|
-
this.longitude.__removeChild(this);
|
|
77
|
-
this.latitudeDelta.__removeChild(this);
|
|
78
|
-
this.longitudeDelta.__removeChild(this);
|
|
79
|
-
}
|
|
80
|
-
stopAnimation(callback) {
|
|
81
|
-
this.latitude.stopAnimation();
|
|
82
|
-
this.longitude.stopAnimation();
|
|
83
|
-
this.latitudeDelta.stopAnimation();
|
|
84
|
-
this.longitudeDelta.stopAnimation();
|
|
85
|
-
callback && callback(this.__getValue());
|
|
86
|
-
}
|
|
87
|
-
addListener(callback) {
|
|
88
|
-
const id = String(_uniqueId++);
|
|
89
|
-
const jointCallback = () => /*{value}*/ callback(this.__getValue());
|
|
90
|
-
this._regionListeners[id] = {
|
|
91
|
-
latitude: this.latitude.addListener(jointCallback),
|
|
92
|
-
longitude: this.longitude.addListener(jointCallback),
|
|
93
|
-
latitudeDelta: this.latitudeDelta.addListener(jointCallback),
|
|
94
|
-
longitudeDelta: this.longitudeDelta.addListener(jointCallback),
|
|
95
|
-
};
|
|
96
|
-
return id;
|
|
97
|
-
}
|
|
98
|
-
removeListener(id) {
|
|
99
|
-
this.latitude.removeListener(this._regionListeners[id].latitude);
|
|
100
|
-
this.longitude.removeListener(this._regionListeners[id].longitude);
|
|
101
|
-
this.latitudeDelta.removeListener(this._regionListeners[id].latitudeDelta);
|
|
102
|
-
this.longitudeDelta.removeListener(this._regionListeners[id].longitudeDelta);
|
|
103
|
-
delete this._regionListeners[id];
|
|
104
|
-
}
|
|
105
|
-
spring(config) {
|
|
106
|
-
const animations = [];
|
|
107
|
-
for (const type of configTypes) {
|
|
108
|
-
if (config.hasOwnProperty(type)) {
|
|
109
|
-
animations.push(react_native_1.Animated.spring(this[type], {
|
|
110
|
-
...config,
|
|
111
|
-
toValue: config[type],
|
|
112
|
-
// may help to eliminate some dev warnings and perf issues
|
|
113
|
-
useNativeDriver: !!config?.useNativeDriver,
|
|
114
|
-
}));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return react_native_1.Animated.parallel(animations);
|
|
118
|
-
}
|
|
119
|
-
timing(config) {
|
|
120
|
-
const animations = [];
|
|
121
|
-
for (const type of configTypes) {
|
|
122
|
-
if (config.hasOwnProperty(type)) {
|
|
123
|
-
animations.push(react_native_1.Animated.timing(this[type], {
|
|
124
|
-
...config,
|
|
125
|
-
toValue: config[type],
|
|
126
|
-
// may help to eliminate some dev warnings and perf issues
|
|
127
|
-
useNativeDriver: !!config?.useNativeDriver,
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return react_native_1.Animated.parallel(animations);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.default = AnimatedMapRegion;
|
package/lib/Geojson.d.ts
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Feature, FeatureCollection, Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon } from 'geojson';
|
|
3
|
-
import { MapMarkerProps as MarkerProps } from './MapMarker';
|
|
4
|
-
import { MapPolygonProps as PolygonProps } from './MapPolygon';
|
|
5
|
-
import { MapPolylineProps as PolylineProps } from './MapPolyline';
|
|
6
|
-
import { LatLng } from './sharedTypes';
|
|
7
|
-
export type GeojsonProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Sets the anchor point for the marker.
|
|
10
|
-
* The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
|
|
11
|
-
*
|
|
12
|
-
* The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
|
|
13
|
-
* where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
|
|
14
|
-
*
|
|
15
|
-
* The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding.
|
|
16
|
-
* For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
|
|
17
|
-
*
|
|
18
|
-
* @default {x: 0.5, y: 1.0}
|
|
19
|
-
* @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
|
|
20
|
-
* @platform Android: Supported
|
|
21
|
-
*/
|
|
22
|
-
anchor?: MarkerProps['anchor'];
|
|
23
|
-
/**
|
|
24
|
-
* The offset (in points) at which to display the annotation view.
|
|
25
|
-
*
|
|
26
|
-
* By default, the center point of an annotation view is placed at the coordinate point of the associated annotation.
|
|
27
|
-
*
|
|
28
|
-
* Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.
|
|
29
|
-
*
|
|
30
|
-
* @default {x: 0.0, y: 0.0}
|
|
31
|
-
* @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
|
|
32
|
-
* @platform Android: Not supported. See see the `anchor` prop
|
|
33
|
-
*/
|
|
34
|
-
centerOffset?: MarkerProps['centerOffset'];
|
|
35
|
-
/**
|
|
36
|
-
* The pincolor used on markers
|
|
37
|
-
*
|
|
38
|
-
* @platform iOS: Supported
|
|
39
|
-
* @platform Android: Supported
|
|
40
|
-
*/
|
|
41
|
-
color?: MarkerProps['pinColor'];
|
|
42
|
-
/**
|
|
43
|
-
* The fill color to use for the path.
|
|
44
|
-
*
|
|
45
|
-
* @platform iOS: Supported
|
|
46
|
-
* @platform Android: Supported
|
|
47
|
-
*/
|
|
48
|
-
fillColor?: PolygonProps['fillColor'];
|
|
49
|
-
/**
|
|
50
|
-
* [Geojson](https://geojson.org/) description of object.
|
|
51
|
-
*
|
|
52
|
-
* @platform iOS: Supported
|
|
53
|
-
* @platform Android: Supported
|
|
54
|
-
*/
|
|
55
|
-
geojson: FeatureCollection;
|
|
56
|
-
/**
|
|
57
|
-
* A custom image to be used as the marker's icon. Only local image resources are allowed to be
|
|
58
|
-
* used.
|
|
59
|
-
*
|
|
60
|
-
* @platform iOS: Supported
|
|
61
|
-
* @platform Android: Supported
|
|
62
|
-
*/
|
|
63
|
-
image?: MarkerProps['image'];
|
|
64
|
-
/**
|
|
65
|
-
* The line cap style to apply to the open ends of the path.
|
|
66
|
-
* The default style is `round`.
|
|
67
|
-
*
|
|
68
|
-
* @platform iOS: Apple Maps only
|
|
69
|
-
* @platform Android: Supported
|
|
70
|
-
*/
|
|
71
|
-
lineCap?: PolylineProps['lineCap'];
|
|
72
|
-
/**
|
|
73
|
-
* An array of numbers specifying the dash pattern to use for the path.
|
|
74
|
-
*
|
|
75
|
-
* The array contains one or more numbers that indicate the lengths (measured in points) of the
|
|
76
|
-
* line segments and gaps in the pattern. The values in the array alternate, starting with the
|
|
77
|
-
* first line segment length, followed by the first gap length, followed by the second line
|
|
78
|
-
* segment length, and so on.
|
|
79
|
-
*
|
|
80
|
-
* This property is set to `null` by default, which indicates no line dash pattern.
|
|
81
|
-
*
|
|
82
|
-
* @platform iOS: Supported
|
|
83
|
-
* @platform Android: Supported
|
|
84
|
-
*/
|
|
85
|
-
lineDashPattern?: PolygonProps['lineDashPattern'] | PolylineProps['lineDashPattern'];
|
|
86
|
-
/**
|
|
87
|
-
* The offset (in points) at which to start drawing the dash pattern.
|
|
88
|
-
*
|
|
89
|
-
* Use this property to start drawing a dashed line partway through a segment or gap. For
|
|
90
|
-
* example, a phase value of 6 for the patter 5-2-3-2 would cause drawing to begin in the
|
|
91
|
-
* middle of the first gap.
|
|
92
|
-
*
|
|
93
|
-
* The default value of this property is 0.
|
|
94
|
-
*
|
|
95
|
-
* @platform iOS: Apple Maps only
|
|
96
|
-
* @platform Android: Not supported
|
|
97
|
-
*/
|
|
98
|
-
lineDashPhase?: PolylineProps['lineDashPhase'];
|
|
99
|
-
/**
|
|
100
|
-
* The line join style to apply to corners of the path.
|
|
101
|
-
* The default style is `round`.
|
|
102
|
-
*
|
|
103
|
-
* @platform iOS: Apple Maps only
|
|
104
|
-
* @platform Android: Not supported
|
|
105
|
-
*/
|
|
106
|
-
lineJoin?: PolylineProps['lineJoin'];
|
|
107
|
-
/**
|
|
108
|
-
* Component to render in place of the default marker when the overlay type is a `point`
|
|
109
|
-
*
|
|
110
|
-
* @platform iOS: Supported
|
|
111
|
-
* @platform Android: Supported
|
|
112
|
-
*/
|
|
113
|
-
markerComponent?: MarkerProps['children'];
|
|
114
|
-
/**
|
|
115
|
-
* The limiting value that helps avoid spikes at junctions between connected line segments.
|
|
116
|
-
* The miter limit helps you avoid spikes in paths that use the `miter` `lineJoin` style. If
|
|
117
|
-
* the ratio of the miter length—that is, the diagonal length of the miter join—to the line
|
|
118
|
-
* thickness exceeds the miter limit, the joint is converted to a bevel join. The default
|
|
119
|
-
* miter limit is 10, which results in the conversion of miters whose angle at the joint
|
|
120
|
-
* is less than 11 degrees.
|
|
121
|
-
*
|
|
122
|
-
* @platform iOS: Apple Maps only
|
|
123
|
-
* @platform Android: Not supported
|
|
124
|
-
*/
|
|
125
|
-
miterLimit?: PolylineProps['miterLimit'];
|
|
126
|
-
/**
|
|
127
|
-
* Callback that is called when the user presses any of the overlays
|
|
128
|
-
*/
|
|
129
|
-
onPress?: (event: OverlayPressEvent) => void;
|
|
130
|
-
/**
|
|
131
|
-
* The stroke color to use for the path.
|
|
132
|
-
*
|
|
133
|
-
* @platform — iOS: Supported
|
|
134
|
-
* @platform — Android: Supported
|
|
135
|
-
*/
|
|
136
|
-
strokeColor?: PolygonProps['strokeColor'] | PolylineProps['strokeColor'];
|
|
137
|
-
/**
|
|
138
|
-
* The stroke width to use for the path.
|
|
139
|
-
*
|
|
140
|
-
* @platform — iOS: Supported
|
|
141
|
-
* @platform — Android: Supported
|
|
142
|
-
*/
|
|
143
|
-
strokeWidth?: PolygonProps['strokeWidth'] | PolylineProps['strokeWidth'];
|
|
144
|
-
/**
|
|
145
|
-
* Make the `Polygon` or `Polyline` tappable
|
|
146
|
-
*
|
|
147
|
-
* @platform — iOS: Google Maps only
|
|
148
|
-
* @platform — Android: Supported
|
|
149
|
-
*/
|
|
150
|
-
tappable?: PolygonProps['tappable'] | PolylineProps['tappable'];
|
|
151
|
-
/**
|
|
152
|
-
* The title of the marker. This is only used if the <Marker /> component has no children that
|
|
153
|
-
* are a `<Callout />`, in which case the default callout behavior will be used, which
|
|
154
|
-
* will show both the `title` and the `description`, if provided.
|
|
155
|
-
*
|
|
156
|
-
* @platform — iOS: Supported
|
|
157
|
-
* @platform — Android: Supported
|
|
158
|
-
*/
|
|
159
|
-
title?: MarkerProps['title'];
|
|
160
|
-
/**
|
|
161
|
-
* Sets whether this marker should track view changes.
|
|
162
|
-
* It's recommended to turn it off whenever it's possible to improve custom marker performance.
|
|
163
|
-
* This is the default value for all point markers in your geojson data. It can be overriden
|
|
164
|
-
* on a per point basis by adding a `trackViewChanges` property to the `properties` object on the point.
|
|
165
|
-
*
|
|
166
|
-
* @default true
|
|
167
|
-
* @platform iOS: Google Maps only
|
|
168
|
-
* @platform Android: Supported
|
|
169
|
-
*/
|
|
170
|
-
tracksViewChanges?: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
173
|
-
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
174
|
-
* with the same z-index is arbitrary. The default zIndex is 0.
|
|
175
|
-
*
|
|
176
|
-
* @platform iOS: Apple Maps: [Marker], Google Maps: [Marker, Polygon, Polyline]
|
|
177
|
-
* @platform Android: Supported
|
|
178
|
-
*/
|
|
179
|
-
zIndex?: MarkerProps['zIndex'] | PolygonProps['zIndex'] | PolylineProps['zIndex'];
|
|
180
|
-
};
|
|
181
|
-
declare const Geojson: (props: GeojsonProps) => React.JSX.Element;
|
|
182
|
-
export default Geojson;
|
|
183
|
-
type OverlayPressEvent = {
|
|
184
|
-
type: AnyPointOverlay['type'] | AnyLineStringOverlay['type'] | AnyPolygonOverlay['type'];
|
|
185
|
-
feature: AnyPointOverlay['feature'] | AnyLineStringOverlay['feature'] | AnyPolygonOverlay['feature'];
|
|
186
|
-
coordinates: AnyPointOverlay['coordinates'] | AnyLineStringOverlay['coordinates'] | AnyPolygonOverlay['coordinates'];
|
|
187
|
-
holes?: AnyPolygonOverlay['holes'];
|
|
188
|
-
};
|
|
189
|
-
type AnyPointOverlay = {
|
|
190
|
-
type: 'point';
|
|
191
|
-
feature: Feature<Point | MultiPoint>;
|
|
192
|
-
coordinates: LatLng;
|
|
193
|
-
};
|
|
194
|
-
type AnyLineStringOverlay = {
|
|
195
|
-
type: 'polyline';
|
|
196
|
-
feature: Feature<LineString | MultiLineString>;
|
|
197
|
-
coordinates: LatLng[];
|
|
198
|
-
};
|
|
199
|
-
type AnyPolygonOverlay = {
|
|
200
|
-
type: 'polygon';
|
|
201
|
-
feature: Feature<Polygon | MultiPolygon>;
|
|
202
|
-
coordinates: LatLng[];
|
|
203
|
-
holes?: LatLng[][];
|
|
204
|
-
};
|
package/lib/Geojson.js
DELETED
|
@@ -1,166 +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 = __importStar(require("react"));
|
|
30
|
-
const MapMarker_1 = __importDefault(require("./MapMarker"));
|
|
31
|
-
const MapPolyline_1 = __importDefault(require("./MapPolyline"));
|
|
32
|
-
const MapPolygon_1 = __importDefault(require("./MapPolygon"));
|
|
33
|
-
const Geojson = (props) => {
|
|
34
|
-
const { anchor, centerOffset, geojson, strokeColor, fillColor, strokeWidth, color, title, image, zIndex, onPress, lineCap, lineJoin, tappable, tracksViewChanges, miterLimit, lineDashPhase, lineDashPattern, markerComponent, } = props;
|
|
35
|
-
const pointOverlays = makePointOverlays(geojson.features);
|
|
36
|
-
const lineOverlays = makeLineOverlays(geojson.features);
|
|
37
|
-
const polygonOverlays = makePolygonOverlays(geojson.features);
|
|
38
|
-
return (<React.Fragment>
|
|
39
|
-
{pointOverlays.map((overlay, index) => {
|
|
40
|
-
const markerColor = getColor(color, overlay, 'marker-color');
|
|
41
|
-
const pointOverlayTracksViewChanges = overlay.feature.properties?.tracksViewChanges || tracksViewChanges;
|
|
42
|
-
return (<MapMarker_1.default key={index} coordinate={overlay.coordinates} tracksViewChanges={pointOverlayTracksViewChanges} image={image} title={title} pinColor={markerColor} zIndex={zIndex} anchor={anchor} centerOffset={centerOffset} onPress={() => onPress && onPress(overlay)}>
|
|
43
|
-
{markerComponent}
|
|
44
|
-
</MapMarker_1.default>);
|
|
45
|
-
})}
|
|
46
|
-
{lineOverlays.map((overlay, index) => {
|
|
47
|
-
const lineStrokeColor = getColor(strokeColor, overlay, 'stroke');
|
|
48
|
-
const lineStrokeWidth = getStrokeWidth(strokeWidth, overlay);
|
|
49
|
-
return (<MapPolyline_1.default key={index} coordinates={overlay.coordinates} strokeColor={lineStrokeColor} strokeWidth={lineStrokeWidth} lineDashPhase={lineDashPhase} lineDashPattern={lineDashPattern} lineCap={lineCap} lineJoin={lineJoin} miterLimit={miterLimit} zIndex={zIndex} tappable={tappable} onPress={() => onPress && onPress(overlay)}/>);
|
|
50
|
-
})}
|
|
51
|
-
{polygonOverlays.map((overlay, index) => {
|
|
52
|
-
const polygonFillColor = getColor(fillColor, overlay, 'fill');
|
|
53
|
-
const lineStrokeColor = getColor(strokeColor, overlay, 'stroke');
|
|
54
|
-
const lineStrokeWidth = getStrokeWidth(strokeWidth, overlay);
|
|
55
|
-
return (<MapPolygon_1.default key={index} coordinates={overlay.coordinates} holes={overlay.holes} strokeColor={lineStrokeColor} fillColor={polygonFillColor} strokeWidth={lineStrokeWidth} lineDashPhase={lineDashPhase} lineDashPattern={lineDashPattern} lineCap={lineCap} lineJoin={lineJoin} miterLimit={miterLimit} tappable={tappable} onPress={() => onPress && onPress(overlay)} zIndex={zIndex}/>);
|
|
56
|
-
})}
|
|
57
|
-
</React.Fragment>);
|
|
58
|
-
};
|
|
59
|
-
exports.default = Geojson;
|
|
60
|
-
const makePointOverlays = (features) => {
|
|
61
|
-
return features
|
|
62
|
-
.filter(isAnyPointFeature)
|
|
63
|
-
.map(feature => makeCoordinatesForAnyPoint(feature.geometry).map(coordinates => makeOverlayForAnyPoint(coordinates, feature)))
|
|
64
|
-
.reduce((prev, curr) => prev.concat(curr), [])
|
|
65
|
-
.map(overlay => ({ ...overlay, type: 'point' }));
|
|
66
|
-
};
|
|
67
|
-
const makeLineOverlays = (features) => {
|
|
68
|
-
return features
|
|
69
|
-
.filter(isAnyLineStringFeature)
|
|
70
|
-
.map(feature => makeCoordinatesForAnyLine(feature.geometry).map(coordinates => makeOverlayForAnyLine(coordinates, feature)))
|
|
71
|
-
.reduce((prev, curr) => prev.concat(curr), [])
|
|
72
|
-
.map(overlay => ({ ...overlay, type: 'polyline' }));
|
|
73
|
-
};
|
|
74
|
-
const makePolygonOverlays = (features) => {
|
|
75
|
-
const multipolygons = features
|
|
76
|
-
.filter(isMultiPolygonFeature)
|
|
77
|
-
.map(feature => makeCoordinatesForMultiPolygon(feature.geometry).map(coordinates => makeOverlayForAnyPolygon(coordinates, feature)))
|
|
78
|
-
.reduce((prev, curr) => prev.concat(curr), [])
|
|
79
|
-
.map(overlay => ({ ...overlay, type: 'polygon' }));
|
|
80
|
-
const polygons = features
|
|
81
|
-
.filter(isPolygonFeature)
|
|
82
|
-
.map(feature => makeOverlayForAnyPolygon(makeCoordinatesForPolygon(feature.geometry), feature))
|
|
83
|
-
.reduce((prev, curr) => prev.concat(curr), [])
|
|
84
|
-
.map(overlay => ({ ...overlay, type: 'polygon' }));
|
|
85
|
-
return polygons.concat(multipolygons);
|
|
86
|
-
};
|
|
87
|
-
const makeOverlayForAnyPoint = (coordinates, feature) => {
|
|
88
|
-
return { feature, coordinates };
|
|
89
|
-
};
|
|
90
|
-
const makeOverlayForAnyLine = (coordinates, feature) => {
|
|
91
|
-
return { feature, coordinates };
|
|
92
|
-
};
|
|
93
|
-
const makeOverlayForAnyPolygon = (coordinates, feature) => {
|
|
94
|
-
return {
|
|
95
|
-
feature,
|
|
96
|
-
coordinates: coordinates[0],
|
|
97
|
-
holes: coordinates.length > 1 ? coordinates.slice(1) : undefined,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
const makePoint = (c) => ({
|
|
101
|
-
latitude: c[1],
|
|
102
|
-
longitude: c[0],
|
|
103
|
-
});
|
|
104
|
-
const makeLine = (l) => l.map(makePoint);
|
|
105
|
-
const makeCoordinatesForAnyPoint = (geometry) => {
|
|
106
|
-
if (geometry.type === 'Point') {
|
|
107
|
-
return [makePoint(geometry.coordinates)];
|
|
108
|
-
}
|
|
109
|
-
return geometry.coordinates.map(makePoint);
|
|
110
|
-
};
|
|
111
|
-
const makeCoordinatesForAnyLine = (geometry) => {
|
|
112
|
-
if (geometry.type === 'LineString') {
|
|
113
|
-
return [makeLine(geometry.coordinates)];
|
|
114
|
-
}
|
|
115
|
-
return geometry.coordinates.map(makeLine);
|
|
116
|
-
};
|
|
117
|
-
const makeCoordinatesForPolygon = (geometry) => {
|
|
118
|
-
return geometry.coordinates.map(makeLine);
|
|
119
|
-
};
|
|
120
|
-
const makeCoordinatesForMultiPolygon = (geometry) => {
|
|
121
|
-
return geometry.coordinates.map(p => p.map(makeLine));
|
|
122
|
-
};
|
|
123
|
-
const getRgbaFromHex = (hex, alpha = 1) => {
|
|
124
|
-
const matchArray = hex.match(/\w\w/g);
|
|
125
|
-
if (!matchArray || matchArray.length < 3) {
|
|
126
|
-
throw new Error('Invalid hex string');
|
|
127
|
-
}
|
|
128
|
-
const [r, g, b] = matchArray.map(x => {
|
|
129
|
-
const subColor = parseInt(x, 16);
|
|
130
|
-
if (Number.isNaN(subColor)) {
|
|
131
|
-
throw new Error('Invalid hex string');
|
|
132
|
-
}
|
|
133
|
-
return subColor;
|
|
134
|
-
});
|
|
135
|
-
return `rgba(${r},${g},${b},${alpha})`;
|
|
136
|
-
};
|
|
137
|
-
const getColor = (prop, overlay, colorType) => {
|
|
138
|
-
if (prop) {
|
|
139
|
-
return prop;
|
|
140
|
-
}
|
|
141
|
-
let color = overlay.feature.properties?.[colorType];
|
|
142
|
-
if (color) {
|
|
143
|
-
const opacityProperty = colorType + '-opacity';
|
|
144
|
-
const alpha = overlay.feature.properties?.[opacityProperty];
|
|
145
|
-
if (alpha && alpha !== '0' && color[0] === '#') {
|
|
146
|
-
color = getRgbaFromHex(color, alpha);
|
|
147
|
-
}
|
|
148
|
-
return color;
|
|
149
|
-
}
|
|
150
|
-
return undefined;
|
|
151
|
-
};
|
|
152
|
-
const getStrokeWidth = (prop, overlay) => {
|
|
153
|
-
if (prop) {
|
|
154
|
-
return prop;
|
|
155
|
-
}
|
|
156
|
-
return overlay.feature.properties?.['stroke-width'];
|
|
157
|
-
};
|
|
158
|
-
// GeoJSON.Feature type-guards
|
|
159
|
-
const isPointFeature = (feature) => feature.geometry.type === 'Point';
|
|
160
|
-
const isMultiPointFeature = (feature) => feature.geometry.type === 'MultiPoint';
|
|
161
|
-
const isAnyPointFeature = (feature) => isPointFeature(feature) || isMultiPointFeature(feature);
|
|
162
|
-
const isLineStringFeature = (feature) => feature.geometry.type === 'LineString';
|
|
163
|
-
const isMultiLineStringFeature = (feature) => feature.geometry.type === 'MultiLineString';
|
|
164
|
-
const isAnyLineStringFeature = (feature) => isLineStringFeature(feature) || isMultiLineStringFeature(feature);
|
|
165
|
-
const isPolygonFeature = (feature) => feature.geometry.type === 'Polygon';
|
|
166
|
-
const isMultiPolygonFeature = (feature) => feature.geometry.type === 'MultiPolygon';
|
package/lib/MapCallout.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ViewProps } from 'react-native';
|
|
3
|
-
import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
|
|
4
|
-
import { CalloutPressEvent } from './sharedTypes';
|
|
5
|
-
export type MapCalloutProps = ViewProps & {
|
|
6
|
-
/**
|
|
7
|
-
* If `true`, clicks on transparent areas in callout will be passed to map.
|
|
8
|
-
*
|
|
9
|
-
* @default false
|
|
10
|
-
* @platform iOS: Supported
|
|
11
|
-
* @platform Android: Not supported
|
|
12
|
-
*/
|
|
13
|
-
alphaHitTest?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Callback that is called when the user presses on the callout
|
|
16
|
-
*
|
|
17
|
-
* @platform iOS: Apple Maps only
|
|
18
|
-
* @platform Android: Supported
|
|
19
|
-
*/
|
|
20
|
-
onPress?: (event: CalloutPressEvent) => void;
|
|
21
|
-
/**
|
|
22
|
-
* If `false`, a default "tooltip" bubble window will be drawn around this callouts children.
|
|
23
|
-
* If `true`, the child views can fully customize their appearance, including any "bubble" like styles.
|
|
24
|
-
*
|
|
25
|
-
* @default false
|
|
26
|
-
* @platform iOS: Supported
|
|
27
|
-
* @platform Android: Supported
|
|
28
|
-
*/
|
|
29
|
-
tooltip?: boolean;
|
|
30
|
-
};
|
|
31
|
-
type NativeProps = MapCalloutProps;
|
|
32
|
-
export declare class MapCallout extends React.Component<MapCalloutProps> {
|
|
33
|
-
context: React.ContextType<typeof ProviderContext>;
|
|
34
|
-
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
35
|
-
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
36
|
-
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
37
|
-
render(): React.JSX.Element;
|
|
38
|
-
}
|
|
39
|
-
declare const _default: typeof MapCallout;
|
|
40
|
-
export default _default;
|