react-native-map4d-map-dtqg 0.1.1 → 0.1.3
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/LICENSE +21 -21
- package/README.md +133 -88
- package/android/build.gradle +60 -60
- package/android/src/main/AndroidManifest.xml +4 -4
- package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -87
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -298
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -35
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -31
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -167
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -121
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -105
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +121 -121
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -502
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -143
- package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +17 -17
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -1172
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +231 -226
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -412
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +211 -211
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -222
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -119
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +172 -172
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +147 -147
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -146
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +137 -137
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -95
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +64 -64
- package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -31
- package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -31
- package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -70
- package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -9
- package/ios/Map4dMap.h +7 -7
- package/ios/Map4dMap.m +14 -14
- package/ios/Map4dMap.xcodeproj/project.pbxproj +2 -2
- package/ios/Map4dMapViewManager.m +34 -34
- package/ios/RCTConvert+Map4dMap.h +33 -33
- package/ios/RCTConvert+Map4dMap.m +112 -112
- package/ios/RMFCircle.h +37 -37
- package/ios/RMFCircle.m +100 -100
- package/ios/RMFCircleManager.h +18 -18
- package/ios/RMFCircleManager.m +155 -155
- package/ios/RMFCircleMap4d.h +23 -23
- package/ios/RMFCircleMap4d.m +13 -13
- package/ios/RMFCoordinate.h +22 -22
- package/ios/RMFCoordinate.m +13 -13
- package/ios/RMFDirectionsMarkerOptions.h +24 -24
- package/ios/RMFDirectionsMarkerOptions.m +23 -23
- package/ios/RMFDirectionsRenderer.h +47 -47
- package/ios/RMFDirectionsRenderer.m +182 -182
- package/ios/RMFDirectionsRendererManager.h +17 -17
- package/ios/RMFDirectionsRendererManager.m +84 -84
- package/ios/RMFDirectionsRendererMap4d.h +21 -21
- package/ios/RMFDirectionsRendererMap4d.m +12 -12
- package/ios/RMFDummyView.h +6 -6
- package/ios/RMFDummyView.m +12 -12
- package/ios/RMFEventResponse.h +39 -39
- package/ios/RMFEventResponse.m +98 -98
- package/ios/RMFIcon.h +24 -24
- package/ios/RMFIcon.m +35 -35
- package/ios/RMFMapView.h +84 -84
- package/ios/RMFMapView.m +376 -376
- package/ios/RMFMapViewManager.h +17 -17
- package/ios/RMFMapViewManager.m +509 -493
- package/ios/RMFMarker.h +57 -57
- package/ios/RMFMarker.m +267 -267
- package/ios/RMFMarkerManager.h +17 -17
- package/ios/RMFMarkerManager.m +156 -156
- package/ios/RMFMarkerMap4d.h +19 -19
- package/ios/RMFMarkerMap4d.m +13 -13
- package/ios/RMFPOI.h +38 -38
- package/ios/RMFPOI.m +123 -123
- package/ios/RMFPOIManager.h +18 -18
- package/ios/RMFPOIManager.m +168 -168
- package/ios/RMFPOIMap4d.h +22 -22
- package/ios/RMFPOIMap4d.m +12 -12
- package/ios/RMFPolygon.h +41 -41
- package/ios/RMFPolygon.m +106 -106
- package/ios/RMFPolygonManager.h +18 -18
- package/ios/RMFPolygonManager.m +141 -141
- package/ios/RMFPolygonMap4d.h +23 -23
- package/ios/RMFPolygonMap4d.m +15 -15
- package/ios/RMFPolyline.h +38 -38
- package/ios/RMFPolyline.m +101 -101
- package/ios/RMFPolylineManager.h +18 -18
- package/ios/RMFPolylineManager.m +139 -139
- package/ios/RMFPolylineMap4d.h +22 -22
- package/ios/RMFPolylineMap4d.m +15 -15
- package/ios/building/RMFBuilding.h +41 -41
- package/ios/building/RMFBuilding.m +104 -104
- package/ios/building/RMFBuildingManager.h +19 -19
- package/ios/building/RMFBuildingManager.m +133 -133
- package/ios/building/RMFBuildingMap4d.h +23 -23
- package/ios/building/RMFBuildingMap4d.m +15 -15
- package/ios/overlays/RMFTileOverlay.h +36 -36
- package/ios/overlays/RMFTileOverlay.m +64 -64
- package/ios/overlays/RMFTileOverlayManager.h +17 -17
- package/ios/overlays/RMFTileOverlayManager.m +27 -27
- package/lib/commonjs/components/MFBanDoSo.js +109 -0
- package/lib/commonjs/components/MFBanDoSo.js.map +1 -0
- package/lib/commonjs/components/MFBuilding.js +26 -26
- package/lib/commonjs/components/MFBuilding.js.map +1 -1
- package/lib/commonjs/components/MFCircle.js +20 -20
- package/lib/commonjs/components/MFCircle.js.map +1 -1
- package/lib/commonjs/components/MFDirectionsRenderer.js +32 -32
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/commonjs/components/MFMapView.js +89 -70
- package/lib/commonjs/components/MFMapView.js.map +1 -1
- package/lib/commonjs/components/MFMarker.js +35 -35
- package/lib/commonjs/components/MFMarker.js.map +1 -1
- package/lib/commonjs/components/MFPOI.js +20 -20
- package/lib/commonjs/components/MFPOI.js.map +1 -1
- package/lib/commonjs/components/MFPolygon.js +22 -22
- package/lib/commonjs/components/MFPolygon.js.map +1 -1
- package/lib/commonjs/components/MFPolyline.js +18 -18
- package/lib/commonjs/components/MFPolyline.js.map +1 -1
- package/lib/commonjs/components/MFTileOverlay.js +9 -9
- package/lib/commonjs/components/MFTileOverlay.js.map +1 -1
- package/lib/commonjs/components/Map4dMapView.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocusManager.js +205 -0
- package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -0
- package/lib/commonjs/components/extends/AreaFocuser.js +21 -259
- package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
- package/lib/commonjs/components/extends/BoundHelper.js +36 -0
- package/lib/commonjs/components/extends/BoundHelper.js.map +1 -0
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js +167 -0
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -0
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js +164 -0
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -0
- package/lib/commonjs/components/extends/area/AreaFocusSession.js +100 -0
- package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -0
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js +40 -0
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -0
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js +2288 -0
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -0
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js +139 -0
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -0
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/MFBanDoSo.js +92 -0
- package/lib/module/components/MFBanDoSo.js.map +1 -0
- package/lib/module/components/MFBuilding.js +26 -26
- package/lib/module/components/MFBuilding.js.map +1 -1
- package/lib/module/components/MFCircle.js +20 -20
- package/lib/module/components/MFCircle.js.map +1 -1
- package/lib/module/components/MFDirectionsRenderer.js +32 -32
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/module/components/MFMapView.js +88 -70
- package/lib/module/components/MFMapView.js.map +1 -1
- package/lib/module/components/MFMarker.js +35 -35
- package/lib/module/components/MFMarker.js.map +1 -1
- package/lib/module/components/MFPOI.js +20 -20
- package/lib/module/components/MFPOI.js.map +1 -1
- package/lib/module/components/MFPolygon.js +22 -22
- package/lib/module/components/MFPolygon.js.map +1 -1
- package/lib/module/components/MFPolyline.js +18 -18
- package/lib/module/components/MFPolyline.js.map +1 -1
- package/lib/module/components/MFTileOverlay.js +9 -9
- package/lib/module/components/MFTileOverlay.js.map +1 -1
- package/lib/module/components/Map4dMapView.js.map +1 -1
- package/lib/module/components/extends/AreaFocusManager.js +193 -0
- package/lib/module/components/extends/AreaFocusManager.js.map +1 -0
- package/lib/module/components/extends/AreaFocuser.js +21 -259
- package/lib/module/components/extends/AreaFocuser.js.map +1 -1
- package/lib/module/components/extends/BoundHelper.js +29 -0
- package/lib/module/components/extends/BoundHelper.js.map +1 -0
- package/lib/module/components/extends/area/AreaFocusAreas.js +156 -0
- package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -0
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js +153 -0
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -0
- package/lib/module/components/extends/area/AreaFocusSession.js +93 -0
- package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -0
- package/lib/module/components/extends/area/AreaFocusTypes.js +33 -0
- package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -0
- package/lib/module/components/internal/DefaultRoadmapStyle.js +2281 -0
- package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -0
- package/lib/module/components/internal/GeojsonStyleUtils.js +130 -0
- package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/Map4dMapView.d.ts +7 -7
- package/package.json +152 -152
- package/react-native-map4d-map.podspec +20 -20
- package/src/components/MFBanDoSo.js +124 -0
- package/src/components/MFBuilding.js +187 -187
- package/src/components/MFCircle.js +173 -173
- package/src/components/MFDirectionsRenderer.js +237 -237
- package/src/components/MFMapView.js +464 -447
- package/src/components/MFMarker.js +246 -246
- package/src/components/MFPOI.js +184 -184
- package/src/components/MFPolygon.js +186 -186
- package/src/components/MFPolyline.js +172 -172
- package/src/components/MFTileOverlay.js +45 -45
- package/src/components/Map4dMapView.tsx +26 -26
- package/src/components/extends/AreaFocusManager.js +196 -0
- package/src/components/extends/AreaFocuser.js +61 -338
- package/src/components/extends/BoundHelper.js +32 -0
- package/src/components/extends/area/AreaFocusAreas.js +164 -0
- package/src/components/extends/area/AreaFocusGeometryUtils.js +164 -0
- package/src/components/extends/area/AreaFocusSession.js +100 -0
- package/src/components/extends/area/AreaFocusTypes.js +36 -0
- package/src/components/internal/DefaultRoadmapStyle.js +3365 -0
- package/src/components/internal/GeojsonStyleUtils.js +143 -0
- package/src/index.js +25 -23
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/checksums.lock +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/9.0-milestone-1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/9.0-milestone-1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.0-milestone-1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.0-milestone-1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/AndroidProjectSystem.xml +0 -6
- package/android/.idea/caches/deviceStreaming.xml +0 -1570
- package/android/.idea/copilot.data.migration.ask2agent.xml +0 -6
- package/android/.idea/gradle.xml +0 -12
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/runConfigurations.xml +0 -17
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PropTypes","React","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","Image","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinate","shape","latitude","number","isRequired","longitude","title","string","titleColor","subtitle","poiType","icon","uri","any","zIndex","userData","object","onPress","func","MFPOI","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","poi","setCoordinate","_runCommand","setTitle","setTitleColor","color","setSubTitle","setPoiType","type","setIcon","resolveAssetSource","setZIndex","setUserData","_getHandle","name","args","OS","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPOI"],"sources":["MFPOI.js"],"sourcesContent":["import PropTypes from 'prop-types';\
|
|
1
|
+
{"version":3,"names":["PropTypes","React","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","Image","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinate","shape","latitude","number","isRequired","longitude","title","string","titleColor","subtitle","poiType","icon","uri","any","zIndex","userData","object","onPress","func","MFPOI","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","poi","setCoordinate","_runCommand","setTitle","setTitleColor","color","setSubTitle","setPoiType","type","setIcon","resolveAssetSource","setZIndex","setUserData","_getHandle","name","args","OS","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPOI"],"sources":["MFPOI.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';\nimport {\n requireNativeComponent,\n Platform,\n Image,\n NativeModules,\n findNodeHandle,\n processColor\n} from 'react-native';\n\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\nconst viewPropTypes = ViewPropTypes || View.propTypes;\n\nconst propTypes = {\n ...viewPropTypes,\n\n /**\n * The coordinate for the POI.\n */\n coordinate: PropTypes.shape({\n latitude: PropTypes.number.isRequired,\n longitude: PropTypes.number.isRequired,\n }).isRequired,\n\n /**\n * The title of the POI.\n */\n title: PropTypes.string,\n\n /**\n * The color of the title.\n */\n titleColor: ColorPropType,\n\n /**\n * The subtile of the POI.\n */\n subtitle: PropTypes.string,\n\n /**\n * The type of POI\n */\n //poiType: PropTypes.oneOf(['cafe', 'atm', 'bank']),\n poiType: PropTypes.string,\n\n /**\n * POI icon to render.\n */\n icon: PropTypes.shape({\n uri: PropTypes.any.isRequired\n }),\n\n /**\n * zIndex\n */\n zIndex: PropTypes.number,\n\n /**\n * visible\n */\n //TODO\n // visible: PropTypes.bool,\n\n /**\n * userData\n */\n userData:PropTypes.object,\n\n /**\n * Callback that is called when the user presses on the POI\n */\n onPress: PropTypes.func,\n};\n\nclass MFPOI extends React.Component {\n constructor(props) {\n super(props);\n this._onPress = this._onPress.bind(this)\n this._ref = this._ref.bind(this)\n }\n\n _onPress(event) {\n event.stopPropagation();\n if (this.props.onPress) {\n this.props.onPress(event);\n }\n }\n\n _ref(ref) {\n this.poi = ref;\n }\n\n setCoordinate(coordinate) {\n this._runCommand(\"setCoordinate\", [coordinate])\n }\n setTitle(title) {\n this._runCommand(\"setTitle\", [title])\n }\n setTitleColor(color) {\n this._runCommand(\"setTitleColor\", [processColor(color)])\n }\n setSubTitle(subtitle) {\n this._runCommand(\"setSubTitle\", [subtitle])\n }\n setPoiType(type) {\n this._runCommand(\"setPoiType\", [type])\n }\n setIcon(icon) {\n let uri = Image.resolveAssetSource(icon.uri) || { uri: icon.uri }\n this._runCommand(\"setIcon\", [ { uri: uri.uri } ])\n }\n setZIndex(zIndex) {\n this._runCommand(\"setZIndex\", [zIndex])\n }\n // setVisible(visible) {\n // this._runCommand(\"setVisible\", [visible])\n // }\n setUserData(userData) {\n this._runCommand(\"setUserData\", [userData])\n }\n\n _getHandle() {\n return findNodeHandle(this.poi);\n }\n\n\n _runCommand(name, args) {\n switch (Platform.OS) {\n case 'android':\n NativeModules.UIManager.dispatchViewManagerCommand(\n this._getHandle(),\n this._uiManagerCommand(name),\n args\n );\n break;\n\n case 'ios':\n this._mapManagerCommand(name)(this._getHandle(), ...args);\n break;\n\n default:\n break;\n }\n }\n\n _uiManagerCommand(name) {\n const UIManager = NativeModules.UIManager;\n const componentName = \"RMFPOI\";\n\n if (!UIManager.getViewManagerConfig) {\n // RN < 0.58\n return UIManager[componentName].Commands[name];\n }\n\n // RN >= 0.58 \n return UIManager.getViewManagerConfig(componentName).Commands[name];\n }\n \n _mapManagerCommand(name) {\n return NativeModules[`RMFPOI`][name];\n }\n\n render() {\n let icon = {}\n if (this.props.icon) {\n let uri = Image.resolveAssetSource(this.props.icon.uri) || {uri: this.props.icon.uri}\n icon = { uri: uri.uri }\n }\n return <RMFPOI\n {...this.props}\n icon={icon}\n ref={this._ref}\n onPress={this._onPress}\n />;\n }\n}\n\nMFPOI.propTypes = propTypes;\n\nvar RMFPOI = requireNativeComponent(`RMFPOI`, MFPOI);\n\nexport {MFPOI}\n"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAA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CAA3D;MACAD,IAAI,GAAG;QAAEC,GAAG,EAAEA,GAAG,CAACA;MAAX,CAAP;IACD;;IACD,oBAAO,oBAAC,MAAD,eACD,KAAKU,KADJ;MAEL,IAAI,EAAEX,IAFD;MAGL,GAAG,EAAE,KAAKc,IAHL;MAIL,OAAO,EAAE,KAAKF;IAJT,GAAP;EAMD;;AApGiC;;AAuGpCJ,KAAK,CAACpB,SAAN,GAAkBA,SAAlB;AAEA,IAAIuD,MAAM,GAAG/D,sBAAsB,CAAE,QAAF,EAAW4B,KAAX,CAAnC;AAEA,SAAQA,KAAR"}
|
|
@@ -8,60 +8,60 @@ import { requireNativeComponent, Platform, NativeModules, findNodeHandle, proces
|
|
|
8
8
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
9
9
|
const propTypes = { ...viewPropTypes,
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* An array of coordinates to describe the polygon
|
|
11
|
+
/**
|
|
12
|
+
* An array of coordinates to describe the polygon
|
|
13
13
|
*/
|
|
14
14
|
coordinates: PropTypes.arrayOf(PropTypes.shape({
|
|
15
|
-
/**
|
|
16
|
-
* Latitude/Longitude coordinates
|
|
15
|
+
/**
|
|
16
|
+
* Latitude/Longitude coordinates
|
|
17
17
|
*/
|
|
18
18
|
latitude: PropTypes.number.isRequired,
|
|
19
19
|
longitude: PropTypes.number.isRequired
|
|
20
20
|
})),
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* An array of array of coordinates to describe the polygon holes
|
|
22
|
+
/**
|
|
23
|
+
* An array of array of coordinates to describe the polygon holes
|
|
24
24
|
*/
|
|
25
25
|
holes: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.shape({
|
|
26
|
-
/**
|
|
27
|
-
* Latitude/Longitude coordinates
|
|
26
|
+
/**
|
|
27
|
+
* Latitude/Longitude coordinates
|
|
28
28
|
*/
|
|
29
29
|
latitude: PropTypes.number.isRequired,
|
|
30
30
|
longitude: PropTypes.number.isRequired
|
|
31
31
|
}))),
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* The color to use for the polygon.
|
|
33
|
+
/**
|
|
34
|
+
* The color to use for the polygon.
|
|
35
35
|
*/
|
|
36
36
|
fillColor: ColorPropType,
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* The color to use for the polygon stroke.
|
|
38
|
+
/**
|
|
39
|
+
* The color to use for the polygon stroke.
|
|
40
40
|
*/
|
|
41
41
|
strokeColor: ColorPropType,
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* The stroke width to use for the polygon.
|
|
43
|
+
/**
|
|
44
|
+
* The stroke width to use for the polygon.
|
|
45
45
|
*/
|
|
46
46
|
strokeWidth: PropTypes.number,
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* zIndex
|
|
48
|
+
/**
|
|
49
|
+
* zIndex
|
|
50
50
|
*/
|
|
51
51
|
zIndex: PropTypes.number,
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
* visible
|
|
53
|
+
/**
|
|
54
|
+
* visible
|
|
55
55
|
*/
|
|
56
56
|
visible: PropTypes.bool,
|
|
57
57
|
|
|
58
|
-
/**
|
|
59
|
-
* userData
|
|
58
|
+
/**
|
|
59
|
+
* userData
|
|
60
60
|
*/
|
|
61
61
|
userData: PropTypes.object,
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Callback that is called when the user presses on the polygon
|
|
63
|
+
/**
|
|
64
|
+
* Callback that is called when the user presses on the polygon
|
|
65
65
|
*/
|
|
66
66
|
onPress: PropTypes.func
|
|
67
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","holes","fillColor","strokeColor","strokeWidth","zIndex","visible","bool","userData","object","onPress","func","MFPolygon","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polygon","setCoordinates","_runCommand","setHoles","setFillColor","color","setStrokeColor","setStrokeWidth","width","setVisible","setZIndex","setUserData","_getHandle","name","args","OS","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPolygon"],"sources":["MFPolygon.js"],"sourcesContent":["import React from 'react';\
|
|
1
|
+
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","holes","fillColor","strokeColor","strokeWidth","zIndex","visible","bool","userData","object","onPress","func","MFPolygon","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polygon","setCoordinates","_runCommand","setHoles","setFillColor","color","setStrokeColor","setStrokeWidth","width","setVisible","setZIndex","setUserData","_getHandle","name","args","OS","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPolygon"],"sources":["MFPolygon.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';\nimport {\n requireNativeComponent,\n Platform,\n NativeModules,\n findNodeHandle,\n processColor\n} from 'react-native';\n\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\nconst viewPropTypes = ViewPropTypes || View.propTypes;\n\nconst propTypes = {\n ...viewPropTypes,\n\n /**\n * An array of coordinates to describe the polygon\n */\n coordinates: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Latitude/Longitude coordinates\n */\n latitude: PropTypes.number.isRequired,\n longitude: PropTypes.number.isRequired,\n })\n ),\n\n /**\n * An array of array of coordinates to describe the polygon holes\n */\n holes: PropTypes.arrayOf(\n PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Latitude/Longitude coordinates\n */\n latitude: PropTypes.number.isRequired,\n longitude: PropTypes.number.isRequired,\n })\n )\n ),\n\n /**\n * The color to use for the polygon.\n */\n fillColor: ColorPropType,\n\n /**\n * The color to use for the polygon stroke.\n */\n strokeColor: ColorPropType,\n\n /**\n * The stroke width to use for the polygon.\n */\n strokeWidth: PropTypes.number,\n\n /**\n * zIndex\n */\n zIndex: PropTypes.number,\n\n /**\n * visible\n */\n visible: PropTypes.bool,\n\n /**\n * userData\n */\n userData:PropTypes.object,\n\n /**\n * Callback that is called when the user presses on the polygon\n */\n onPress: PropTypes.func,\n};\n\n\nclass MFPolygon extends React.Component {\n constructor(props) {\n super(props);\n this._onPress = this._onPress.bind(this)\n this._ref = this._ref.bind(this)\n }\n\n _onPress(event) {\n event.stopPropagation();\n if (this.props.onPress) {\n this.props.onPress(event);\n }\n }\n\n _ref(ref) {\n this.polygon = ref;\n }\n\n setCoordinates(coordinates) {\n this._runCommand(\"setCoordinates\", [coordinates])\n }\n\n setHoles(holes) {\n this._runCommand(\"setHoles\", [holes])\n }\n\n setFillColor(color) {\n this._runCommand(\"setFillColor\", [processColor(color)])\n }\n\n setStrokeColor(color) {\n this._runCommand(\"setStrokeColor\", [processColor(color)])\n }\n\n setStrokeWidth(width) {\n this._runCommand(\"setStrokeWidth\", [width])\n }\n\n setVisible(visible) {\n this._runCommand(\"setVisible\", [visible])\n }\n\n setZIndex(zIndex) {\n this._runCommand(\"setZIndex\", [zIndex])\n }\n\n setUserData(userData) {\n this._runCommand(\"setUserData\", [userData])\n }\n\n _getHandle() {\n return findNodeHandle(this.polygon);\n }\n\n _runCommand(name, args) {\n switch (Platform.OS) {\n case 'android':\n NativeModules.UIManager.dispatchViewManagerCommand(\n this._getHandle(),\n this._uiManagerCommand(name),\n args\n );\n break;\n\n case 'ios':\n this._mapManagerCommand(name)(this._getHandle(), ...args);\n break;\n\n default:\n break;\n }\n }\n\n _uiManagerCommand(name) {\n const UIManager = NativeModules.UIManager;\n const componentName = \"RMFPolygon\";\n\n if (!UIManager.getViewManagerConfig) {\n // RN < 0.58\n return UIManager[componentName].Commands[name];\n }\n\n // RN >= 0.58 \n return UIManager.getViewManagerConfig(componentName).Commands[name];\n }\n\n _mapManagerCommand(name) {\n return NativeModules[`RMFPolygon`][name];\n }\n\n render() {\n return <RMFPolygon\n {...this.props}\n ref={this._ref}\n onPress={this._onPress}\n />;\n }\n}\n\nMFPolygon.propTypes = propTypes;\n\nvar RMFPolygon = requireNativeComponent(`RMFPolygon`, MFPolygon);\n\nexport { MFPolygon }\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,aAAR,EAAuBC,aAAvB,QAA2C,oCAA3C;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,aAHF,EAIEC,cAJF,EAKEC,YALF,QAMO,cANP,C,CAQA;;AACA,MAAMC,aAAa,GAAGP,aAAa,IAAIQ,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;AACF;AACA;EACEG,WAAW,EAAEX,SAAS,CAACY,OAAV,CACXZ,SAAS,CAACa,KAAV,CAAgB;IACd;AACN;AACA;IACMC,QAAQ,EAAEd,SAAS,CAACe,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAEjB,SAAS,CAACe,MAAV,CAAiBC;EALd,CAAhB,CADW,CANG;;EAgBhB;AACF;AACA;EACEE,KAAK,EAAElB,SAAS,CAACY,OAAV,CACLZ,SAAS,CAACY,OAAV,CACEZ,SAAS,CAACa,KAAV,CAAgB;IACd;AACR;AACA;IACQC,QAAQ,EAAEd,SAAS,CAACe,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAEjB,SAAS,CAACe,MAAV,CAAiBC;EALd,CAAhB,CADF,CADK,CAnBS;;EA+BhB;AACF;AACA;EACEG,SAAS,EAAEjB,aAlCK;;EAoChB;AACF;AACA;EACEkB,WAAW,EAAElB,aAvCG;;EAyChB;AACF;AACA;EACEmB,WAAW,EAAErB,SAAS,CAACe,MA5CP;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B,CAAP;EACD;;EAEDU,MAAM,GAAG;IACP,oBAAO,oBAAC,UAAD,eACD,KAAK9B,KADJ;MAEL,GAAG,EAAE,KAAKG,IAFL;MAGL,OAAO,EAAE,KAAKF;IAHT,GAAP;EAKD;;AAhGqC;;AAmGxCJ,SAAS,CAACnB,SAAV,GAAsBA,SAAtB;AAEA,IAAIqD,UAAU,GAAG5D,sBAAsB,CAAE,YAAF,EAAe0B,SAAf,CAAvC;AAEA,SAASA,SAAT"}
|
|
@@ -8,49 +8,49 @@ import { requireNativeComponent, Platform, NativeModules, findNodeHandle, proces
|
|
|
8
8
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
9
9
|
const propTypes = { ...viewPropTypes,
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* An array of coordinates to describe the polyline
|
|
11
|
+
/**
|
|
12
|
+
* An array of coordinates to describe the polyline
|
|
13
13
|
*/
|
|
14
14
|
coordinates: PropTypes.arrayOf(PropTypes.shape({
|
|
15
|
-
/**
|
|
16
|
-
* Latitude/Longitude coordinates
|
|
15
|
+
/**
|
|
16
|
+
* Latitude/Longitude coordinates
|
|
17
17
|
*/
|
|
18
18
|
latitude: PropTypes.number.isRequired,
|
|
19
19
|
longitude: PropTypes.number.isRequired
|
|
20
20
|
})),
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* The color to use for the path.
|
|
22
|
+
/**
|
|
23
|
+
* The color to use for the path.
|
|
24
24
|
*/
|
|
25
25
|
color: ColorPropType,
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* The stroke width to use for the path.
|
|
27
|
+
/**
|
|
28
|
+
* The stroke width to use for the path.
|
|
29
29
|
*/
|
|
30
30
|
width: PropTypes.number,
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* The default style is `solid`.
|
|
32
|
+
/**
|
|
33
|
+
* The default style is `solid`.
|
|
34
34
|
*/
|
|
35
35
|
lineStyle: PropTypes.oneOf(['solid', 'dotted']),
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* zIndex
|
|
37
|
+
/**
|
|
38
|
+
* zIndex
|
|
39
39
|
*/
|
|
40
40
|
zIndex: PropTypes.number,
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* visible
|
|
42
|
+
/**
|
|
43
|
+
* visible
|
|
44
44
|
*/
|
|
45
45
|
visible: PropTypes.bool,
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* userData
|
|
47
|
+
/**
|
|
48
|
+
* userData
|
|
49
49
|
*/
|
|
50
50
|
userData: PropTypes.object,
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* Callback that is called when the user presses on the polyline
|
|
52
|
+
/**
|
|
53
|
+
* Callback that is called when the user presses on the polyline
|
|
54
54
|
*/
|
|
55
55
|
onPress: PropTypes.func
|
|
56
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","color","width","lineStyle","oneOf","zIndex","visible","bool","userData","object","onPress","func","MFPolyline","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polyline","setCoordinates","_runCommand","setWidth","setColor","setVisible","setTouchable","touchable","setZIndex","setLineStyle","style","setUserData","_getHandle","name","args","OS","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPolyline"],"sources":["MFPolyline.js"],"sourcesContent":["import React from 'react';\
|
|
1
|
+
{"version":3,"names":["React","PropTypes","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","coordinates","arrayOf","shape","latitude","number","isRequired","longitude","color","width","lineStyle","oneOf","zIndex","visible","bool","userData","object","onPress","func","MFPolyline","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polyline","setCoordinates","_runCommand","setWidth","setColor","setVisible","setTouchable","touchable","setZIndex","setLineStyle","style","setUserData","_getHandle","name","args","OS","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPolyline"],"sources":["MFPolyline.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';\nimport {\n requireNativeComponent,\n Platform,\n NativeModules,\n findNodeHandle,\n processColor\n} from 'react-native';\n\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\nconst viewPropTypes = ViewPropTypes || View.propTypes;\n\nconst propTypes = {\n ...viewPropTypes,\n\n /**\n * An array of coordinates to describe the polyline\n */\n coordinates: PropTypes.arrayOf(\n PropTypes.shape({\n /**\n * Latitude/Longitude coordinates\n */\n latitude: PropTypes.number.isRequired,\n longitude: PropTypes.number.isRequired,\n })\n ),\n\n /**\n * The color to use for the path.\n */\n color: ColorPropType,\n\n /**\n * The stroke width to use for the path.\n */\n width: PropTypes.number,\n\n /**\n * The default style is `solid`.\n */\n lineStyle: PropTypes.oneOf(['solid', 'dotted']),\n\n /**\n * zIndex\n */\n zIndex: PropTypes.number,\n\n /**\n * visible\n */\n visible: PropTypes.bool,\n\n /**\n * userData\n */\n userData:PropTypes.object,\n\n /**\n * Callback that is called when the user presses on the polyline\n */\n onPress: PropTypes.func,\n};\n\n\nclass MFPolyline extends React.Component {\n constructor(props) {\n super(props);\n this._onPress = this._onPress.bind(this)\n this._ref = this._ref.bind(this)\n }\n\n _onPress(event) {\n event.stopPropagation();\n if (this.props.onPress) {\n this.props.onPress(event);\n }\n }\n\n _ref(ref) {\n this.polyline = ref;\n }\n\n // TODO - bug\n setCoordinates(coordinates) {\n this._runCommand(\"setCoordinates\", [coordinates])\n }\n\n setWidth(width) {\n this._runCommand(\"setWidth\", [width])\n }\n\n setColor(color) {\n this._runCommand(\"setColor\", [processColor(color)])\n }\n\n setVisible(visible) {\n this._runCommand(\"setVisible\", [visible])\n }\n\n setTouchable(touchable) {\n this._runCommand(\"setTouchable\", [touchable])\n }\n\n setZIndex(zIndex) {\n this._runCommand(\"setZIndex\", [zIndex])\n }\n\n setLineStyle(style) {\n this._runCommand(\"setLineStyle\", [style])\n }\n\n setUserData(userData) {\n this._runCommand(\"setUserData\", [userData])\n }\n\n _getHandle() {\n return findNodeHandle(this.polyline);\n }\n\n _runCommand(name, args) {\n switch (Platform.OS) {\n case 'android':\n NativeModules.UIManager.dispatchViewManagerCommand(\n this._getHandle(),\n this._uiManagerCommand(name),\n args\n );\n break;\n\n case 'ios':\n this._mapManagerCommand(name)(this._getHandle(), ...args);\n break;\n\n default:\n break;\n }\n }\n\n _uiManagerCommand(name) {\n const UIManager = NativeModules.UIManager;\n const componentName = \"RMFPolyline\";\n\n if (!UIManager.getViewManagerConfig) {\n // RN < 0.58\n return UIManager[componentName].Commands[name];\n }\n\n // RN >= 0.58 \n return UIManager.getViewManagerConfig(componentName).Commands[name];\n }\n\n _mapManagerCommand(name) {\n return NativeModules[`RMFPolyline`][name];\n }\n\n render() {\n return <RMFPolyline\n {...this.props}\n ref={this._ref}\n onPress={this._onPress}\n />;\n }\n}\n\nMFPolyline.propTypes = propTypes;\n\nvar RMFPolyline = requireNativeComponent(`RMFPolyline`, MFPolyline);\n\nexport { MFPolyline }\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,aAAR,EAAuBC,aAAvB,QAA2C,oCAA3C;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,aAHF,EAIEC,cAJF,EAKEC,YALF,QAMO,cANP,C,CAQA;;AACA,MAAMC,aAAa,GAAGP,aAAa,IAAIQ,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;AACF;AACA;EACEG,WAAW,EAAEX,SAAS,CAACY,OAAV,CACXZ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,CAACkD,SAAhC;IACA,MAAMI,aAAa,GAAG,aAAtB;;IAEA,IAAI,CAACJ,SAAS,CAACK,oBAAf,EAAqC;MACnC;MACA,OAAOL,SAAS,CAACI,aAAD,CAAT,CAAyBE,QAAzB,CAAkCT,IAAlC,CAAP;IACD,CAPqB,CAStB;;;IACA,OAAOG,SAAS,CAACK,oBAAV,CAA+BD,aAA/B,EAA8CE,QAA9C,CAAuDT,IAAvD,CAAP;EACD;;EAEDM,kBAAkB,CAACN,IAAD,EAAO;IACvB,OAAO/C,aAAa,CAAE,aAAF,CAAb,CAA6B+C,IAA7B,CAAP;EACD;;EAEDU,MAAM,GAAG;IACP,oBAAO,oBAAC,WAAD,eACD,KAAK9B,KADJ;MAEL,GAAG,EAAE,KAAKG,IAFL;MAGL,OAAO,EAAE,KAAKF;IAHT,GAAP;EAKD;;AAjGsC;;AAoGzCJ,UAAU,CAACnB,SAAX,GAAuBA,SAAvB;AAEA,IAAIqD,WAAW,GAAG5D,sBAAsB,CAAE,aAAF,EAAgB0B,UAAhB,CAAxC;AAEA,SAASA,UAAT"}
|
|
@@ -6,21 +6,21 @@ import { requireNativeComponent, View } from 'react-native'; // if ViewPropTypes
|
|
|
6
6
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
7
7
|
const propTypes = { ...viewPropTypes,
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
|
|
11
|
-
* For example, https://tile.openstreetmap.de/{z}/{x}/{y}.png
|
|
9
|
+
/**
|
|
10
|
+
* The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
|
|
11
|
+
* For example, https://tile.openstreetmap.de/{z}/{x}/{y}.png
|
|
12
12
|
*/
|
|
13
13
|
urlTemplate: PropTypes.string.isRequired,
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* visible
|
|
15
|
+
/**
|
|
16
|
+
* visible
|
|
17
17
|
*/
|
|
18
18
|
visible: PropTypes.bool,
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
22
|
-
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
23
|
-
* with the same z-index is arbitrary. The default zIndex is 0.
|
|
20
|
+
/**
|
|
21
|
+
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
22
|
+
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
23
|
+
* with the same z-index is arbitrary. The default zIndex is 0.
|
|
24
24
|
*/
|
|
25
25
|
zIndex: PropTypes.number
|
|
26
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PropTypes","React","ViewPropTypes","requireNativeComponent","View","viewPropTypes","propTypes","urlTemplate","string","isRequired","visible","bool","zIndex","number","MFTileOverlay","Component","render","props","RMFTileOverlay"],"sources":["MFTileOverlay.js"],"sourcesContent":["import PropTypes from \"prop-types\";\
|
|
1
|
+
{"version":3,"names":["PropTypes","React","ViewPropTypes","requireNativeComponent","View","viewPropTypes","propTypes","urlTemplate","string","isRequired","visible","bool","zIndex","number","MFTileOverlay","Component","render","props","RMFTileOverlay"],"sources":["MFTileOverlay.js"],"sourcesContent":["import PropTypes from \"prop-types\";\nimport React from 'react';\nimport {ViewPropTypes} from 'deprecated-react-native-prop-types';\nimport {\n requireNativeComponent,\n View,\n} from 'react-native';\n\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\nconst viewPropTypes = ViewPropTypes || View.propTypes;\nconst propTypes = {\n ...viewPropTypes,\n\n /**\n * The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime\n * For example, https://tile.openstreetmap.de/{z}/{x}/{y}.png\n */\n urlTemplate: PropTypes.string.isRequired,\n\n /**\n * visible\n */\n visible: PropTypes.bool,\n\n /**\n * The order in which this tile overlay is drawn with respect to other overlays. An overlay\n * with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays\n * with the same z-index is arbitrary. The default zIndex is 0.\n */\n zIndex: PropTypes.number,\n};\n\nclass MFTileOverlay extends React.Component {\n render() {\n return <RMFTileOverlay\n {...this.props}\n />;\n }\n}\n\nMFTileOverlay.propTypes = propTypes;\n\nvar RMFTileOverlay = requireNativeComponent(`RMFTileOverlay`, MFTileOverlay);\n\nexport { MFTileOverlay }\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,aAAR,QAA4B,oCAA5B;AACA,SACEC,sBADF,EAEEC,IAFF,QAGO,cAHP,C,CAKA;;AACA,MAAMC,aAAa,GAAGH,aAAa,IAAIE,IAAI,CAACE,SAA5C;AACA,MAAMA,SAAS,GAAG,EAChB,GAAGD,aADa;;EAGhB;AACF;AACA;AACA;EACEE,WAAW,EAAEP,SAAS,CAACQ,MAAV,CAAiBC,UAPd;;EAShB;AACF;AACA;EACEC,OAAO,EAAEV,SAAS,CAACW,IAZH;;EAchB;AACF;AACA;AACA;AACA;EACEC,MAAM,EAAEZ,SAAS,CAACa;AAnBF,CAAlB;;AAsBA,MAAMC,aAAN,SAA4Bb,KAAK,CAACc,SAAlC,CAA4C;EAC1CC,MAAM,GAAG;IACP,oBAAO,oBAAC,cAAD,EACD,KAAKC,KADJ,CAAP;EAGD;;AALyC;;AAQ5CH,aAAa,CAACR,SAAd,GAA0BA,SAA1B;AAEA,IAAIY,cAAc,GAAGf,sBAAsB,CAAE,gBAAF,EAAmBW,aAAnB,CAA3C;AAEA,SAASA,aAAT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["requireNativeComponent","UIManager","Platform","LINKING_ERROR","select","ios","default","ComponentName","Map4dMapView","getViewManagerConfig","Error"],"sources":["Map4dMapView.tsx"],"sourcesContent":["import {\
|
|
1
|
+
{"version":3,"names":["requireNativeComponent","UIManager","Platform","LINKING_ERROR","select","ios","default","ComponentName","Map4dMapView","getViewManagerConfig","Error"],"sources":["Map4dMapView.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n UIManager,\n Platform,\n ViewStyle,\n } from 'react-native';\n \n const LINKING_ERROR =\n `The package 'react-native-map4d-map' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n \n type Map4dMapProps = {\n color: string;\n style: ViewStyle;\n };\n \n const ComponentName = 'Map4dMapView';\n \n export const Map4dMapView =\n UIManager.getViewManagerConfig(ComponentName) != null\n ? requireNativeComponent<Map4dMapProps>(ComponentName)\n : () => {\n throw new Error(LINKING_ERROR);\n };\n "],"mappings":"AAAA,SACIA,sBADJ,EAEIC,SAFJ,EAGIC,QAHJ,QAKS,cALT;AAOE,MAAMC,aAAa,GAChB,iFAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAWA,MAAMC,aAAa,GAAG,cAAtB;AAEA,OAAO,MAAMC,YAAY,GACvBP,SAAS,CAACQ,oBAAV,CAA+BF,aAA/B,KAAiD,IAAjD,GACIP,sBAAsB,CAAgBO,aAAhB,CAD1B,GAEI,MAAM;EACJ,MAAM,IAAIG,KAAJ,CAAUP,aAAV,CAAN;AACD,CALA"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { AreaFocusSession } from './area/AreaFocusSession';
|
|
2
|
+
import { ProvinceArea, IndustrialEconomicArea } from './area/AreaFocusAreas';
|
|
3
|
+
import { IndustrialEconomicType } from './area/AreaFocusTypes';
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {'normal' | 'highlight'} FocusDisplay
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {{left?: number, right?: number, top?: number, bottom?: number}} FocusPadding
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {'province' | 'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel' | number} FocusType
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {Object} FocusOptions
|
|
18
|
+
* @property {FocusType} type
|
|
19
|
+
* @property {number=} id
|
|
20
|
+
* @property {string=} name
|
|
21
|
+
* @property {FocusDisplay=} display
|
|
22
|
+
* @property {FocusPadding=} padding
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const VIETNAM_MAINLAND_BOUNDS = {
|
|
26
|
+
minLat: 8.18,
|
|
27
|
+
minLng: 102.14,
|
|
28
|
+
maxLat: 23.4,
|
|
29
|
+
maxLng: 109.47
|
|
30
|
+
};
|
|
31
|
+
const FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE = {
|
|
32
|
+
industrialZone: IndustrialEconomicType.INDUSTRIAL_ZONE,
|
|
33
|
+
economicZone: IndustrialEconomicType.ECONOMIC_ZONE,
|
|
34
|
+
ecoIndustrialZone: IndustrialEconomicType.ECO_INDUSTRIAL_ZONE,
|
|
35
|
+
freeTradeZone: IndustrialEconomicType.FREE_TRADE_ZONE,
|
|
36
|
+
nonTariffZone: IndustrialEconomicType.NON_TARIFF_ZONE,
|
|
37
|
+
otherZoneModel: IndustrialEconomicType.OTHER_ZONE_MODEL
|
|
38
|
+
};
|
|
39
|
+
export class AreaFocusManager {
|
|
40
|
+
constructor(mapView) {
|
|
41
|
+
this.mapView = mapView;
|
|
42
|
+
this.currentSession = null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async _focusArea(area, options) {
|
|
46
|
+
this.clear();
|
|
47
|
+
|
|
48
|
+
if (!area) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
if (!(await area.load())) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const focusOptions = { ...(options || {})
|
|
58
|
+
};
|
|
59
|
+
const bounds = area.getBounds() || VIETNAM_MAINLAND_BOUNDS;
|
|
60
|
+
|
|
61
|
+
this._fitBounds(bounds, focusOptions);
|
|
62
|
+
|
|
63
|
+
this.currentSession = new AreaFocusSession(this.mapView, area, focusOptions);
|
|
64
|
+
this.currentSession.render();
|
|
65
|
+
return this.currentSession;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.error('Cannot focus area:', error);
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async _focusProvince(options) {
|
|
73
|
+
const provinceId = this._getProvinceId(options);
|
|
74
|
+
|
|
75
|
+
const provinceName = this._getProvinceName(options);
|
|
76
|
+
|
|
77
|
+
if (provinceId == null && !provinceName) {
|
|
78
|
+
this.clear();
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const area = provinceId != null ? new ProvinceArea(provinceId) : ProvinceArea.fromName(provinceName);
|
|
83
|
+
const display = options && options.display === 'highlight' ? 'highlight' : 'normal';
|
|
84
|
+
return this._focusArea(area, {
|
|
85
|
+
display,
|
|
86
|
+
padding: options ? options.padding : undefined
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @param {FocusOptions | null | undefined} focusOptions
|
|
91
|
+
* @returns {Promise<AreaFocusSession | null>}
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async focus(focusOptions) {
|
|
96
|
+
if (focusOptions == null) {
|
|
97
|
+
this.clear();
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (focusOptions.type === 'province') {
|
|
102
|
+
return this._focusProvince(focusOptions);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (focusOptions.id == null) {
|
|
106
|
+
console.warn('Focus options must include an id for non-province types:', focusOptions);
|
|
107
|
+
this.clear();
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const industrialEconomicType = this._getIndustrialEconomicType(focusOptions.type);
|
|
112
|
+
|
|
113
|
+
if (industrialEconomicType != null) {
|
|
114
|
+
return this._focusArea(new IndustrialEconomicArea(industrialEconomicType, focusOptions.id), {
|
|
115
|
+
display: focusOptions.display,
|
|
116
|
+
padding: focusOptions.padding
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
console.warn('Unsupported focus type:', focusOptions.type);
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
_getIndustrialEconomicType(type) {
|
|
125
|
+
if (typeof type === 'number') {
|
|
126
|
+
const values = Object.values(IndustrialEconomicType);
|
|
127
|
+
return values.includes(type) ? type : null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (typeof type !== 'string') {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE[type] || null;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
clear() {
|
|
138
|
+
if (this.currentSession) {
|
|
139
|
+
this.currentSession.destroy();
|
|
140
|
+
this.currentSession = null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
_fitBounds(bounds, options) {
|
|
145
|
+
if (!this.mapView || typeof this.mapView.fitBounds !== 'function' || !bounds) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
this.mapView.fitBounds({
|
|
150
|
+
bounds: {
|
|
151
|
+
southWest: {
|
|
152
|
+
latitude: bounds.minLat,
|
|
153
|
+
longitude: bounds.minLng
|
|
154
|
+
},
|
|
155
|
+
northEast: {
|
|
156
|
+
latitude: bounds.maxLat,
|
|
157
|
+
longitude: bounds.maxLng
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
padding: options ? options.padding : undefined
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_getProvinceName(options) {
|
|
165
|
+
if (options == null || typeof options !== 'object') {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (typeof options.name === 'string') {
|
|
170
|
+
const name = options.name.trim();
|
|
171
|
+
return name.length > 0 ? name : null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const optionKeys = Object.keys(options);
|
|
175
|
+
const unsupportedKeys = optionKeys.filter(key => key !== 'type' && key !== 'id' && key !== 'name' && key !== 'display' && key !== 'padding');
|
|
176
|
+
|
|
177
|
+
if (unsupportedKeys.length > 0) {
|
|
178
|
+
console.warn(`[AreaFocusManager] focusProvince expects options like { type: 'province', name: 'Ha Noi', display: 'highlight' }. Unsupported keys: ${unsupportedKeys.join(', ')}`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
_getProvinceId(options) {
|
|
185
|
+
if (options == null || typeof options !== 'object') {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return typeof options.id === 'number' ? options.id : null;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=AreaFocusManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AreaFocusSession","ProvinceArea","IndustrialEconomicArea","IndustrialEconomicType","VIETNAM_MAINLAND_BOUNDS","minLat","minLng","maxLat","maxLng","FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE","industrialZone","INDUSTRIAL_ZONE","economicZone","ECONOMIC_ZONE","ecoIndustrialZone","ECO_INDUSTRIAL_ZONE","freeTradeZone","FREE_TRADE_ZONE","nonTariffZone","NON_TARIFF_ZONE","otherZoneModel","OTHER_ZONE_MODEL","AreaFocusManager","constructor","mapView","currentSession","_focusArea","area","options","clear","load","focusOptions","bounds","getBounds","_fitBounds","render","error","console","_focusProvince","provinceId","_getProvinceId","provinceName","_getProvinceName","fromName","display","padding","undefined","focus","type","id","warn","industrialEconomicType","_getIndustrialEconomicType","values","Object","includes","destroy","fitBounds","southWest","latitude","longitude","northEast","name","trim","length","optionKeys","keys","unsupportedKeys","filter","key","join"],"sources":["AreaFocusManager.js"],"sourcesContent":["import {AreaFocusSession} from './area/AreaFocusSession'\nimport {ProvinceArea, IndustrialEconomicArea} from './area/AreaFocusAreas'\nimport {IndustrialEconomicType} from './area/AreaFocusTypes'\n\n/**\n * @typedef {'normal' | 'highlight'} FocusDisplay\n */\n\n/**\n * @typedef {{left?: number, right?: number, top?: number, bottom?: number}} FocusPadding\n */\n\n/**\n * @typedef {'province' | 'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel' | number} FocusType\n */\n\n/**\n * @typedef {Object} FocusOptions\n * @property {FocusType} type\n * @property {number=} id\n * @property {string=} name\n * @property {FocusDisplay=} display\n * @property {FocusPadding=} padding\n */\n\nconst VIETNAM_MAINLAND_BOUNDS = {\n minLat: 8.18,\n minLng: 102.14,\n maxLat: 23.4,\n maxLng: 109.47,\n}\n\nconst FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE = {\n industrialZone: IndustrialEconomicType.INDUSTRIAL_ZONE,\n economicZone: IndustrialEconomicType.ECONOMIC_ZONE,\n ecoIndustrialZone: IndustrialEconomicType.ECO_INDUSTRIAL_ZONE,\n freeTradeZone: IndustrialEconomicType.FREE_TRADE_ZONE,\n nonTariffZone: IndustrialEconomicType.NON_TARIFF_ZONE,\n otherZoneModel: IndustrialEconomicType.OTHER_ZONE_MODEL,\n}\n\nexport class AreaFocusManager {\n constructor(mapView) {\n this.mapView = mapView\n this.currentSession = null\n }\n\n async _focusArea(area, options) {\n this.clear()\n\n if (!area) {\n return null\n }\n\n try {\n if (!(await area.load())) {\n return null\n }\n\n const focusOptions = {...(options || {})}\n const bounds = area.getBounds() || VIETNAM_MAINLAND_BOUNDS\n\n this._fitBounds(bounds, focusOptions)\n\n this.currentSession = new AreaFocusSession(this.mapView, area, focusOptions)\n this.currentSession.render()\n\n return this.currentSession\n }\n catch (error) {\n console.error('Cannot focus area:', error)\n return null\n }\n }\n\n async _focusProvince(options) {\n const provinceId = this._getProvinceId(options)\n const provinceName = this._getProvinceName(options)\n\n if (provinceId == null && !provinceName) {\n this.clear()\n return null\n }\n\n const area = provinceId != null ? new ProvinceArea(provinceId) : ProvinceArea.fromName(provinceName)\n const display = options && options.display === 'highlight' ? 'highlight' : 'normal'\n\n return this._focusArea(area, {\n display,\n padding: options ? options.padding : undefined,\n })\n }\n\n /**\n * @param {FocusOptions | null | undefined} focusOptions\n * @returns {Promise<AreaFocusSession | null>}\n */\n async focus(focusOptions) {\n if (focusOptions == null) {\n this.clear()\n return null\n }\n\n if (focusOptions.type === 'province') {\n return this._focusProvince(focusOptions)\n }\n\n if (focusOptions.id == null) {\n console.warn('Focus options must include an id for non-province types:', focusOptions)\n this.clear()\n return null\n }\n\n const industrialEconomicType = this._getIndustrialEconomicType(focusOptions.type)\n\n if (industrialEconomicType != null) {\n return this._focusArea(new IndustrialEconomicArea(industrialEconomicType, focusOptions.id), {\n display: focusOptions.display,\n padding: focusOptions.padding,\n })\n }\n\n console.warn('Unsupported focus type:', focusOptions.type)\n return null\n }\n\n _getIndustrialEconomicType(type) {\n if (typeof type === 'number') {\n const values = Object.values(IndustrialEconomicType)\n return values.includes(type) ? type : null\n }\n\n if (typeof type !== 'string') {\n return null\n }\n\n return FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE[type] || null\n }\n\n clear() {\n if (this.currentSession) {\n this.currentSession.destroy()\n this.currentSession = null\n }\n }\n\n _fitBounds(bounds, options) {\n if (!this.mapView || typeof this.mapView.fitBounds !== 'function' || !bounds) {\n return\n }\n\n this.mapView.fitBounds({\n bounds: {\n southWest: {\n latitude: bounds.minLat,\n longitude: bounds.minLng,\n },\n northEast: {\n latitude: bounds.maxLat,\n longitude: bounds.maxLng,\n },\n },\n padding: options ? options.padding : undefined,\n })\n }\n\n _getProvinceName(options) {\n if (options == null || typeof options !== 'object') {\n return null\n }\n\n if (typeof options.name === 'string') {\n const name = options.name.trim()\n return name.length > 0 ? name : null\n }\n\n const optionKeys = Object.keys(options)\n const unsupportedKeys = optionKeys.filter((key) => key !== 'type' && key !== 'id' && key !== 'name' && key !== 'display' && key !== 'padding')\n\n if (unsupportedKeys.length > 0) {\n console.warn(\n `[AreaFocusManager] focusProvince expects options like { type: 'province', name: 'Ha Noi', display: 'highlight' }. Unsupported keys: ${unsupportedKeys.join(', ')}`\n )\n }\n\n return null\n }\n\n _getProvinceId(options) {\n if (options == null || typeof options !== 'object') {\n return null\n }\n\n return typeof options.id === 'number' ? options.id : null\n }\n}\n"],"mappings":"AAAA,SAAQA,gBAAR,QAA+B,yBAA/B;AACA,SAAQC,YAAR,EAAsBC,sBAAtB,QAAmD,uBAAnD;AACA,SAAQC,sBAAR,QAAqC,uBAArC;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE,IADsB;EAE9BC,MAAM,EAAE,MAFsB;EAG9BC,MAAM,EAAE,IAHsB;EAI9BC,MAAM,EAAE;AAJsB,CAAhC;AAOA,MAAMC,sCAAsC,GAAG;EAC7CC,cAAc,EAAEP,sBAAsB,CAACQ,eADM;EAE7CC,YAAY,EAAET,sBAAsB,CAACU,aAFQ;EAG7CC,iBAAiB,EAAEX,sBAAsB,CAACY,mBAHG;EAI7CC,aAAa,EAAEb,sBAAsB,CAACc,eAJO;EAK7CC,aAAa,EAAEf,sBAAsB,CAACgB,eALO;EAM7CC,cAAc,EAAEjB,sBAAsB,CAACkB;AANM,CAA/C;AASA,OAAO,MAAMC,gBAAN,CAAuB;EAC5BC,WAAW,CAACC,OAAD,EAAU;IACnB,KAAKA,OA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