react-native-map4d-map-dtqg 0.1.3 → 0.1.4
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 -133
- package/android/.gradle/8.9/checksums/checksums.lock +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.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- 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 -231
- 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/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 -509
- 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.map +1 -1
- package/lib/commonjs/components/MFBuilding.js +50 -32
- package/lib/commonjs/components/MFBuilding.js.map +1 -1
- package/lib/commonjs/components/MFCircle.js +44 -26
- package/lib/commonjs/components/MFCircle.js.map +1 -1
- package/lib/commonjs/components/MFDirectionsRenderer.js +56 -38
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/commonjs/components/MFMapView.js +91 -74
- package/lib/commonjs/components/MFMapView.js.map +1 -1
- package/lib/commonjs/components/MFMarker.js +59 -41
- package/lib/commonjs/components/MFMarker.js.map +1 -1
- package/lib/commonjs/components/MFPOI.js +44 -26
- package/lib/commonjs/components/MFPOI.js.map +1 -1
- package/lib/commonjs/components/MFPolygon.js +46 -28
- package/lib/commonjs/components/MFPolygon.js.map +1 -1
- package/lib/commonjs/components/MFPolyline.js +42 -24
- 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 +16 -16
- package/lib/commonjs/components/extends/AreaFocusManager.js.map +1 -1
- package/lib/commonjs/components/extends/AreaFocuser.js +2 -2
- package/lib/commonjs/components/extends/AreaFocuser.js.map +1 -1
- package/lib/commonjs/components/extends/BoundHelper.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusAreas.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusSession.js.map +1 -1
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js +18 -18
- package/lib/commonjs/components/extends/area/AreaFocusTypes.js.map +1 -1
- package/lib/commonjs/components/internal/DefaultRoadmapStyle.js.map +1 -1
- package/lib/commonjs/components/internal/GeojsonStyleUtils.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/MFBanDoSo.js.map +1 -1
- package/lib/module/components/MFBuilding.js +51 -33
- package/lib/module/components/MFBuilding.js.map +1 -1
- package/lib/module/components/MFCircle.js +45 -27
- package/lib/module/components/MFCircle.js.map +1 -1
- package/lib/module/components/MFDirectionsRenderer.js +57 -39
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -1
- package/lib/module/components/MFMapView.js +92 -75
- package/lib/module/components/MFMapView.js.map +1 -1
- package/lib/module/components/MFMarker.js +60 -42
- package/lib/module/components/MFMarker.js.map +1 -1
- package/lib/module/components/MFPOI.js +45 -27
- package/lib/module/components/MFPOI.js.map +1 -1
- package/lib/module/components/MFPolygon.js +47 -29
- package/lib/module/components/MFPolygon.js.map +1 -1
- package/lib/module/components/MFPolyline.js +43 -25
- 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 +16 -16
- package/lib/module/components/extends/AreaFocusManager.js.map +1 -1
- package/lib/module/components/extends/AreaFocuser.js +2 -2
- package/lib/module/components/extends/AreaFocuser.js.map +1 -1
- package/lib/module/components/extends/BoundHelper.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusAreas.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusGeometryUtils.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusSession.js.map +1 -1
- package/lib/module/components/extends/area/AreaFocusTypes.js +18 -18
- package/lib/module/components/extends/area/AreaFocusTypes.js.map +1 -1
- package/lib/module/components/internal/DefaultRoadmapStyle.js.map +1 -1
- package/lib/module/components/internal/GeojsonStyleUtils.js.map +1 -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 -124
- package/src/components/MFBuilding.js +200 -187
- package/src/components/MFCircle.js +186 -173
- package/src/components/MFDirectionsRenderer.js +250 -237
- package/src/components/MFMapView.js +480 -464
- package/src/components/MFMarker.js +259 -246
- package/src/components/MFPOI.js +197 -184
- package/src/components/MFPolygon.js +199 -186
- package/src/components/MFPolyline.js +185 -172
- package/src/components/MFTileOverlay.js +45 -45
- package/src/components/Map4dMapView.tsx +26 -26
- package/src/components/extends/AreaFocusManager.js +196 -196
- package/src/components/extends/AreaFocuser.js +61 -61
- package/src/components/extends/BoundHelper.js +31 -31
- package/src/components/extends/area/AreaFocusAreas.js +164 -164
- package/src/components/extends/area/AreaFocusGeometryUtils.js +164 -164
- package/src/components/extends/area/AreaFocusSession.js +100 -100
- package/src/components/extends/area/AreaFocusTypes.js +36 -36
- package/src/components/internal/DefaultRoadmapStyle.js +3365 -3365
- package/src/components/internal/GeojsonStyleUtils.js +143 -143
- package/src/index.js +25 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GEOJSON_SOURCE_NAME","deepClone","value","JSON","parse","stringify","toStyleObject","mapStyle","defaultStyle","defaultRoadmapStyle","error","Array","isArray","generateLayerStyle","source","items","layers","forEach","item","key","style","line","index","push","id","type","source_layer","layer","filter","draw","fill","symbol","createCategoryItemsSignature","normalized","map","checked","buildGeojsonStyle","sourceUrl","result","sources","defaultGeojsonSource","trim","length","url","normalizeItems","layerStyle","baseLayers","metadata","managedBy","concat"],"sources":["GeojsonStyleUtils.js"],"sourcesContent":["import defaultRoadmapStyle from './DefaultRoadmapStyle';\n\nconst GEOJSON_SOURCE_NAME = 'geojson';\n\nfunction deepClone(value) {\n return JSON.parse(JSON.stringify(value));\n}\n\nfunction toStyleObject(mapStyle) {\n const defaultStyle = deepClone(defaultRoadmapStyle);\n if (mapStyle == null) {\n return defaultStyle;\n }\n\n if (typeof mapStyle === 'string') {\n try {\n return JSON.parse(mapStyle);\n } catch (error) {\n return defaultStyle;\n }\n }\n\n if (typeof mapStyle === 'object' && !Array.isArray(mapStyle)) {\n try {\n return deepClone(mapStyle);\n } catch (error) {\n return defaultStyle;\n }\n }\n\n return defaultStyle;\n}\n\nfunction generateLayerStyle(source, items) {\n const layers = [];\n\n items.forEach((item) => {\n const key = item?.key;\n const style = item?.style;\n if (!key || !style || typeof style !== 'object') {\n return;\n }\n\n if (Array.isArray(style.line)) {\n style.line.forEach((line, index) => {\n layers.push({\n id: `${key}-line-${index}`,\n type: 'line',\n source,\n source_layer: line.layer,\n filter: line.filter,\n draw: line.draw,\n });\n });\n }\n\n if (Array.isArray(style.fill)) {\n style.fill.forEach((fill, index) => {\n layers.push({\n id: `${key}-fill-${index}`,\n type: 'fill',\n source,\n source_layer: fill.layer,\n filter: fill.filter,\n draw: fill.draw,\n });\n });\n }\n\n if (Array.isArray(style.symbol)) {\n style.symbol.forEach((symbol, index) => {\n layers.push({\n id: `${key}-symbol-${index}`,\n type: 'symbol',\n source,\n source_layer: symbol.layer,\n filter: symbol.filter,\n draw: symbol.draw,\n });\n });\n }\n });\n\n return layers;\n}\n\nfunction createCategoryItemsSignature(items) {\n if (!Array.isArray(items)) {\n return '';\n }\n\n const normalized = items.map((item) => ({\n key: item?.key || '',\n checked: !!item?.checked,\n style: item?.style || null,\n }));\n\n return JSON.stringify(normalized);\n}\n\nfunction buildGeojsonStyle(mapStyle, sourceUrl, items) {\n const result = toStyleObject(mapStyle);\n result.sources = result.sources || {};\n\n const defaultGeojsonSource =\n typeof result.sources[GEOJSON_SOURCE_NAME] === 'object' &&\n result.sources[GEOJSON_SOURCE_NAME] !== null\n ? result.sources[GEOJSON_SOURCE_NAME]\n : {};\n\n result.sources[GEOJSON_SOURCE_NAME] = {\n ...defaultGeojsonSource,\n type: 'vector',\n };\n\n if (typeof sourceUrl === 'string' && sourceUrl.trim().length > 0) {\n result.sources[GEOJSON_SOURCE_NAME].url = sourceUrl;\n }\n\n const normalizeItems = Array.isArray(items) ? items : [];\n const layerStyle = generateLayerStyle(GEOJSON_SOURCE_NAME, normalizeItems);\n\n const baseLayers = (Array.isArray(result.layers) ? result.layers : []).filter(\n (layer) => {\n if (!layer || typeof layer !== 'object') {\n return false;\n }\n\n if (layer.source_layer === 'pois') {\n return false;\n }\n\n const metadata = layer.metadata;\n return !(metadata && metadata.managedBy === 'MFBanDoSo');\n }\n );\n\n result.layers = baseLayers.concat(layerStyle);\n\n return JSON.stringify(result);\n}\n\nexport { buildGeojsonStyle, createCategoryItemsSignature };\n"],"mappings":";;;;;;;;AAAA;;;;AAEA,MAAMA,mBAAmB,GAAG,SAA5B;;AAEA,SAASC,SAAT,CAAmBC,KAAnB,EAA0B;EACxB,OAAOC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,SAAL,CAAeH,KAAf,CAAX,CAAP;AACD;;AAED,SAASI,aAAT,CAAuBC,QAAvB,EAAiC;EAC/B,MAAMC,YAAY,GAAGP,SAAS,CAACQ,4BAAD,CAA9B;;EACA,IAAIF,QAAQ,IAAI,IAAhB,EAAsB;IACpB,OAAOC,YAAP;EACD;;EAED,IAAI,OAAOD,QAAP,KAAoB,QAAxB,EAAkC;IAChC,IAAI;MACF,OAAOJ,IAAI,CAACC,KAAL,CAAWG,QAAX,CAAP;IACD,CAFD,CAEE,OAAOG,KAAP,EAAc;MACd,OAAOF,YAAP;IACD;EACF;;EAED,IAAI,OAAOD,QAAP,KAAoB,QAApB,IAAgC,CAACI,KAAK,CAACC,OAAN,CAAcL,QAAd,CAArC,EAA8D;IAC5D,IAAI;MACF,OAAON,SAAS,CAACM,QAAD,CAAhB;IACD,CAFD,CAEE,OAAOG,KAAP,EAAc;MACd,OAAOF,YAAP;IACD;EACF;;EAED,OAAOA,YAAP;AACD;;AAED,SAASK,kBAAT,CAA4BC,MAA5B,EAAoCC,KAApC,EA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AAevC,mBAAf,MAAwC,IADxC,GAEIsC,MAAM,CAACC,OAAP,CAAevC,mBAAf,CAFJ,GAGI,EAJN;EAMAsC,MAAM,CAACC,OAAP,CAAevC,mBAAf,IAAsC,EACpC,GAAGwC,oBADiC;IAEpCf,IAAI,EAAE;EAF8B,CAAtC;;EAKA,IAAI,OAAOY,SAAP,KAAqB,QAArB,IAAiCA,SAAS,CAACI,IAAV,GAAiBC,MAAjB,GAA0B,CAA/D,EAAkE;IAChEJ,MAAM,CAACC,OAAP,CAAevC,mBAAf,EAAoC2C,GAApC,GAA0CN,SAA1C;EACD;;EAED,MAAMO,cAAc,GAAGjC,KAAK,CAACC,OAAN,CAAcG,KAAd,IAAuBA,KAAvB,GAA+B,EAAtD;EACA,MAAM8B,UAAU,GAAGhC,kBAAkB,CAACb,mBAAD,EAAsB4C,cAAtB,CAArC;EAEA,MAAME,UAAU,GAAG,CAACnC,KAAK,CAACC,OAAN,CAAc0B,MAAM,CAACtB,MAArB,IAA+BsB,MAAM,CAACtB,MAAtC,GAA+C,EAAhD,EAAoDY,MAApD,CAChBD,KAAD,IAAW;IACT,IAAI,CAACA,KAAD,IAAU,OAAOA,KAAP,KAAiB,QAA/B,EAAyC;MACvC,OAAO,KAAP;IACD;;IAED,IAAIA,KAAK,CAACD,YAAN,KAAuB,MAA3B,EAAmC;MACjC,OAAO,KAAP;IACD;;IAED,MAAMqB,QAAQ,GAAGpB,KAAK,CAACoB,QAAvB;IACA,OAAO,EAAEA,QAAQ,IAAIA,QAAQ,CAACC,SAAT,KAAuB,WAArC,CAAP;EACD,CAZgB,CAAnB;EAeAV,MAAM,CAACtB,MAAP,GAAgB8B,UAAU,CAACG,MAAX,CAAkBJ,UAAlB,CAAhB;EAEA,OAAO1C,IAAI,CAACE,SAAL,CAAeiC,MAAf,CAAP;AACD"}
|
|
1
|
+
{"version":3,"names":["GEOJSON_SOURCE_NAME","deepClone","value","JSON","parse","stringify","toStyleObject","mapStyle","defaultStyle","defaultRoadmapStyle","error","Array","isArray","generateLayerStyle","source","items","layers","forEach","item","key","style","line","index","push","id","type","source_layer","layer","filter","draw","fill","symbol","createCategoryItemsSignature","normalized","map","checked","buildGeojsonStyle","sourceUrl","result","sources","defaultGeojsonSource","trim","length","url","normalizeItems","layerStyle","baseLayers","metadata","managedBy","concat"],"sources":["GeojsonStyleUtils.js"],"sourcesContent":["import defaultRoadmapStyle from './DefaultRoadmapStyle';\r\n\r\nconst GEOJSON_SOURCE_NAME = 'geojson';\r\n\r\nfunction deepClone(value) {\r\n return JSON.parse(JSON.stringify(value));\r\n}\r\n\r\nfunction toStyleObject(mapStyle) {\r\n const defaultStyle = deepClone(defaultRoadmapStyle);\r\n if (mapStyle == null) {\r\n return defaultStyle;\r\n }\r\n\r\n if (typeof mapStyle === 'string') {\r\n try {\r\n return JSON.parse(mapStyle);\r\n } catch (error) {\r\n return defaultStyle;\r\n }\r\n }\r\n\r\n if (typeof mapStyle === 'object' && !Array.isArray(mapStyle)) {\r\n try {\r\n return deepClone(mapStyle);\r\n } catch (error) {\r\n return defaultStyle;\r\n }\r\n }\r\n\r\n return defaultStyle;\r\n}\r\n\r\nfunction generateLayerStyle(source, items) {\r\n const layers = [];\r\n\r\n items.forEach((item) => {\r\n const key = item?.key;\r\n const style = item?.style;\r\n if (!key || !style || typeof style !== 'object') {\r\n return;\r\n }\r\n\r\n if (Array.isArray(style.line)) {\r\n style.line.forEach((line, index) => {\r\n layers.push({\r\n id: `${key}-line-${index}`,\r\n type: 'line',\r\n source,\r\n source_layer: line.layer,\r\n filter: line.filter,\r\n draw: line.draw,\r\n });\r\n });\r\n }\r\n\r\n if (Array.isArray(style.fill)) {\r\n style.fill.forEach((fill, index) => {\r\n layers.push({\r\n id: `${key}-fill-${index}`,\r\n type: 'fill',\r\n source,\r\n source_layer: fill.layer,\r\n filter: fill.filter,\r\n draw: fill.draw,\r\n });\r\n });\r\n }\r\n\r\n if (Array.isArray(style.symbol)) {\r\n style.symbol.forEach((symbol, index) => {\r\n layers.push({\r\n id: `${key}-symbol-${index}`,\r\n type: 'symbol',\r\n source,\r\n source_layer: symbol.layer,\r\n filter: symbol.filter,\r\n draw: symbol.draw,\r\n });\r\n });\r\n }\r\n });\r\n\r\n return layers;\r\n}\r\n\r\nfunction createCategoryItemsSignature(items) {\r\n if (!Array.isArray(items)) {\r\n return '';\r\n }\r\n\r\n const normalized = items.map((item) => ({\r\n key: item?.key || '',\r\n checked: !!item?.checked,\r\n style: item?.style || null,\r\n }));\r\n\r\n return JSON.stringify(normalized);\r\n}\r\n\r\nfunction buildGeojsonStyle(mapStyle, sourceUrl, items) {\r\n const result = toStyleObject(mapStyle);\r\n result.sources = result.sources || {};\r\n\r\n const defaultGeojsonSource =\r\n typeof result.sources[GEOJSON_SOURCE_NAME] === 'object' &&\r\n result.sources[GEOJSON_SOURCE_NAME] !== null\r\n ? result.sources[GEOJSON_SOURCE_NAME]\r\n : {};\r\n\r\n result.sources[GEOJSON_SOURCE_NAME] = {\r\n ...defaultGeojsonSource,\r\n type: 'vector',\r\n };\r\n\r\n if (typeof sourceUrl === 'string' && sourceUrl.trim().length > 0) {\r\n result.sources[GEOJSON_SOURCE_NAME].url = sourceUrl;\r\n }\r\n\r\n const normalizeItems = Array.isArray(items) ? items : [];\r\n const layerStyle = generateLayerStyle(GEOJSON_SOURCE_NAME, normalizeItems);\r\n\r\n const baseLayers = (Array.isArray(result.layers) ? result.layers : []).filter(\r\n (layer) => {\r\n if (!layer || typeof layer !== 'object') {\r\n return false;\r\n }\r\n\r\n if (layer.source_layer === 'pois') {\r\n return false;\r\n }\r\n\r\n const metadata = layer.metadata;\r\n return !(metadata && metadata.managedBy === 'MFBanDoSo');\r\n }\r\n );\r\n\r\n result.layers = baseLayers.concat(layerStyle);\r\n\r\n return JSON.stringify(result);\r\n}\r\n\r\nexport { buildGeojsonStyle, createCategoryItemsSignature };\r\n"],"mappings":";;;;;;;;AAAA;;;;AAEA,MAAMA,mBAAmB,GAAG,SAA5B;;AAEA,SAASC,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CAACb,mBAAD,EAAsB4C,cAAtB,CAArC;EAEA,MAAME,UAAU,GAAG,CAACnC,KAAK,CAACC,OAAN,CAAc0B,MAAM,CAACtB,MAArB,IAA+BsB,MAAM,CAACtB,MAAtC,GAA+C,EAAhD,EAAoDY,MAApD,CAChBD,KAAD,IAAW;IACT,IAAI,CAACA,KAAD,IAAU,OAAOA,KAAP,KAAiB,QAA/B,EAAyC;MACvC,OAAO,KAAP;IACD;;IAED,IAAIA,KAAK,CAACD,YAAN,KAAuB,MAA3B,EAAmC;MACjC,OAAO,KAAP;IACD;;IAED,MAAMqB,QAAQ,GAAGpB,KAAK,CAACoB,QAAvB;IACA,OAAO,EAAEA,QAAQ,IAAIA,QAAQ,CAACC,SAAT,KAAuB,WAArC,CAAP;EACD,CAZgB,CAAnB;EAeAV,MAAM,CAACtB,MAAP,GAAgB8B,UAAU,CAACG,MAAX,CAAkBJ,UAAlB,CAAhB;EAEA,OAAO1C,IAAI,CAACE,SAAL,CAAeiC,MAAf,CAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.js"],"sourcesContent":["import {MFMapView} from './components/MFMapView'\nimport { MFBanDoSo } from './components/MFBanDoSo'\nimport {MFMarker} from './components/MFMarker'\nimport {MFCircle} from './components/MFCircle'\nimport {MFPolyline} from './components/MFPolyline'\nimport {MFPolygon} from './components/MFPolygon'\nimport {MFPOI} from './components/MFPOI'\nimport {MFDirectionsRenderer} from './components/MFDirectionsRenderer'\nimport {MFTileOverlay} from './components/MFTileOverlay'\nimport {MFBuilding} from './components/MFBuilding'\nimport {AreaFocuser} from './components/extends/AreaFocuser'\n\nexport {\n MFMapView,\n MFBanDoSo,\n MFMarker,\n MFCircle,\n MFPolyline,\n MFPolygon,\n MFPOI,\n MFDirectionsRenderer,\n MFTileOverlay,\n MFBuilding,\n AreaFocuser,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.js"],"sourcesContent":["import {MFMapView} from './components/MFMapView'\r\nimport { MFBanDoSo } from './components/MFBanDoSo'\r\nimport {MFMarker} from './components/MFMarker'\r\nimport {MFCircle} from './components/MFCircle'\r\nimport {MFPolyline} from './components/MFPolyline'\r\nimport {MFPolygon} from './components/MFPolygon'\r\nimport {MFPOI} from './components/MFPOI'\r\nimport {MFDirectionsRenderer} from './components/MFDirectionsRenderer'\r\nimport {MFTileOverlay} from './components/MFTileOverlay'\r\nimport {MFBuilding} from './components/MFBuilding'\r\nimport {AreaFocuser} from './components/extends/AreaFocuser'\r\n\r\nexport {\r\n MFMapView,\r\n MFBanDoSo,\r\n MFMarker,\r\n MFCircle,\r\n MFPolyline,\r\n MFPolygon,\r\n MFPOI,\r\n MFDirectionsRenderer,\r\n MFTileOverlay,\r\n MFBuilding,\r\n AreaFocuser,\r\n};\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PropTypes","MFMapView","buildGeojsonStyle","createCategoryItemsSignature","FilterStylePropType","shape","kind","oneOfType","string","arrayOf","kind_detail","DrawLinePropType","color","width","number","array","DrawFillPropType","DrawSymbolPropType","icon_image","icon_index","icon_color","use_direct_icon_url","bool","CategoryStylePropType","line","layer","filter","draw","fill","symbol","CategoryItemPropType","key","title","group","order","checked","style","MFBanDoSo","constructor","props","_appliedGeojsonStyle","componentDidMount","_syncGeojsonStyle","componentDidUpdate","prevProps","prevState","mapReadyChanged","isReady","state","mapStyleChanged","mapStyle","sourceUrlChanged","sourceUrl","itemsChanged","items","geojsonStyle","_runCommand","propTypes","isRequired"],"sources":["MFBanDoSo.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport { MFMapView } from './MFMapView';\nimport {\n buildGeojsonStyle,\n createCategoryItemsSignature,\n} from './internal/GeojsonStyleUtils';\n\nconst FilterStylePropType = PropTypes.shape({\n kind: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n kind_detail: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n});\n\nconst DrawLinePropType = PropTypes.shape({\n color: PropTypes.string,\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\n});\n\nconst DrawFillPropType = PropTypes.shape({\n color: PropTypes.string,\n});\n\nconst DrawSymbolPropType = PropTypes.shape({\n icon_image: PropTypes.string,\n icon_index: PropTypes.number,\n icon_color: PropTypes.string,\n use_direct_icon_url: PropTypes.bool,\n});\n\nconst CategoryStylePropType = PropTypes.shape({\n line: PropTypes.arrayOf(\n PropTypes.shape({\n layer: PropTypes.string,\n filter: FilterStylePropType,\n draw: DrawLinePropType,\n })\n ),\n fill: PropTypes.arrayOf(\n PropTypes.shape({\n layer: PropTypes.string,\n filter: FilterStylePropType,\n draw: DrawFillPropType,\n })\n ),\n symbol: PropTypes.arrayOf(\n PropTypes.shape({\n layer: PropTypes.string,\n filter: FilterStylePropType,\n draw: DrawSymbolPropType,\n })\n ),\n});\n\nconst CategoryItemPropType = PropTypes.shape({\n key: PropTypes.string,\n title: PropTypes.string,\n group: PropTypes.string,\n order: PropTypes.number,\n checked: PropTypes.bool,\n style: CategoryStylePropType,\n});\n\nclass MFBanDoSo extends MFMapView {\n constructor(props) {\n super(props);\n this._appliedGeojsonStyle = null;\n }\n\n componentDidMount() {\n this._syncGeojsonStyle();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const mapReadyChanged = prevState.isReady !== this.state.isReady;\n const mapStyleChanged = prevProps.mapStyle !== this.props.mapStyle;\n const sourceUrlChanged = prevProps.sourceUrl !== this.props.sourceUrl;\n const itemsChanged =\n createCategoryItemsSignature(prevProps.items) !==\n createCategoryItemsSignature(this.props.items);\n\n if (\n mapReadyChanged ||\n mapStyleChanged ||\n sourceUrlChanged ||\n itemsChanged\n ) {\n this._syncGeojsonStyle();\n }\n }\n\n _syncGeojsonStyle() {\n if (!this.state.isReady) {\n return;\n }\n\n const items = this.props.items || [];\n\n const geojsonStyle = buildGeojsonStyle(\n this.props.mapStyle,\n this.props.sourceUrl,\n items\n );\n\n if (!geojsonStyle || geojsonStyle === this._appliedGeojsonStyle) {\n return;\n }\n\n this._appliedGeojsonStyle = geojsonStyle;\n this._runCommand('setMapStyle', [geojsonStyle]);\n }\n}\n\nMFBanDoSo.propTypes = {\n ...MFMapView.propTypes,\n items: PropTypes.arrayOf(CategoryItemPropType),\n sourceUrl: PropTypes.string.isRequired,\n};\n\nexport { MFBanDoSo };\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SACEC,iBADF,EAEEC,4BAFF,QAGO,8BAHP;AAKA,MAAMC,mBAAmB,GAAGJ,SAAS,CAACK,KAAV,CAAgB;EAC1CC,IAAI,EAAEN,SAAS,CAACO,SAAV,CAAoB,CACxBP,SAAS,CAACQ,MADc,EAExBR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACQ,MAA5B,CAFwB,CAApB,CADoC;EAK1CE,WAAW,EAAEV,SAAS,CAACO,SAAV,CAAoB,CAC/BP,SAAS,CAACQ,MADqB,EAE/BR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACQ,MAA5B,CAF+B,CAApB;AAL6B,CAAhB,CAA5B;AAWA,MAAMG,gBAAgB,GAAGX,SAAS,CAACK,KAAV,CAAgB;EACvCO,KAAK,EAAEZ,SAAS,CAACQ,MADsB;EAEvCK,KAAK,EAAEb,SAAS,CAACO,SAAV,CAAoB,CAACP,SAAS,CAACc,MAAX,EAA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CAAiB,aAAjB,EAAgC,CAACD,YAAD,CAAhC;EACD;;AA/C+B;;AAkDlClB,SAAS,CAACoB,SAAV,GAAsB,EACpB,GAAGxD,SAAS,CAACwD,SADO;EAEpBH,KAAK,EAAEtD,SAAS,CAACS,OAAV,CAAkBqB,oBAAlB,CAFa;EAGpBsB,SAAS,EAAEpD,SAAS,CAACQ,MAAV,CAAiBkD;AAHR,CAAtB;AAMA,SAASrB,SAAT"}
|
|
1
|
+
{"version":3,"names":["PropTypes","MFMapView","buildGeojsonStyle","createCategoryItemsSignature","FilterStylePropType","shape","kind","oneOfType","string","arrayOf","kind_detail","DrawLinePropType","color","width","number","array","DrawFillPropType","DrawSymbolPropType","icon_image","icon_index","icon_color","use_direct_icon_url","bool","CategoryStylePropType","line","layer","filter","draw","fill","symbol","CategoryItemPropType","key","title","group","order","checked","style","MFBanDoSo","constructor","props","_appliedGeojsonStyle","componentDidMount","_syncGeojsonStyle","componentDidUpdate","prevProps","prevState","mapReadyChanged","isReady","state","mapStyleChanged","mapStyle","sourceUrlChanged","sourceUrl","itemsChanged","items","geojsonStyle","_runCommand","propTypes","isRequired"],"sources":["MFBanDoSo.js"],"sourcesContent":["import PropTypes from 'prop-types';\r\nimport { MFMapView } from './MFMapView';\r\nimport {\r\n buildGeojsonStyle,\r\n createCategoryItemsSignature,\r\n} from './internal/GeojsonStyleUtils';\r\n\r\nconst FilterStylePropType = PropTypes.shape({\r\n kind: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.arrayOf(PropTypes.string),\r\n ]),\r\n kind_detail: PropTypes.oneOfType([\r\n PropTypes.string,\r\n PropTypes.arrayOf(PropTypes.string),\r\n ]),\r\n});\r\n\r\nconst DrawLinePropType = PropTypes.shape({\r\n color: PropTypes.string,\r\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\r\n});\r\n\r\nconst DrawFillPropType = PropTypes.shape({\r\n color: PropTypes.string,\r\n});\r\n\r\nconst DrawSymbolPropType = PropTypes.shape({\r\n icon_image: PropTypes.string,\r\n icon_index: PropTypes.number,\r\n icon_color: PropTypes.string,\r\n use_direct_icon_url: PropTypes.bool,\r\n});\r\n\r\nconst CategoryStylePropType = PropTypes.shape({\r\n line: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n layer: PropTypes.string,\r\n filter: FilterStylePropType,\r\n draw: DrawLinePropType,\r\n })\r\n ),\r\n fill: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n layer: PropTypes.string,\r\n filter: FilterStylePropType,\r\n draw: DrawFillPropType,\r\n })\r\n ),\r\n symbol: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n layer: PropTypes.string,\r\n filter: FilterStylePropType,\r\n draw: DrawSymbolPropType,\r\n })\r\n ),\r\n});\r\n\r\nconst CategoryItemPropType = PropTypes.shape({\r\n key: PropTypes.string,\r\n title: PropTypes.string,\r\n group: PropTypes.string,\r\n order: PropTypes.number,\r\n checked: PropTypes.bool,\r\n style: CategoryStylePropType,\r\n});\r\n\r\nclass MFBanDoSo extends MFMapView {\r\n constructor(props) {\r\n super(props);\r\n this._appliedGeojsonStyle = null;\r\n }\r\n\r\n componentDidMount() {\r\n this._syncGeojsonStyle();\r\n }\r\n\r\n componentDidUpdate(prevProps, prevState) {\r\n const mapReadyChanged = prevState.isReady !== this.state.isReady;\r\n const mapStyleChanged = prevProps.mapStyle !== this.props.mapStyle;\r\n const sourceUrlChanged = prevProps.sourceUrl !== this.props.sourceUrl;\r\n const itemsChanged =\r\n createCategoryItemsSignature(prevProps.items) !==\r\n createCategoryItemsSignature(this.props.items);\r\n\r\n if (\r\n mapReadyChanged ||\r\n mapStyleChanged ||\r\n sourceUrlChanged ||\r\n itemsChanged\r\n ) {\r\n this._syncGeojsonStyle();\r\n }\r\n }\r\n\r\n _syncGeojsonStyle() {\r\n if (!this.state.isReady) {\r\n return;\r\n }\r\n\r\n const items = this.props.items || [];\r\n\r\n const geojsonStyle = buildGeojsonStyle(\r\n this.props.mapStyle,\r\n this.props.sourceUrl,\r\n items\r\n );\r\n\r\n if (!geojsonStyle || geojsonStyle === this._appliedGeojsonStyle) {\r\n return;\r\n }\r\n\r\n this._appliedGeojsonStyle = geojsonStyle;\r\n this._runCommand('setMapStyle', [geojsonStyle]);\r\n }\r\n}\r\n\r\nMFBanDoSo.propTypes = {\r\n ...MFMapView.propTypes,\r\n items: PropTypes.arrayOf(CategoryItemPropType),\r\n sourceUrl: PropTypes.string.isRequired,\r\n};\r\n\r\nexport { MFBanDoSo };\r\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SACEC,iBADF,EAEEC,4BAFF,QAGO,8BAHP;AAKA,MAAMC,mBAAmB,GAAGJ,SAAS,CAACK,KAAV,CAAgB;EAC1CC,IAAI,EAAEN,SAAS,CAACO,SAAV,CAAoB,CACxBP,SAAS,CAACQ,MADc,EAExBR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACQ,MAA5B,CAFwB,CAApB,CADoC;EAK1CE,WAAW,EAAEV,SAAS,CAACO,SAAV,CAAoB,CAC/BP,SAAS,CAACQ,MADqB,EAE/BR,SAAS,CAACS,OAAV,CAAkBT,SAAS,CAACQ,MAA5B,CAF+B,CAApB;AAL6B,CAAhB,CAA5B;AAWA,MAAMG,gBAAgB,GAAGX,SAAS,CAACK,KAAV,CAAgB;EACvCO,KAAK,EAAEZ,SAAS,CAACQ,MADsB;EAEvCK,KAAK,EAAEb,SAAS,CAACO,SAAV,CAAoB,CAACP,SAAS,CAACc,MAAX,EAAmBd,SAAS,CAACe,KAA7B,CAApB;AAFgC,CAAhB,CAAzB;AAKA,MAAMC,gBAAgB,GAAGhB,SAAS,CAACK,KAAV,CAAgB;EACvCO,KAAK,EAAEZ,SAAS,CAACQ;AADsB,CAAhB,CAAzB;AAIA,MAAMS,kBAAkB,GAAGjB,SAAS,CAACK,KAAV,CAAgB;EACzCa,UAAU,EAAElB,SAAS,CAACQ,MADmB;EAEzCW,UAAU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AAT"}
|
|
@@ -3,74 +3,74 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
|
|
6
|
-
import { requireNativeComponent, Platform, NativeModules, findNodeHandle } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
6
|
+
import { requireNativeComponent, Platform, UIManager, NativeModules, findNodeHandle } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
7
7
|
|
|
8
8
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
9
9
|
const propTypes = { ...viewPropTypes,
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* The name of the building.
|
|
11
|
+
/**
|
|
12
|
+
* The name of the building.
|
|
13
13
|
*/
|
|
14
14
|
name: PropTypes.string,
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* The position of the building
|
|
16
|
+
/**
|
|
17
|
+
* The position of the building
|
|
18
18
|
*/
|
|
19
19
|
coordinate: PropTypes.shape({
|
|
20
|
-
/**
|
|
21
|
-
* Position for the building.
|
|
20
|
+
/**
|
|
21
|
+
* Position for the building.
|
|
22
22
|
*/
|
|
23
23
|
latitude: PropTypes.number.isRequired,
|
|
24
24
|
longitude: PropTypes.number.isRequired
|
|
25
25
|
}),
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* The model URL for the building.
|
|
27
|
+
/**
|
|
28
|
+
* The model URL for the building.
|
|
29
29
|
*/
|
|
30
30
|
modelUrl: PropTypes.string,
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* The texture URL for the building.
|
|
32
|
+
/**
|
|
33
|
+
* The texture URL for the building.
|
|
34
34
|
*/
|
|
35
35
|
textureUrl: PropTypes.string,
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* The scale of the building.
|
|
37
|
+
/**
|
|
38
|
+
* The scale of the building.
|
|
39
39
|
*/
|
|
40
40
|
scale: PropTypes.number,
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* The bearing of the building.
|
|
42
|
+
/**
|
|
43
|
+
* The bearing of the building.
|
|
44
44
|
*/
|
|
45
45
|
bearing: PropTypes.number,
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* The elevation of the building.
|
|
47
|
+
/**
|
|
48
|
+
* The elevation of the building.
|
|
49
49
|
*/
|
|
50
50
|
elevation: PropTypes.number,
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* Is the building selectable by the user ?
|
|
52
|
+
/**
|
|
53
|
+
* Is the building selectable by the user ?
|
|
54
54
|
*/
|
|
55
55
|
selected: PropTypes.bool,
|
|
56
56
|
|
|
57
|
-
/**
|
|
58
|
-
* touchable
|
|
57
|
+
/**
|
|
58
|
+
* touchable
|
|
59
59
|
*/
|
|
60
60
|
touchable: PropTypes.bool,
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
* visible
|
|
62
|
+
/**
|
|
63
|
+
* visible
|
|
64
64
|
*/
|
|
65
65
|
visible: PropTypes.bool,
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* userData
|
|
67
|
+
/**
|
|
68
|
+
* userData
|
|
69
69
|
*/
|
|
70
70
|
userData: PropTypes.object,
|
|
71
71
|
|
|
72
|
-
/**
|
|
73
|
-
* Callback that is called when the user presses on the building
|
|
72
|
+
/**
|
|
73
|
+
* Callback that is called when the user presses on the building
|
|
74
74
|
*/
|
|
75
75
|
onPress: PropTypes.func
|
|
76
76
|
};
|
|
@@ -133,8 +133,20 @@ class MFBuilding extends React.Component {
|
|
|
133
133
|
_runCommand(name, args) {
|
|
134
134
|
switch (Platform.OS) {
|
|
135
135
|
case 'android':
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
{
|
|
137
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const commandId = this._uiManagerCommand(name);
|
|
142
|
+
|
|
143
|
+
if (commandId == null) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
138
150
|
|
|
139
151
|
case 'ios':
|
|
140
152
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -147,16 +159,22 @@ class MFBuilding extends React.Component {
|
|
|
147
159
|
}
|
|
148
160
|
|
|
149
161
|
_uiManagerCommand(name) {
|
|
150
|
-
const
|
|
162
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
151
163
|
const componentName = "RMFBuilding";
|
|
152
164
|
|
|
153
|
-
if (!
|
|
165
|
+
if (!uiManager) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (!uiManager.getViewManagerConfig) {
|
|
154
170
|
// RN < 0.58
|
|
155
|
-
|
|
171
|
+
const legacyConfig = uiManager[componentName];
|
|
172
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
156
173
|
} // RN >= 0.58
|
|
157
174
|
|
|
158
175
|
|
|
159
|
-
|
|
176
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
177
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
160
178
|
}
|
|
161
179
|
|
|
162
180
|
_mapManagerCommand(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PropTypes","ViewPropTypes","requireNativeComponent","Platform","NativeModules","findNodeHandle","viewPropTypes","View","propTypes","name","string","coordinate","shape","latitude","number","isRequired","longitude","modelUrl","textureUrl","scale","bearing","elevation","selected","bool","touchable","visible","userData","object","onPress","func","MFBuilding","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","building","setName","_runCommand","setScale","setBearing","setElevation","setSelected","setTouchable","setVisible","setUserData","_getHandle","args","OS","
|
|
1
|
+
{"version":3,"names":["React","PropTypes","ViewPropTypes","requireNativeComponent","Platform","UIManager","NativeModules","findNodeHandle","viewPropTypes","View","propTypes","name","string","coordinate","shape","latitude","number","isRequired","longitude","modelUrl","textureUrl","scale","bearing","elevation","selected","bool","touchable","visible","userData","object","onPress","func","MFBuilding","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","building","setName","_runCommand","setScale","setBearing","setElevation","setSelected","setTouchable","setVisible","setUserData","_getHandle","args","OS","dispatchViewManagerCommand","commandId","_uiManagerCommand","_mapManagerCommand","uiManager","componentName","getViewManagerConfig","legacyConfig","Commands","config","render","RMFBuilding"],"sources":["MFBuilding.js"],"sourcesContent":["import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport {ViewPropTypes} from 'deprecated-react-native-prop-types';\r\nimport {\r\n requireNativeComponent,\r\n Platform,\r\n UIManager,\r\n NativeModules,\r\n findNodeHandle\r\n} from 'react-native';\r\n\r\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\r\nconst viewPropTypes = ViewPropTypes || View.propTypes;\r\n\r\nconst propTypes = {\r\n ...viewPropTypes,\r\n\r\n /**\r\n * The name of the building.\r\n */\r\n name: PropTypes.string,\r\n\r\n /**\r\n * The position of the building\r\n */\r\n coordinate: PropTypes.shape({\r\n /**\r\n * Position for the building.\r\n */\r\n latitude: PropTypes.number.isRequired,\r\n longitude: PropTypes.number.isRequired,\r\n }),\r\n\r\n /**\r\n * The model URL for the building.\r\n */\r\n modelUrl: PropTypes.string,\r\n\r\n /**\r\n * The texture URL for the building.\r\n */\r\n textureUrl: PropTypes.string,\r\n\r\n /**\r\n * The scale of the building.\r\n */\r\n scale: PropTypes.number,\r\n\r\n /**\r\n * The bearing of the building.\r\n */\r\n bearing: PropTypes.number,\r\n\r\n /**\r\n * The elevation of the building.\r\n */\r\n elevation: PropTypes.number,\r\n\r\n /**\r\n * Is the building selectable by the user ?\r\n */\r\n selected: PropTypes.bool,\r\n\r\n /**\r\n * touchable\r\n */\r\n touchable: PropTypes.bool,\r\n\r\n /**\r\n * visible\r\n */\r\n visible: PropTypes.bool,\r\n\r\n /**\r\n * userData\r\n */\r\n userData:PropTypes.object,\r\n\r\n /**\r\n * Callback that is called when the user presses on the building\r\n */\r\n onPress: PropTypes.func,\r\n};\r\n\r\n\r\nclass MFBuilding extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this._onPress = this._onPress.bind(this)\r\n this._ref = this._ref.bind(this)\r\n }\r\n\r\n _onPress(event) {\r\n event.stopPropagation();\r\n if (this.props.onPress) {\r\n this.props.onPress(event);\r\n }\r\n }\r\n\r\n _ref(ref) {\r\n this.building = ref;\r\n }\r\n\r\n setName(name) {\r\n this._runCommand(\"setName\", [name])\r\n }\r\n\r\n setScale(scale) {\r\n this._runCommand(\"setScale\", [scale])\r\n }\r\n\r\n setBearing(bearing) {\r\n this._runCommand(\"setBearing\", [bearing])\r\n }\r\n\r\n setElevation(elevation) {\r\n this._runCommand(\"setElevation\", [elevation])\r\n }\r\n\r\n setSelected(selected) {\r\n this._runCommand(\"setSelected\", [selected])\r\n }\r\n\r\n setTouchable(touchable) {\r\n this._runCommand(\"setTouchable\", [touchable])\r\n }\r\n\r\n setVisible(visible) {\r\n this._runCommand(\"setVisible\", [visible])\r\n }\r\n\r\n setUserData(userData) {\r\n this._runCommand(\"setUserData\", [userData])\r\n }\r\n\r\n _getHandle() {\r\n return findNodeHandle(this.building);\r\n }\r\n\r\n _runCommand(name, args) {\r\n switch (Platform.OS) {\r\n case 'android': {\r\n if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {\r\n return;\r\n }\r\n\r\n const commandId = this._uiManagerCommand(name);\r\n if (commandId == null) {\r\n return;\r\n }\r\n\r\n UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);\r\n break;\r\n }\r\n\r\n case 'ios':\r\n this._mapManagerCommand(name)(this._getHandle(), ...args);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n _uiManagerCommand(name) {\r\n const uiManager = UIManager || NativeModules.UIManager;\r\n const componentName = \"RMFBuilding\";\r\n\r\n if (!uiManager) {\r\n return null;\r\n }\r\n\r\n if (!uiManager.getViewManagerConfig) {\r\n // RN < 0.58\r\n const legacyConfig = uiManager[componentName];\r\n return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;\r\n }\r\n\r\n // RN >= 0.58\r\n const config = uiManager.getViewManagerConfig(componentName);\r\n return config && config.Commands ? config.Commands[name] : null;\r\n }\r\n\r\n _mapManagerCommand(name) {\r\n return NativeModules[`RMFBuilding`][name];\r\n }\r\n\r\n render() {\r\n return <RMFBuilding\r\n {...this.props}\r\n ref={this._ref}\r\n onPress={this._onPress}\r\n />;\r\n }\r\n}\r\n\r\nMFBuilding.propTypes = propTypes;\r\n\r\nvar RMFBuilding = requireNativeComponent(`RMFBuilding`, MFBuilding);\r\n\r\nexport { MFBuilding }"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAAQC,aAAR,QAA4B,oCAA5B;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,aAJF,EAKEC,cALF,QAMO,cANP,C,CAQA;;AACA,MAAMC,aAAa,GAAGN,aAAa,IAAIO,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;AACF;AACA;EACEG,IAAI,EAAEV,SAAS,CAACW,MANA;;EAQhB;AACF;AACA;EACEC,UAAU,EAAEZ,SAAS,CAACa,KAAV,CAAgB;IAC1B;AACJ;AACA;IACIC,QAAQ,EAAEd,SAAS,CAACe,MAAV,CAAiBC,UAJD;IAK1BC,SAAS,EAAEjB,SAAS,CAACe,MAAV,CAAiBC;EALF,CAAhB,CAXI;;EAmBhB;AACF;AACA;EACEE,QAAQ,EAAElB,SAAS,CAACW,MAtBJ;;EAwBhB;AACF;AACA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DI,iBAAiB,CAAC9C,IAAD,EAAO;IACtB,MAAMgD,SAAS,GAAGtD,SAAS,IAAIC,aAAa,CAACD,SAA7C;IACA,MAAMuD,aAAa,GAAG,aAAtB;;IAEA,IAAI,CAACD,SAAL,EAAgB;MACd,OAAO,IAAP;IACD;;IAED,IAAI,CAACA,SAAS,CAACE,oBAAf,EAAqC;MACnC;MACA,MAAMC,YAAY,GAAGH,SAAS,CAACC,aAAD,CAA9B;MACA,OAAOE,YAAY,IAAIA,YAAY,CAACC,QAA7B,GAAwCD,YAAY,CAACC,QAAb,CAAsBpD,IAAtB,CAAxC,GAAsE,IAA7E;IACD,CAZqB,CActB;;;IACA,MAAMqD,MAAM,GAAGL,SAAS,CAACE,oBAAV,CAA+BD,aAA/B,CAAf;IACA,OAAOI,MAAM,IAAIA,MAAM,CAACD,QAAjB,GAA4BC,MAAM,CAACD,QAAP,CAAgBpD,IAAhB,CAA5B,GAAoD,IAA3D;EACD;;EAED+C,kBAAkB,CAAC/C,IAAD,EAAO;IACvB,OAAOL,aAAa,CAAE,aAAF,CAAb,CAA6BK,IAA7B,CAAP;EACD;;EAEDsD,MAAM,GAAG;IACP,oBAAO,oBAAC,WAAD,eACD,KAAK9B,KADJ;MAEL,GAAG,EAAE,KAAKG,IAFL;MAGL,OAAO,EAAE,KAAKF;IAHT,GAAP;EAKD;;AA5GsC;;AA+GzCJ,UAAU,CAACtB,SAAX,GAAuBA,SAAvB;AAEA,IAAIwD,WAAW,GAAG/D,sBAAsB,CAAE,aAAF,EAAgB6B,UAAhB,CAAxC;AAEA,SAASA,UAAT"}
|
|
@@ -3,59 +3,59 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { ViewPropTypes, ColorPropType } from 'deprecated-react-native-prop-types';
|
|
6
|
-
import { requireNativeComponent, Platform, NativeModules, findNodeHandle, processColor } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
6
|
+
import { requireNativeComponent, Platform, UIManager, NativeModules, findNodeHandle, processColor } from 'react-native'; // if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
7
7
|
|
|
8
8
|
const viewPropTypes = ViewPropTypes || View.propTypes;
|
|
9
9
|
const propTypes = { ...viewPropTypes,
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* The coordinate of the center of the circle
|
|
11
|
+
/**
|
|
12
|
+
* The coordinate of the center of the circle
|
|
13
13
|
*/
|
|
14
14
|
center: PropTypes.shape({
|
|
15
|
-
/**
|
|
16
|
-
* Coordinates for the center of the circle.
|
|
15
|
+
/**
|
|
16
|
+
* Coordinates for the center of the circle.
|
|
17
17
|
*/
|
|
18
18
|
latitude: PropTypes.number.isRequired,
|
|
19
19
|
longitude: PropTypes.number.isRequired
|
|
20
20
|
}).isRequired,
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* The radius of the circle to be drawn (in meters)
|
|
22
|
+
/**
|
|
23
|
+
* The radius of the circle to be drawn (in meters)
|
|
24
24
|
*/
|
|
25
25
|
radius: PropTypes.number.isRequired,
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* The stroke width to use for the circle.
|
|
27
|
+
/**
|
|
28
|
+
* The stroke width to use for the circle.
|
|
29
29
|
*/
|
|
30
30
|
strokeWidth: PropTypes.number,
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
* The stroke color to use for the circle.
|
|
32
|
+
/**
|
|
33
|
+
* The stroke color to use for the circle.
|
|
34
34
|
*/
|
|
35
35
|
strokeColor: ColorPropType,
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* The fill color to use for the circle.
|
|
37
|
+
/**
|
|
38
|
+
* The fill color to use for the circle.
|
|
39
39
|
*/
|
|
40
40
|
fillColor: ColorPropType,
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* zIndex
|
|
42
|
+
/**
|
|
43
|
+
* zIndex
|
|
44
44
|
*/
|
|
45
45
|
zIndex: PropTypes.number,
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* visible
|
|
47
|
+
/**
|
|
48
|
+
* visible
|
|
49
49
|
*/
|
|
50
50
|
visible: PropTypes.bool,
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* userData
|
|
52
|
+
/**
|
|
53
|
+
* userData
|
|
54
54
|
*/
|
|
55
55
|
userData: PropTypes.object,
|
|
56
56
|
|
|
57
|
-
/**
|
|
58
|
-
* Callback that is called when the user presses on the circle
|
|
57
|
+
/**
|
|
58
|
+
* Callback that is called when the user presses on the circle
|
|
59
59
|
*/
|
|
60
60
|
onPress: PropTypes.func
|
|
61
61
|
}; // const defaultProps = {
|
|
@@ -109,8 +109,20 @@ class MFCircle extends React.Component {
|
|
|
109
109
|
_runCommand(name, args) {
|
|
110
110
|
switch (Platform.OS) {
|
|
111
111
|
case 'android':
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
{
|
|
113
|
+
if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const commandId = this._uiManagerCommand(name);
|
|
118
|
+
|
|
119
|
+
if (commandId == null) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
114
126
|
|
|
115
127
|
case 'ios':
|
|
116
128
|
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
@@ -123,16 +135,22 @@ class MFCircle extends React.Component {
|
|
|
123
135
|
}
|
|
124
136
|
|
|
125
137
|
_uiManagerCommand(name) {
|
|
126
|
-
const
|
|
138
|
+
const uiManager = UIManager || NativeModules.UIManager;
|
|
127
139
|
const componentName = "RMFCircle";
|
|
128
140
|
|
|
129
|
-
if (!
|
|
141
|
+
if (!uiManager) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (!uiManager.getViewManagerConfig) {
|
|
130
146
|
// RN < 0.58
|
|
131
|
-
|
|
147
|
+
const legacyConfig = uiManager[componentName];
|
|
148
|
+
return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;
|
|
132
149
|
} // RN >= 0.58
|
|
133
150
|
|
|
134
151
|
|
|
135
|
-
|
|
152
|
+
const config = uiManager.getViewManagerConfig(componentName);
|
|
153
|
+
return config && config.Commands ? config.Commands[name] : null;
|
|
136
154
|
}
|
|
137
155
|
|
|
138
156
|
_mapManagerCommand(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PropTypes","React","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","center","shape","latitude","number","isRequired","longitude","radius","strokeWidth","strokeColor","fillColor","zIndex","visible","bool","userData","object","onPress","func","MFCircle","Component","constructor","props","_onPress","bind","_ref","setCenter","_runCommand","setRadius","setFillColor","color","setStrokeColor","setStrokeWidth","width","setUserData","setZIndex","setVisible","_getHandle","circle","name","args","OS","
|
|
1
|
+
{"version":3,"names":["PropTypes","React","ViewPropTypes","ColorPropType","requireNativeComponent","Platform","UIManager","NativeModules","findNodeHandle","processColor","viewPropTypes","View","propTypes","center","shape","latitude","number","isRequired","longitude","radius","strokeWidth","strokeColor","fillColor","zIndex","visible","bool","userData","object","onPress","func","MFCircle","Component","constructor","props","_onPress","bind","_ref","setCenter","_runCommand","setRadius","setFillColor","color","setStrokeColor","setStrokeWidth","width","setUserData","setZIndex","setVisible","_getHandle","circle","name","args","OS","dispatchViewManagerCommand","commandId","_uiManagerCommand","_mapManagerCommand","uiManager","componentName","getViewManagerConfig","legacyConfig","Commands","config","event","stopPropagation","ref","render","RMFCircle"],"sources":["MFCircle.js"],"sourcesContent":["import PropTypes from 'prop-types';\r\nimport React from 'react';\r\nimport {ViewPropTypes, ColorPropType} from 'deprecated-react-native-prop-types';\r\nimport {\r\n requireNativeComponent,\r\n Platform,\r\n UIManager,\r\n NativeModules,\r\n findNodeHandle,\r\n processColor\r\n} from 'react-native';\r\n\r\n// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)\r\nconst viewPropTypes = ViewPropTypes || View.propTypes;\r\n\r\nconst propTypes = {\r\n ...viewPropTypes,\r\n\r\n /**\r\n * The coordinate of the center of the circle\r\n */\r\n center: PropTypes.shape({\r\n /**\r\n * Coordinates for the center of the circle.\r\n */\r\n latitude: PropTypes.number.isRequired,\r\n longitude: PropTypes.number.isRequired,\r\n }).isRequired,\r\n\r\n /**\r\n * The radius of the circle to be drawn (in meters)\r\n */\r\n radius: PropTypes.number.isRequired,\r\n\r\n /**\r\n * The stroke width to use for the circle.\r\n */\r\n strokeWidth: PropTypes.number,\r\n\r\n /**\r\n * The stroke color to use for the circle.\r\n */\r\n strokeColor: ColorPropType,\r\n\r\n /**\r\n * The fill color to use for the circle.\r\n */\r\n fillColor: ColorPropType,\r\n\r\n /**\r\n * zIndex\r\n */\r\n zIndex: PropTypes.number,\r\n\r\n /**\r\n * visible\r\n */\r\n visible: PropTypes.bool,\r\n\r\n /**\r\n * userData\r\n */\r\n userData:PropTypes.object,\r\n\r\n /**\r\n * Callback that is called when the user presses on the circle\r\n */\r\n onPress: PropTypes.func,\r\n};\r\n\r\n// const defaultProps = {\r\n// strokeColor: '#000',\r\n// strokeWidth: 1,\r\n// };\r\n\r\nclass MFCircle extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this._onPress = this._onPress.bind(this)\r\n this._ref = this._ref.bind(this)\r\n }\r\n\r\n setCenter(center) {\r\n this._runCommand(\"setCenter\", [center])\r\n }\r\n setRadius(radius) {\r\n this._runCommand(\"setRadius\", [radius])\r\n }\r\n setFillColor(color) {\r\n this._runCommand(\"setFillColor\", [processColor(color)])\r\n }\r\n setStrokeColor(color) {\r\n this._runCommand(\"setStrokeColor\", [processColor(color)])\r\n }\r\n setStrokeWidth(width) {\r\n this._runCommand(\"setStrokeWidth\", [width])\r\n }\r\n setUserData(userData) {\r\n this._runCommand(\"setUserData\", [userData])\r\n }\r\n setZIndex(zIndex) {\r\n this._runCommand(\"setZIndex\", [zIndex])\r\n }\r\n setVisible(visible) {\r\n this._runCommand(\"setVisible\", [visible])\r\n }\r\n\r\n _getHandle() {\r\n return findNodeHandle(this.circle);\r\n }\r\n\r\n\r\n _runCommand(name, args) {\r\n switch (Platform.OS) {\r\n case 'android': {\r\n if (!UIManager || typeof UIManager.dispatchViewManagerCommand !== 'function') {\r\n return;\r\n }\r\n\r\n const commandId = this._uiManagerCommand(name);\r\n if (commandId == null) {\r\n return;\r\n }\r\n\r\n UIManager.dispatchViewManagerCommand(this._getHandle(), commandId, args);\r\n break;\r\n }\r\n\r\n case 'ios':\r\n this._mapManagerCommand(name)(this._getHandle(), ...args);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n _uiManagerCommand(name) {\r\n const uiManager = UIManager || NativeModules.UIManager;\r\n const componentName = \"RMFCircle\";\r\n\r\n if (!uiManager) {\r\n return null;\r\n }\r\n\r\n if (!uiManager.getViewManagerConfig) {\r\n // RN < 0.58\r\n const legacyConfig = uiManager[componentName];\r\n return legacyConfig && legacyConfig.Commands ? legacyConfig.Commands[name] : null;\r\n }\r\n\r\n // RN >= 0.58 \r\n const config = uiManager.getViewManagerConfig(componentName);\r\n return config && config.Commands ? config.Commands[name] : null;\r\n }\r\n \r\n _mapManagerCommand(name) {\r\n return NativeModules[`RMFCircle`][name];\r\n }\r\n\r\n _onPress(event) {\r\n event.stopPropagation();\r\n if (this.props.onPress) {\r\n this.props.onPress(event);\r\n }\r\n }\r\n\r\n _ref(ref) {\r\n this.circle = ref;\r\n }\r\n\r\n render() {\r\n return <RMFCircle\r\n {...this.props}\r\n ref={this._ref}\r\n onPress={this._onPress}\r\n />;\r\n }\r\n}\r\n\r\nMFCircle.propTypes = propTypes;\r\n// MFCircle.defaultProps = defaultProps;\r\n\r\nvar RMFCircle = requireNativeComponent(`RMFCircle`, MFCircle);\r\n\r\nexport {MFCircle}\r\n"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,aAAR,EAAuBC,aAAvB,QAA2C,oCAA3C;AACA,SACEC,sBADF,EAEEC,QAFF,EAGEC,SAHF,EAIEC,aAJF,EAKEC,cALF,EAMEC,YANF,QAOO,cAPP,C,CASA;;AACA,MAAMC,aAAa,GAAGR,aAAa,IAAIS,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGF,aADa;;EAGhB;AACF;AACA;EACEG,MAAM,EAAEb,SAAS,CAACc,KAAV,CAAgB;IACtB;AACJ;AACA;IACIC,QAAQ,EAAEf,SAAS,CAACgB,MAAV,CAAiBC,UAJL;IAKtBC,SAAS,EAAElB,SAAS,CAACgB,MAAV,CAAiBC;EALN,CAAhB,EAMLA,UAZa;;EAchB;AACF;AACA;EACEE,MAAM,EAAEnB,SAAS,CAACgB,MAAV,CAAiBC,UAjBT;;EAmBhB;AACF;AACA;EACEG,WAAW,EAAEpB,SAAS,CAACgB,MAtBP;;EAwBhB;AACF;AACA;EACEK,WAAW,EAAElB,aA3BG;;EA6BhB;AACF;AACA;EACEmB,SAAS,EAAEnB,aAhCK;;EAkChB;AACF;AACA;EACEoB,MAAM,EAAEvB,SAAS,CAACgB,MArCF;;EAuChB;AACF;AACA;EACEQ,OAAO,EAAExB,SAAS,CAACyB,IA1CH;;EA4ChB;AACF;AACA;EACEC,QAAQ,EAAC1B,SAAS,CAAC2B,MA/CH;;EAiDhB;AACF;AACA;EACEC,OAAO,EAAE5B,SAAS,CAAC6B;AApDH,CAAlB,C,CAuDA;AACA;AACA;AACA;;AAEA,MAAMC,QAAN,SAAuB7B,KAAK,CAAC8B,SAA7B,CAAuC;EACrCC,WAAW,CAACC,KAAD,EAAQ;IACjB,MAAMA,KAAN;IACA,KAAKC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