react-native-map4d-map-dtqg 0.1.2 → 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 -133
- 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/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 -508
- 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 +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 +69 -69
- 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 +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 +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 +69 -69
- 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 +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 +187 -187
- package/src/components/MFCircle.js +173 -173
- package/src/components/MFDirectionsRenderer.js +237 -237
- package/src/components/MFMapView.js +464 -464
- 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 -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
- 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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
|
@@ -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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BC;MAAtB,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,CA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4B+C,IAA5B,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,O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AGlD,aAAa,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"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { AreaFocusSession } from './area/AreaFocusSession';
|
|
2
2
|
import { ProvinceArea, IndustrialEconomicArea } from './area/AreaFocusAreas';
|
|
3
3
|
import { IndustrialEconomicType } from './area/AreaFocusTypes';
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {'normal' | 'highlight'} FocusDisplay
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {'normal' | 'highlight'} FocusDisplay
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {{left?: number, right?: number, top?: number, bottom?: number}} FocusPadding
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {{left?: number, right?: number, top?: number, bottom?: number}} FocusPadding
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* @typedef {'province' | 'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel' | number} FocusType
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {'province' | 'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel' | number} FocusType
|
|
14
14
|
*/
|
|
15
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
|
|
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
23
|
*/
|
|
24
24
|
|
|
25
25
|
const VIETNAM_MAINLAND_BOUNDS = {
|
|
@@ -86,9 +86,9 @@ export class AreaFocusManager {
|
|
|
86
86
|
padding: options ? options.padding : undefined
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
/**
|
|
90
|
-
* @param {FocusOptions | null | undefined} focusOptions
|
|
91
|
-
* @returns {Promise<AreaFocusSession | null>}
|
|
89
|
+
/**
|
|
90
|
+
* @param {FocusOptions | null | undefined} focusOptions
|
|
91
|
+
* @returns {Promise<AreaFocusSession | null>}
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
|
|
@@ -1 +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'\r\nimport {ProvinceArea, IndustrialEconomicArea} from './area/AreaFocusAreas'\r\nimport {IndustrialEconomicType} from './area/AreaFocusTypes'\r\n\r\n/**\r\n * @typedef {'normal' | 'highlight'} FocusDisplay\r\n */\r\n\r\n/**\r\n * @typedef {{left?: number, right?: number, top?: number, bottom?: number}} FocusPadding\r\n */\r\n\r\n/**\r\n * @typedef {'province' | 'industrialZone' | 'economicZone' | 'ecoIndustrialZone' | 'freeTradeZone' | 'nonTariffZone' | 'otherZoneModel' | number} FocusType\r\n */\r\n\r\n/**\r\n * @typedef {Object} FocusOptions\r\n * @property {FocusType} type\r\n * @property {number=} id\r\n * @property {string=} name\r\n * @property {FocusDisplay=} display\r\n * @property {FocusPadding=} padding\r\n */\r\n\r\nconst VIETNAM_MAINLAND_BOUNDS = {\r\n minLat: 8.18,\r\n minLng: 102.14,\r\n maxLat: 23.4,\r\n maxLng: 109.47,\r\n}\r\n\r\nconst FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE = {\r\n industrialZone: IndustrialEconomicType.INDUSTRIAL_ZONE,\r\n economicZone: IndustrialEconomicType.ECONOMIC_ZONE,\r\n ecoIndustrialZone: IndustrialEconomicType.ECO_INDUSTRIAL_ZONE,\r\n freeTradeZone: IndustrialEconomicType.FREE_TRADE_ZONE,\r\n nonTariffZone: IndustrialEconomicType.NON_TARIFF_ZONE,\r\n otherZoneModel: IndustrialEconomicType.OTHER_ZONE_MODEL,\r\n}\r\n\r\nexport class AreaFocusManager {\r\n constructor(mapView) {\r\n this.mapView = mapView\r\n this.currentSession = null\r\n }\r\n\r\n async _focusArea(area, options) {\r\n this.clear()\r\n\r\n if (!area) {\r\n return null\r\n }\r\n\r\n try {\r\n if (!(await area.load())) {\r\n return null\r\n }\r\n\r\n const focusOptions = {...(options || {})}\r\n const bounds = area.getBounds() || VIETNAM_MAINLAND_BOUNDS\r\n\r\n this._fitBounds(bounds, focusOptions)\r\n\r\n this.currentSession = new AreaFocusSession(this.mapView, area, focusOptions)\r\n this.currentSession.render()\r\n\r\n return this.currentSession\r\n }\r\n catch (error) {\r\n console.error('Cannot focus area:', error)\r\n return null\r\n }\r\n }\r\n\r\n async _focusProvince(options) {\r\n const provinceId = this._getProvinceId(options)\r\n const provinceName = this._getProvinceName(options)\r\n\r\n if (provinceId == null && !provinceName) {\r\n this.clear()\r\n return null\r\n }\r\n\r\n const area = provinceId != null ? new ProvinceArea(provinceId) : ProvinceArea.fromName(provinceName)\r\n const display = options && options.display === 'highlight' ? 'highlight' : 'normal'\r\n\r\n return this._focusArea(area, {\r\n display,\r\n padding: options ? options.padding : undefined,\r\n })\r\n }\r\n\r\n /**\r\n * @param {FocusOptions | null | undefined} focusOptions\r\n * @returns {Promise<AreaFocusSession | null>}\r\n */\r\n async focus(focusOptions) {\r\n if (focusOptions == null) {\r\n this.clear()\r\n return null\r\n }\r\n\r\n if (focusOptions.type === 'province') {\r\n return this._focusProvince(focusOptions)\r\n }\r\n\r\n if (focusOptions.id == null) {\r\n console.warn('Focus options must include an id for non-province types:', focusOptions)\r\n this.clear()\r\n return null\r\n }\r\n\r\n const industrialEconomicType = this._getIndustrialEconomicType(focusOptions.type)\r\n\r\n if (industrialEconomicType != null) {\r\n return this._focusArea(new IndustrialEconomicArea(industrialEconomicType, focusOptions.id), {\r\n display: focusOptions.display,\r\n padding: focusOptions.padding,\r\n })\r\n }\r\n\r\n console.warn('Unsupported focus type:', focusOptions.type)\r\n return null\r\n }\r\n\r\n _getIndustrialEconomicType(type) {\r\n if (typeof type === 'number') {\r\n const values = Object.values(IndustrialEconomicType)\r\n return values.includes(type) ? type : null\r\n }\r\n\r\n if (typeof type !== 'string') {\r\n return null\r\n }\r\n\r\n return FOCUS_TYPE_TO_INDUSTRIAL_ECONOMIC_TYPE[type] || null\r\n }\r\n\r\n clear() {\r\n if (this.currentSession) {\r\n this.currentSession.destroy()\r\n this.currentSession = null\r\n }\r\n }\r\n\r\n _fitBounds(bounds, options) {\r\n if (!this.mapView || typeof this.mapView.fitBounds !== 'function' || !bounds) {\r\n return\r\n }\r\n\r\n this.mapView.fitBounds({\r\n bounds: {\r\n southWest: {\r\n latitude: bounds.minLat,\r\n longitude: bounds.minLng,\r\n },\r\n northEast: {\r\n latitude: bounds.maxLat,\r\n longitude: bounds.maxLng,\r\n },\r\n },\r\n padding: options ? options.padding : undefined,\r\n })\r\n }\r\n\r\n _getProvinceName(options) {\r\n if (options == null || typeof options !== 'object') {\r\n return null\r\n }\r\n\r\n if (typeof options.name === 'string') {\r\n const name = options.name.trim()\r\n return name.length > 0 ? name : null\r\n }\r\n\r\n const optionKeys = Object.keys(options)\r\n const unsupportedKeys = optionKeys.filter((key) => key !== 'type' && key !== 'id' && key !== 'name' && key !== 'display' && key !== 'padding')\r\n\r\n if (unsupportedKeys.length > 0) {\r\n console.warn(\r\n `[AreaFocusManager] focusProvince expects options like { type: 'province', name: 'Ha Noi', display: 'highlight' }. Unsupported keys: ${unsupportedKeys.join(', ')}`\r\n )\r\n }\r\n\r\n return null\r\n }\r\n\r\n _getProvinceId(options) {\r\n if (options == null || typeof options !== 'object') {\r\n return null\r\n }\r\n\r\n return typeof options.id === 'number' ? options.id : null\r\n }\r\n}\r\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,OAAL,GAAeA,OAAf;IACA,KAAKC,cAAL,GAAsB,IAAtB;EACD;;EAEe,MAAVC,UAAU,CAACC,IAAD,EAAOC,OAAP,EAAgB;IAC9B,KAAKC,KAAL;;IAEA,IAAI,CAACF,IAAL,EAAW;MACT,OAAO,IAAP;IACD;;IAED,IAAI;MACF,IAAI,EAAE,MAAMA,IAAI,CAACG,IAAL,EAAR,CAAJ,EAA0B;QACxB,OAAO,IAAP;MACD;;MAED,MAAMC,YAAY,GAAG,EAAC,IAAIH,OAAO,IAAI,EAAf;MAAD,CAArB;MACA,MAAMI,MAAM,GAAGL,IAAI,CAACM,SAAL,MAAoB7B,uBAAnC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AAmB,OAAOA,OAAP,KAAmB,QAA1C,EAAoD;MAClD,OAAO,IAAP;IACD;;IAED,OAAO,OAAOA,OAAO,CAACqB,EAAf,KAAsB,QAAtB,GAAiCrB,OAAO,CAACqB,EAAzC,GAA8C,IAArD;EACD;;AAzJ2B"}
|
|
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;;AA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or","areaFocusManager","_areaFocusManager","focusProvince","options","provinceName","_getProvinceName","shouldHighlight","_shouldHighlight","_clear","focus","type","name","display","clear","trim","optionKeys","Object","keys","unsupportedKeys","filter","key","length","console","warn","join","highlight"],"sources":["AreaFocuser.js"],"sourcesContent":["export class AreaFocuser {\
|
|
1
|
+
{"version":3,"names":["AreaFocuser","constructor","areaFocusManager","_areaFocusManager","focusProvince","options","provinceName","_getProvinceName","shouldHighlight","_shouldHighlight","_clear","focus","type","name","display","clear","trim","optionKeys","Object","keys","unsupportedKeys","filter","key","length","console","warn","join","highlight"],"sources":["AreaFocuser.js"],"sourcesContent":["export class AreaFocuser {\n\n constructor(areaFocusManager) {\n this._areaFocusManager = areaFocusManager\n }\n\n /**\n * @param {{name?: string, highlight?: boolean}=} options\n */\n async focusProvince(options) {\n const provinceName = this._getProvinceName(options)\n const shouldHighlight = this._shouldHighlight(options)\n\n if (!provinceName) {\n this._clear()\n return\n }\n\n if (this._areaFocusManager) {\n await this._areaFocusManager.focus({\n type: 'province',\n name: provinceName,\n display: shouldHighlight ? 'highlight' : 'normal',\n })\n }\n }\n\n _clear() {\n if (this._areaFocusManager) {\n this._areaFocusManager.clear()\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 return options.name.trim()\n }\n\n const optionKeys = Object.keys(options)\n const unsupportedKeys = optionKeys.filter((key) => key !== 'name' && key !== 'highlight')\n\n if (unsupportedKeys.length > 0) {\n console.warn(\n `[AreaFocuser] focusProvince expects options like { name: 'Ha Noi', highlight: true }. Unsupported keys: ${unsupportedKeys.join(', ')}`\n )\n }\n\n return null\n }\n\n _shouldHighlight(options) {\n if (options == null || typeof options !== 'object') {\n return false\n }\n\n return options.highlight === true\n }\n}"],"mappings":"AAAA,OAAO,MAAMA,WAAN,CAAkB;EAEvBC,WAAW,CAACC,gBAAD,EAAmB;IAC5B,KAAKC,iBAAL,GAAyBD,gBAAzB;EACD;EAED;AACF;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OA,OAAP,KAAmB,QAA1C,EAAoD;MAClD,OAAO,KAAP;IACD;;IAED,OAAOA,OAAO,CAACsB,SAAR,KAAsB,IAA7B;EACD;;AA5DsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BoundHelper","createEmptyBounds","minLat","Infinity","minLng","maxLat","maxLng","updateBounds","bounds","lat","lng","Math","min","max","isValidBounds"],"sources":["BoundHelper.js"],"sourcesContent":["class BoundHelper {\
|
|
1
|
+
{"version":3,"names":["BoundHelper","createEmptyBounds","minLat","Infinity","minLng","maxLat","maxLng","updateBounds","bounds","lat","lng","Math","min","max","isValidBounds"],"sources":["BoundHelper.js"],"sourcesContent":["class BoundHelper {\n static createEmptyBounds() {\n return {\n minLat: Infinity,\n minLng: Infinity,\n maxLat: -Infinity,\n maxLng: -Infinity,\n }\n }\n\n static updateBounds(bounds, lat, lng) {\n bounds.minLat = Math.min(bounds.minLat, lat)\n bounds.minLng = Math.min(bounds.minLng, lng)\n bounds.maxLat = Math.max(bounds.maxLat, lat)\n bounds.maxLng = Math.max(bounds.maxLng, lng)\n }\n\n static isValidBounds(bounds) {\n if (!bounds) {\n return false\n }\n\n return !(\n bounds.minLat === Infinity ||\n bounds.minLng === Infinity ||\n bounds.maxLat === -Infinity ||\n bounds.maxLng === -Infinity\n )\n }\n}\n\nexport {BoundHelper}"],"mappings":"AAAA,MAAMA,WAAN,CAAkB;EACQ,OAAjBC,iBAAiB,GAAG;IACzB,OAAO;MACLC,MAAM,EAAEC,QADH;MAELC,MAAM,EAAED,QAFH;MAGLE,MAAM,EAAE,CAACF,QAHJ;MAILG,MAAM,EAAE,CAACH;IAJJ,CAAP;EAMD;;EAEkB,OAAZI,YAAY,CAACC,MAAD,EAASC,GAAT,EAAcC,GAAd,EAAmB;IACpCF,MAAM,CAACN,MAAP,GAAgBS,IAAI,CAACC,GAAL,CAASJ,MAAM,CAACN,MAAhB,EAAwBO,GAAxB,CAAhB;IACAD,MAAM,CAACJ,MAAP,GAAgBO,IAAI,CAACC,GAAL,CAASJ,MAAM,CAACJ,MAAhB,EAAwBM,GAAxB,CAAhB;IACAF,MAAM,CAACH,MAAP,GAAgBM,IAAI,CAACE,GAAL,CAASL,MAAM,CAACH,MAAhB,EAAwBI,GAAxB,CAAhB;IACAD,MAAM,CAACF,MAAP,GAAgBK,IAAI,CAACE,GAAL,CAASL,MAAM,CAACF,MAAhB,EAAwBI,GAAxB,CAAhB;EACD;;EAEmB,OAAbI,aAAa,CAACN,MAAD,EAAS;IAC3B,IAAI,CAACA,MAAL,EAAa;MACX,OAAO,KAAP;IACD;;IAED,OAAO,EACLA,MAAM,CAACN,MAAP,KAAkBC,QAAlB,IACAK,MAAM,CAACJ,MAAP,KAAkBD,QADlB,IAEAK,MAAM,CAACH,MAAP,KAAkB,CAACF,QAFnB,IAGAK,MAAM,CAACF,MAAP,KAAkB,CAACH,QAJd,CAAP;EAMD;;AA5Be;;AA+BlB,SAAQH,WAAR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getViewboxFromGeometry","IndustrialEconomicType","INDUSTRIAL_ECONOMIC_PATH_BY_TYPE","INDUSTRIAL_ZONE","ECONOMIC_ZONE","ECO_INDUSTRIAL_ZONE","FREE_TRADE_ZONE","NON_TARIFF_ZONE","OTHER_ZONE_MODEL","BDS_API_BASE_URL","ProvinceArea","constructor","id","name","loaded","geometryData","bounds","fromName","area","load","hasValidId","hasValidName","trim","normalizedName","url","encodeURIComponent","response","fetch","ok","data","json","success","console","error","message","areaData","geometry","getGeometryData","getBounds","getId","IndustrialEconomicArea","type","pathSegment","status","statusText"],"sources":["AreaFocusAreas.js"],"sourcesContent":["import {getViewboxFromGeometry} from './AreaFocusGeometryUtils'\
|
|
1
|
+
{"version":3,"names":["getViewboxFromGeometry","IndustrialEconomicType","INDUSTRIAL_ECONOMIC_PATH_BY_TYPE","INDUSTRIAL_ZONE","ECONOMIC_ZONE","ECO_INDUSTRIAL_ZONE","FREE_TRADE_ZONE","NON_TARIFF_ZONE","OTHER_ZONE_MODEL","BDS_API_BASE_URL","ProvinceArea","constructor","id","name","loaded","geometryData","bounds","fromName","area","load","hasValidId","hasValidName","trim","normalizedName","url","encodeURIComponent","response","fetch","ok","data","json","success","console","error","message","areaData","geometry","getGeometryData","getBounds","getId","IndustrialEconomicArea","type","pathSegment","status","statusText"],"sources":["AreaFocusAreas.js"],"sourcesContent":["import {getViewboxFromGeometry} from './AreaFocusGeometryUtils'\nimport {IndustrialEconomicType} from './AreaFocusTypes'\n\nconst INDUSTRIAL_ECONOMIC_PATH_BY_TYPE = {\n [IndustrialEconomicType.INDUSTRIAL_ZONE]: 'khu-cong-nghiep',\n [IndustrialEconomicType.ECONOMIC_ZONE]: 'khu-kinh-te',\n [IndustrialEconomicType.ECO_INDUSTRIAL_ZONE]: 'khu-cong-nghiep-sinh-thai',\n [IndustrialEconomicType.FREE_TRADE_ZONE]: 'khu-thuong-mai-tu-do',\n [IndustrialEconomicType.NON_TARIFF_ZONE]: 'khu-phi-thue-quan',\n [IndustrialEconomicType.OTHER_ZONE_MODEL]: 'mo-hinh-khu-khac',\n}\n\nconst BDS_API_BASE_URL = 'https://cmcdtqg-gateway.dieuhanhso.vn/staging'\n\nclass ProvinceArea {\n constructor(id) {\n this.id = id\n this.name = null\n this.loaded = false\n this.geometryData = null\n this.bounds = null\n }\n\n static fromName(name) {\n const area = new ProvinceArea(null)\n area.name = name\n return area\n }\n\n async load() {\n if (this.loaded) {\n return true\n }\n\n const hasValidId = typeof this.id === 'number'\n const hasValidName = typeof this.name === 'string' && this.name.trim() !== ''\n\n if (!hasValidId && !hasValidName) {\n return false\n }\n\n const normalizedName = hasValidName ? this.name.trim() : null\n const url = hasValidId\n ? `${BDS_API_BASE_URL}/bds/api/dmhc/TinhThanh/${this.id}/geometry`\n : `${BDS_API_BASE_URL}/bds/api/dmhc/TinhThanh/geometry?ten=${encodeURIComponent(normalizedName)}`\n\n const response = await fetch(url)\n\n if (!response.ok) {\n return false\n }\n\n const data = await response.json()\n\n if (!data.success) {\n console.error('Fetch province area data failed:', data.message)\n return false\n }\n\n const areaData = data.data\n const geometry = areaData && areaData.geometry ? areaData.geometry : null\n\n if (!geometry) {\n return false\n }\n\n this.geometryData = {\n name: areaData && areaData.name ? areaData.name : normalizedName,\n geometry,\n }\n this.bounds = getViewboxFromGeometry(geometry)\n this.loaded = true\n\n return true\n }\n\n getGeometryData() {\n return this.geometryData\n }\n\n getBounds() {\n return this.bounds\n }\n\n getId() {\n return this.id != null ? this.id : `province-${this.name || 'unknown'}`\n }\n}\n\nclass IndustrialEconomicArea {\n constructor(type, id) {\n this.type = type\n this.id = id\n this.loaded = false\n this.geometryData = null\n this.bounds = null\n }\n\n async load() {\n if (this.loaded) {\n return true\n }\n\n if (typeof this.id !== 'number') {\n return false\n }\n\n const pathSegment = INDUSTRIAL_ECONOMIC_PATH_BY_TYPE[this.type]\n\n if (!pathSegment) {\n console.error('Unsupported industrial/economic area type:', this.type)\n return false\n }\n\n const url = `${BDS_API_BASE_URL}/bds/api/kcnkkt/${pathSegment}/${this.id}/geometry`\n\n const response = await fetch(url)\n\n if (!response.ok) {\n console.error('Failed to fetch industrial zone data:', response.status, response.statusText)\n return false\n }\n\n const data = await response.json()\n\n if (!data.success) {\n console.error('API returned error:', data.message)\n return false\n }\n\n const areaData = data.data\n const geometry = areaData && areaData.geometry ? areaData.geometry : null\n\n if (!geometry) {\n return false\n }\n\n this.geometryData = {\n name: areaData && areaData.name ? areaData.name : null,\n geometry,\n }\n this.bounds = getViewboxFromGeometry(geometry)\n this.loaded = true\n\n return true\n }\n\n getGeometryData() {\n return this.geometryData\n }\n\n getBounds() {\n return this.bounds\n }\n\n getId() {\n return this.id\n }\n}\n\nexport {\n ProvinceArea,\n IndustrialEconomicArea,\n}\n"],"mappings":"AAAA,SAAQA,sBAAR,QAAqC,0BAArC;AACA,SAAQC,sBAAR,QAAqC,kBAArC;AAEA,MAAMC,gCAAgC,GAAG;EACvC,CAACD,sBAAsB,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BuB;IAFkB,CAApB;IAIA,KAAKpB,MAAL,GAAchB,sBAAsB,CAACoC,QAAD,CAApC;IACA,KAAKtB,MAAL,GAAc,IAAd;IAEA,OAAO,IAAP;EACD;;EAEDuB,eAAe,GAAG;IAChB,OAAO,KAAKtB,YAAZ;EACD;;EAEDuB,SAAS,GAAG;IACV,OAAO,KAAKtB,MAAZ;EACD;;EAEDuB,KAAK,GAAG;IACN,OAAO,KAAK3B,EAAZ;EACD;;AApE0B;;AAuE7B,SACEF,YADF,EAEE8B,sBAFF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BoundHelper","WORLD_MASK_PATH","longitude","latitude","parseViewbox","viewbox","bounds","split","map","Number","length","minLat","minLng","maxLat","maxLng","isNaN","getViewboxFromGeometry","geometry","createEmptyBounds","updateBounds","coordinate","Array","isArray","lng","lat","type","coordinates","forEach","ring","polygon","isValidBounds","convertAndClosePath","path","coordinatePath","filter","point","firstPoint","lastPoint","areaGeometryToPolygonPaths","paths","push","polygonCoordinates","createWorldMaskPaths","holes"],"sources":["AreaFocusGeometryUtils.js"],"sourcesContent":["import {BoundHelper} from '../BoundHelper'\
|
|
1
|
+
{"version":3,"names":["BoundHelper","WORLD_MASK_PATH","longitude","latitude","parseViewbox","viewbox","bounds","split","map","Number","length","minLat","minLng","maxLat","maxLng","isNaN","getViewboxFromGeometry","geometry","createEmptyBounds","updateBounds","coordinate","Array","isArray","lng","lat","type","coordinates","forEach","ring","polygon","isValidBounds","convertAndClosePath","path","coordinatePath","filter","point","firstPoint","lastPoint","areaGeometryToPolygonPaths","paths","push","polygonCoordinates","createWorldMaskPaths","holes"],"sources":["AreaFocusGeometryUtils.js"],"sourcesContent":["import {BoundHelper} from '../BoundHelper'\n\nconst WORLD_MASK_PATH = [\n { longitude: -180, latitude: -90 },\n { longitude: 180, latitude: -90 },\n { longitude: 180, latitude: 90 },\n { longitude: -180, latitude: 90 },\n { longitude: -180, latitude: -90 },\n]\n\nfunction parseViewbox(viewbox) {\n const bounds = viewbox.split(',').map(Number)\n\n if (bounds.length != 4) {\n return null\n }\n\n const [minLat, minLng, maxLat, maxLng] = bounds\n\n if (\n Number.isNaN(minLat) ||\n Number.isNaN(minLng) ||\n Number.isNaN(maxLat) ||\n Number.isNaN(maxLng)\n ) {\n return null\n }\n\n return {\n minLat,\n minLng,\n maxLat,\n maxLng,\n }\n}\n\nfunction getViewboxFromGeometry(geometry) {\n if (!geometry || typeof geometry !== 'object') {\n return null\n }\n\n const bounds = BoundHelper.createEmptyBounds()\n\n const updateBounds = (coordinate) => {\n if (!Array.isArray(coordinate) || coordinate.length < 2) {\n return\n }\n\n const lng = coordinate[0]\n const lat = coordinate[1]\n\n if (Number.isNaN(lat) || Number.isNaN(lng)) {\n return\n }\n\n BoundHelper.updateBounds(bounds, lat, lng)\n }\n\n if (geometry.type === 'Polygon') {\n geometry.coordinates.forEach((ring) => {\n ring.forEach((coordinate) => {\n updateBounds(coordinate)\n })\n })\n }\n\n if (geometry.type === 'MultiPolygon') {\n geometry.coordinates.forEach((polygon) => {\n polygon.forEach((ring) => {\n ring.forEach((coordinate) => {\n updateBounds(coordinate)\n })\n })\n })\n }\n\n if (!BoundHelper.isValidBounds(bounds)) {\n return null\n }\n\n return bounds\n}\n\nfunction convertAndClosePath(path) {\n if (!Array.isArray(path) || path.length == 0) {\n return []\n }\n\n const coordinatePath = path\n .filter((point) => Array.isArray(point) && point.length >= 2)\n .map((point) => ({\n latitude: point[1],\n longitude: point[0],\n }))\n\n if (coordinatePath.length == 0) {\n return []\n }\n\n const firstPoint = coordinatePath[0]\n const lastPoint = coordinatePath[coordinatePath.length - 1]\n\n if (\n firstPoint.latitude == lastPoint.latitude &&\n firstPoint.longitude == lastPoint.longitude\n ) {\n return coordinatePath\n }\n\n return [\n ...coordinatePath,\n firstPoint,\n ]\n}\n\nfunction areaGeometryToPolygonPaths(geometry) {\n const paths = []\n\n if (!geometry || typeof geometry !== 'object') {\n return paths\n }\n\n if (geometry.type === 'Polygon') {\n if (Array.isArray(geometry.coordinates) && geometry.coordinates.length > 0) {\n const path = convertAndClosePath(geometry.coordinates[0])\n if (path.length > 0) {\n paths.push(path)\n }\n }\n return paths\n }\n\n if (geometry.type === 'MultiPolygon') {\n geometry.coordinates.forEach((polygonCoordinates) => {\n if (!Array.isArray(polygonCoordinates) || polygonCoordinates.length === 0) {\n return\n }\n\n const path = convertAndClosePath(polygonCoordinates[0])\n if (path.length > 0) {\n paths.push(path)\n }\n })\n }\n\n return paths\n}\n\nfunction createWorldMaskPaths(geometry) {\n const holes = areaGeometryToPolygonPaths(geometry)\n\n return [\n WORLD_MASK_PATH,\n ...holes,\n ]\n}\n\nexport {\n WORLD_MASK_PATH,\n parseViewbox,\n getViewboxFromGeometry,\n areaGeometryToPolygonPaths,\n createWorldMaskPaths,\n}\n"],"mappings":"AAAA,SAAQA,WAAR,QAA0B,gBAA1B;AAEA,MAAMC,eAAe,GAAG,CACtB;EAAEC,SAAS,EAAE,CAAC,GAAd;EAAmBC,QAAQ,EAAE,CAAC;AAA9B,CADsB,EAEtB;EAAED,SAAS,EAAE,GAAb;EAAkBC,QAAQ,EAAE,CAAC;AAA7B,CAFsB,EAGtB;EAAED,SAAS,EAAE,GAAb;EAAkBC,QAAQ,EAAE;AAA5B,CAHsB,EAItB;EAAED,SAAS,EAAE,CAAC,GAAd;EAAmBC,QAAQ,EAAE;AAA7B,CAJsB,EAKtB;EAAED,SAAS,EAAE,CAAC,GAAd;EAAmBC,QAAQ,EAAE,CAAC;AAA9B,CALsB,CAAxB;;AAQA,SAASC,YAAT,CAAsBC,OAAtB,EAA+B;EAC7B,MAAMC,MAAM,GAAGD,OAAO,CAACE,KAAR,CAAc,GAAd,EAAmBC,GAAnB,CAAuBC,MAAvB,CAAf;;EAEA,IAAIH,MAAM,CAACI,MAAP,IAAiB,CAArB,EAAwB;IACtB,OAAO,IAAP;EACD;;EAED,MAAM,CAACC,MAAD,EAASC,MAAT,EAAiBC,MAAjB,EAAyBC,MAA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