react-native-map4d-map-dtqg 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/android/build.gradle +60 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativemap4dmap/ImageUtils.java +87 -0
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapModule.java +298 -0
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapPackage.java +35 -0
- package/android/src/main/java/com/reactnativemap4dmap/Map4dMapViewManager.java +31 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuilding.java +167 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFBuildingManager.java +121 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircle.java +105 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFCircleManager.java +122 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRenderer.java +502 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFDirectionsRendererManager.java +143 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFFeature.java +18 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapView.java +1172 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMapViewManager.java +226 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarker.java +412 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFMarkerManager.java +212 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOI.java +222 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPOIManager.java +119 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygon.java +173 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolygonManager.java +148 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolyline.java +146 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFPolylineManager.java +138 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlay.java +95 -0
- package/android/src/main/java/com/reactnativemap4dmap/RMFTileOverlayManager.java +65 -0
- package/android/src/main/java/com/reactnativemap4dmap/SizeReportingShadowNode.java +31 -0
- package/android/src/main/java/com/reactnativemap4dmap/ViewAttacherGroup.java +31 -0
- package/android/src/main/java/com/reactnativemap4dmap/ViewChangesTracker.java +70 -0
- package/android/src/main/java/vn/map4d/map/annotations/RMFBitmapDescriptor.java +9 -0
- package/ios/Map4dMap.h +7 -0
- package/ios/Map4dMap.m +14 -0
- package/ios/Map4dMap.xcodeproj/project.pbxproj +282 -0
- package/ios/Map4dMapViewManager.m +34 -0
- package/ios/RCTConvert+Map4dMap.h +33 -0
- package/ios/RCTConvert+Map4dMap.m +112 -0
- package/ios/RMFCircle.h +37 -0
- package/ios/RMFCircle.m +100 -0
- package/ios/RMFCircleManager.h +18 -0
- package/ios/RMFCircleManager.m +155 -0
- package/ios/RMFCircleMap4d.h +23 -0
- package/ios/RMFCircleMap4d.m +13 -0
- package/ios/RMFCoordinate.h +22 -0
- package/ios/RMFCoordinate.m +13 -0
- package/ios/RMFDirectionsMarkerOptions.h +24 -0
- package/ios/RMFDirectionsMarkerOptions.m +23 -0
- package/ios/RMFDirectionsRenderer.h +47 -0
- package/ios/RMFDirectionsRenderer.m +182 -0
- package/ios/RMFDirectionsRendererManager.h +17 -0
- package/ios/RMFDirectionsRendererManager.m +84 -0
- package/ios/RMFDirectionsRendererMap4d.h +21 -0
- package/ios/RMFDirectionsRendererMap4d.m +12 -0
- package/ios/RMFDummyView.h +7 -0
- package/ios/RMFDummyView.m +13 -0
- package/ios/RMFEventResponse.h +39 -0
- package/ios/RMFEventResponse.m +98 -0
- package/ios/RMFIcon.h +24 -0
- package/ios/RMFIcon.m +35 -0
- package/ios/RMFMapView.h +84 -0
- package/ios/RMFMapView.m +376 -0
- package/ios/RMFMapViewManager.h +17 -0
- package/ios/RMFMapViewManager.m +493 -0
- package/ios/RMFMarker.h +57 -0
- package/ios/RMFMarker.m +267 -0
- package/ios/RMFMarkerManager.h +17 -0
- package/ios/RMFMarkerManager.m +156 -0
- package/ios/RMFMarkerMap4d.h +19 -0
- package/ios/RMFMarkerMap4d.m +13 -0
- package/ios/RMFPOI.h +38 -0
- package/ios/RMFPOI.m +123 -0
- package/ios/RMFPOIManager.h +18 -0
- package/ios/RMFPOIManager.m +168 -0
- package/ios/RMFPOIMap4d.h +22 -0
- package/ios/RMFPOIMap4d.m +12 -0
- package/ios/RMFPolygon.h +41 -0
- package/ios/RMFPolygon.m +106 -0
- package/ios/RMFPolygonManager.h +18 -0
- package/ios/RMFPolygonManager.m +141 -0
- package/ios/RMFPolygonMap4d.h +23 -0
- package/ios/RMFPolygonMap4d.m +15 -0
- package/ios/RMFPolyline.h +38 -0
- package/ios/RMFPolyline.m +101 -0
- package/ios/RMFPolylineManager.h +18 -0
- package/ios/RMFPolylineManager.m +139 -0
- package/ios/RMFPolylineMap4d.h +22 -0
- package/ios/RMFPolylineMap4d.m +15 -0
- package/ios/building/RMFBuilding.h +41 -0
- package/ios/building/RMFBuilding.m +104 -0
- package/ios/building/RMFBuildingManager.h +19 -0
- package/ios/building/RMFBuildingManager.m +133 -0
- package/ios/building/RMFBuildingMap4d.h +23 -0
- package/ios/building/RMFBuildingMap4d.m +15 -0
- package/ios/overlays/RMFTileOverlay.h +36 -0
- package/ios/overlays/RMFTileOverlay.m +64 -0
- package/ios/overlays/RMFTileOverlayManager.h +17 -0
- package/ios/overlays/RMFTileOverlayManager.m +27 -0
- package/lib/commonjs/components/MFBuilding.js +192 -0
- package/lib/commonjs/components/MFBuilding.js.map +1 -0
- package/lib/commonjs/components/MFCircle.js +181 -0
- package/lib/commonjs/components/MFCircle.js.map +1 -0
- package/lib/commonjs/components/MFDirectionsRenderer.js +240 -0
- package/lib/commonjs/components/MFDirectionsRenderer.js.map +1 -0
- package/lib/commonjs/components/MFMapView.js +375 -0
- package/lib/commonjs/components/MFMapView.js.map +1 -0
- package/lib/commonjs/components/MFMarker.js +255 -0
- package/lib/commonjs/components/MFMarker.js.map +1 -0
- package/lib/commonjs/components/MFPOI.js +204 -0
- package/lib/commonjs/components/MFPOI.js.map +1 -0
- package/lib/commonjs/components/MFPolygon.js +183 -0
- package/lib/commonjs/components/MFPolygon.js.map +1 -0
- package/lib/commonjs/components/MFPolyline.js +173 -0
- package/lib/commonjs/components/MFPolyline.js.map +1 -0
- package/lib/commonjs/components/MFTileOverlay.js +51 -0
- package/lib/commonjs/components/MFTileOverlay.js.map +1 -0
- package/lib/commonjs/components/Map4dMapView.js +19 -0
- package/lib/commonjs/components/Map4dMapView.js.map +1 -0
- package/lib/commonjs/index.js +78 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/components/MFBuilding.js +178 -0
- package/lib/module/components/MFBuilding.js.map +1 -0
- package/lib/module/components/MFCircle.js +167 -0
- package/lib/module/components/MFCircle.js.map +1 -0
- package/lib/module/components/MFDirectionsRenderer.js +226 -0
- package/lib/module/components/MFDirectionsRenderer.js.map +1 -0
- package/lib/module/components/MFMapView.js +361 -0
- package/lib/module/components/MFMapView.js.map +1 -0
- package/lib/module/components/MFMarker.js +240 -0
- package/lib/module/components/MFMarker.js.map +1 -0
- package/lib/module/components/MFPOI.js +190 -0
- package/lib/module/components/MFPOI.js.map +1 -0
- package/lib/module/components/MFPolygon.js +169 -0
- package/lib/module/components/MFPolygon.js.map +1 -0
- package/lib/module/components/MFPolyline.js +159 -0
- package/lib/module/components/MFPolyline.js.map +1 -0
- package/lib/module/components/MFTileOverlay.js +38 -0
- package/lib/module/components/MFTileOverlay.js.map +1 -0
- package/lib/module/components/Map4dMapView.js +10 -0
- package/lib/module/components/Map4dMapView.js.map +1 -0
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/components/Map4dMapView.d.ts +7 -0
- package/package.json +152 -0
- package/react-native-map4d-map.podspec +20 -0
- package/src/components/MFBuilding.js +188 -0
- package/src/components/MFCircle.js +173 -0
- package/src/components/MFDirectionsRenderer.js +237 -0
- package/src/components/MFMapView.js +374 -0
- package/src/components/MFMarker.js +246 -0
- package/src/components/MFPOI.js +184 -0
- package/src/components/MFPolygon.js +186 -0
- package/src/components/MFPolyline.js +172 -0
- package/src/components/MFTileOverlay.js +45 -0
- package/src/components/Map4dMapView.tsx +27 -0
- package/src/index.js +21 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MFPOI = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _deprecatedReactNativePropTypes = require("deprecated-react-native-prop-types");
|
|
13
|
+
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
21
|
+
const viewPropTypes = _deprecatedReactNativePropTypes.ViewPropTypes || View.propTypes;
|
|
22
|
+
const propTypes = { ...viewPropTypes,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The coordinate for the POI.
|
|
26
|
+
*/
|
|
27
|
+
coordinate: _propTypes.default.shape({
|
|
28
|
+
latitude: _propTypes.default.number.isRequired,
|
|
29
|
+
longitude: _propTypes.default.number.isRequired
|
|
30
|
+
}).isRequired,
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The title of the POI.
|
|
34
|
+
*/
|
|
35
|
+
title: _propTypes.default.string,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The color of the title.
|
|
39
|
+
*/
|
|
40
|
+
titleColor: _deprecatedReactNativePropTypes.ColorPropType,
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The subtile of the POI.
|
|
44
|
+
*/
|
|
45
|
+
subtitle: _propTypes.default.string,
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The type of POI
|
|
49
|
+
*/
|
|
50
|
+
//poiType: PropTypes.oneOf(['cafe', 'atm', 'bank']),
|
|
51
|
+
poiType: _propTypes.default.string,
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* POI icon to render.
|
|
55
|
+
*/
|
|
56
|
+
icon: _propTypes.default.shape({
|
|
57
|
+
uri: _propTypes.default.any.isRequired
|
|
58
|
+
}),
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* zIndex
|
|
62
|
+
*/
|
|
63
|
+
zIndex: _propTypes.default.number,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* visible
|
|
67
|
+
*/
|
|
68
|
+
//TODO
|
|
69
|
+
// visible: PropTypes.bool,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* userData
|
|
73
|
+
*/
|
|
74
|
+
userData: _propTypes.default.object,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Callback that is called when the user presses on the POI
|
|
78
|
+
*/
|
|
79
|
+
onPress: _propTypes.default.func
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
class MFPOI extends _react.default.Component {
|
|
83
|
+
constructor(props) {
|
|
84
|
+
super(props);
|
|
85
|
+
this._onPress = this._onPress.bind(this);
|
|
86
|
+
this._ref = this._ref.bind(this);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
_onPress(event) {
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
|
|
92
|
+
if (this.props.onPress) {
|
|
93
|
+
this.props.onPress(event);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_ref(ref) {
|
|
98
|
+
this.poi = ref;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setCoordinate(coordinate) {
|
|
102
|
+
this._runCommand("setCoordinate", [coordinate]);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
setTitle(title) {
|
|
106
|
+
this._runCommand("setTitle", [title]);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
setTitleColor(color) {
|
|
110
|
+
this._runCommand("setTitleColor", [(0, _reactNative.processColor)(color)]);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
setSubTitle(subtitle) {
|
|
114
|
+
this._runCommand("setSubTitle", [subtitle]);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
setPoiType(type) {
|
|
118
|
+
this._runCommand("setPoiType", [type]);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
setIcon(icon) {
|
|
122
|
+
let uri = _reactNative.Image.resolveAssetSource(icon.uri) || {
|
|
123
|
+
uri: icon.uri
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
this._runCommand("setIcon", [{
|
|
127
|
+
uri: uri.uri
|
|
128
|
+
}]);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
setZIndex(zIndex) {
|
|
132
|
+
this._runCommand("setZIndex", [zIndex]);
|
|
133
|
+
} // setVisible(visible) {
|
|
134
|
+
// this._runCommand("setVisible", [visible])
|
|
135
|
+
// }
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
setUserData(userData) {
|
|
139
|
+
this._runCommand("setUserData", [userData]);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_getHandle() {
|
|
143
|
+
return (0, _reactNative.findNodeHandle)(this.poi);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
_runCommand(name, args) {
|
|
147
|
+
switch (_reactNative.Platform.OS) {
|
|
148
|
+
case 'android':
|
|
149
|
+
_reactNative.NativeModules.UIManager.dispatchViewManagerCommand(this._getHandle(), this._uiManagerCommand(name), args);
|
|
150
|
+
|
|
151
|
+
break;
|
|
152
|
+
|
|
153
|
+
case 'ios':
|
|
154
|
+
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
155
|
+
|
|
156
|
+
break;
|
|
157
|
+
|
|
158
|
+
default:
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
_uiManagerCommand(name) {
|
|
164
|
+
const UIManager = _reactNative.NativeModules.UIManager;
|
|
165
|
+
const componentName = "RMFPOI";
|
|
166
|
+
|
|
167
|
+
if (!UIManager.getViewManagerConfig) {
|
|
168
|
+
// RN < 0.58
|
|
169
|
+
return UIManager[componentName].Commands[name];
|
|
170
|
+
} // RN >= 0.58
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
return UIManager.getViewManagerConfig(componentName).Commands[name];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
_mapManagerCommand(name) {
|
|
177
|
+
return _reactNative.NativeModules[`RMFPOI`][name];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
render() {
|
|
181
|
+
let icon = {};
|
|
182
|
+
|
|
183
|
+
if (this.props.icon) {
|
|
184
|
+
let uri = _reactNative.Image.resolveAssetSource(this.props.icon.uri) || {
|
|
185
|
+
uri: this.props.icon.uri
|
|
186
|
+
};
|
|
187
|
+
icon = {
|
|
188
|
+
uri: uri.uri
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return /*#__PURE__*/_react.default.createElement(RMFPOI, _extends({}, this.props, {
|
|
193
|
+
icon: icon,
|
|
194
|
+
ref: this._ref,
|
|
195
|
+
onPress: this._onPress
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
exports.MFPOI = MFPOI;
|
|
202
|
+
MFPOI.propTypes = propTypes;
|
|
203
|
+
var RMFPOI = (0, _reactNative.requireNativeComponent)(`RMFPOI`, MFPOI);
|
|
204
|
+
//# sourceMappingURL=MFPOI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["viewPropTypes","ViewPropTypes","View","propTypes","coordinate","PropTypes","shape","latitude","number","isRequired","longitude","title","string","titleColor","ColorPropType","subtitle","poiType","icon","uri","any","zIndex","userData","object","onPress","func","MFPOI","React","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","poi","setCoordinate","_runCommand","setTitle","setTitleColor","color","processColor","setSubTitle","setPoiType","type","setIcon","Image","resolveAssetSource","setZIndex","setUserData","_getHandle","findNodeHandle","name","args","Platform","OS","NativeModules","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPOI","requireNativeComponent"],"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;;AACA;;AACA;;AACA;;;;;;AASA;AACA,MAAMA,aAAa,GAAGC,6CAAA,IAAiBC,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGH,aADa;;EAGd;AACJ;AACA;EACEI,UAAU,EAAEC,kBAAA,CAAUC,KAAV,CAAgB;IAC1BC,QAAQ,EAAEF,kBAAA,CAAUG,MAAV,CAAiBC,UADD;IAE1BC,SAAS,EAAEL,kBAAA,CAAUG,MAAV,CAAiBC;EAFF,CAAhB,EAGTA,UATa;;EAWhB;AACF;AACA;EACEE,KAAK,EAAEN,kBAAA,CAAUO,MAdD;;EAgBhB;AACF;AACA;EACEC,UAAU,EAAEC,6CAnBI;;EAqBhB;AACF;AACA;EACEC,QAAQ,EAAEV,kBAAA,CAAUO,MAxBJ;;EA0BhB;AACF;AACA;EACE;EACAI,OAAO,EAAEX,kBAAA,CAAUO,MA9BH;;EAgChB;AACF;AACA;EACEK,IAAI,EAAEZ,kBAAA,CAAUC,KAAV,CAAgB;IACpBY,GAAG,EAAEb,kBAAA,CAAUc,GAAV,CAAcV;EADC,CAAhB,CAnCU;;EAuChB;AACF;AACA;EACEW,MAAM,EAAEf,kBAAA,CAAUG,MA1CF;;EA4ChB;AACF;AACA;EACE;EACA;;EAEA;AACF;AACA;EACEa,QAAQ,EAAChB,kBAAA,CAAUiB,MArDH;;EAuDhB;AACF;AACA;EACEC,OAAO,EAAElB,kBAAA,CAAUmB;AA1DH,CAAlB;;AA6DA,MAAMC,KAAN,SAAoBC,cAAA,CAAMC,SAA1B,CAAoC;EAClCC,WAAW,CAACC,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C,kBAAN,CAAyB,KAAKnB,KAAL,CAAWZ,IAAX,CAAgBC,GAAzC,KAAiD;QAACA,GAAG,EAAE,KAAKW,KAAL,CAAWZ,IAAX,CAAgBC;MAAtB,CAA3D;MACAD,IAAI,GAAG;QAAEC,GAAG,EAAEA,GAAG,CAACA;MAAX,CAAP;IACD;;IACD,oBAAO,6BAAC,MAAD,eACD,KAAKW,KADJ;MAEL,IAAI,EAAEZ,IAFD;MAGL,GAAG,EAAE,KAAKe,IAHL;MAIL,OAAO,EAAE,KAAKF;IAJT,GAAP;EAMD;;AApGiC;;;AAuGpCL,KAAK,CAACtB,SAAN,GAAkBA,SAAlB;AAEA,IAAI+D,MAAM,GAAG,IAAAC,mCAAA,EAAwB,QAAxB,EAAiC1C,KAAjC,CAAb"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MFPolygon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _deprecatedReactNativePropTypes = require("deprecated-react-native-prop-types");
|
|
13
|
+
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
21
|
+
const viewPropTypes = _deprecatedReactNativePropTypes.ViewPropTypes || View.propTypes;
|
|
22
|
+
const propTypes = { ...viewPropTypes,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An array of coordinates to describe the polygon
|
|
26
|
+
*/
|
|
27
|
+
coordinates: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
28
|
+
/**
|
|
29
|
+
* Latitude/Longitude coordinates
|
|
30
|
+
*/
|
|
31
|
+
latitude: _propTypes.default.number.isRequired,
|
|
32
|
+
longitude: _propTypes.default.number.isRequired
|
|
33
|
+
})),
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An array of array of coordinates to describe the polygon holes
|
|
37
|
+
*/
|
|
38
|
+
holes: _propTypes.default.arrayOf(_propTypes.default.arrayOf(_propTypes.default.shape({
|
|
39
|
+
/**
|
|
40
|
+
* Latitude/Longitude coordinates
|
|
41
|
+
*/
|
|
42
|
+
latitude: _propTypes.default.number.isRequired,
|
|
43
|
+
longitude: _propTypes.default.number.isRequired
|
|
44
|
+
}))),
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The color to use for the polygon.
|
|
48
|
+
*/
|
|
49
|
+
fillColor: _deprecatedReactNativePropTypes.ColorPropType,
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The color to use for the polygon stroke.
|
|
53
|
+
*/
|
|
54
|
+
strokeColor: _deprecatedReactNativePropTypes.ColorPropType,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The stroke width to use for the polygon.
|
|
58
|
+
*/
|
|
59
|
+
strokeWidth: _propTypes.default.number,
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* zIndex
|
|
63
|
+
*/
|
|
64
|
+
zIndex: _propTypes.default.number,
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* visible
|
|
68
|
+
*/
|
|
69
|
+
visible: _propTypes.default.bool,
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* userData
|
|
73
|
+
*/
|
|
74
|
+
userData: _propTypes.default.object,
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Callback that is called when the user presses on the polygon
|
|
78
|
+
*/
|
|
79
|
+
onPress: _propTypes.default.func
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
class MFPolygon extends _react.default.Component {
|
|
83
|
+
constructor(props) {
|
|
84
|
+
super(props);
|
|
85
|
+
this._onPress = this._onPress.bind(this);
|
|
86
|
+
this._ref = this._ref.bind(this);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
_onPress(event) {
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
|
|
92
|
+
if (this.props.onPress) {
|
|
93
|
+
this.props.onPress(event);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_ref(ref) {
|
|
98
|
+
this.polygon = ref;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setCoordinates(coordinates) {
|
|
102
|
+
this._runCommand("setCoordinates", [coordinates]);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
setHoles(holes) {
|
|
106
|
+
this._runCommand("setHoles", [holes]);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
setFillColor(color) {
|
|
110
|
+
this._runCommand("setFillColor", [(0, _reactNative.processColor)(color)]);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
setStrokeColor(color) {
|
|
114
|
+
this._runCommand("setStrokeColor", [(0, _reactNative.processColor)(color)]);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
setStrokeWidth(width) {
|
|
118
|
+
this._runCommand("setStrokeWidth", [width]);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
setVisible(visible) {
|
|
122
|
+
this._runCommand("setVisible", [visible]);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
setZIndex(zIndex) {
|
|
126
|
+
this._runCommand("setZIndex", [zIndex]);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
setUserData(userData) {
|
|
130
|
+
this._runCommand("setUserData", [userData]);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
_getHandle() {
|
|
134
|
+
return (0, _reactNative.findNodeHandle)(this.polygon);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
_runCommand(name, args) {
|
|
138
|
+
switch (_reactNative.Platform.OS) {
|
|
139
|
+
case 'android':
|
|
140
|
+
_reactNative.NativeModules.UIManager.dispatchViewManagerCommand(this._getHandle(), this._uiManagerCommand(name), args);
|
|
141
|
+
|
|
142
|
+
break;
|
|
143
|
+
|
|
144
|
+
case 'ios':
|
|
145
|
+
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
146
|
+
|
|
147
|
+
break;
|
|
148
|
+
|
|
149
|
+
default:
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
_uiManagerCommand(name) {
|
|
155
|
+
const UIManager = _reactNative.NativeModules.UIManager;
|
|
156
|
+
const componentName = "RMFPolygon";
|
|
157
|
+
|
|
158
|
+
if (!UIManager.getViewManagerConfig) {
|
|
159
|
+
// RN < 0.58
|
|
160
|
+
return UIManager[componentName].Commands[name];
|
|
161
|
+
} // RN >= 0.58
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
return UIManager.getViewManagerConfig(componentName).Commands[name];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
_mapManagerCommand(name) {
|
|
168
|
+
return _reactNative.NativeModules[`RMFPolygon`][name];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
render() {
|
|
172
|
+
return /*#__PURE__*/_react.default.createElement(RMFPolygon, _extends({}, this.props, {
|
|
173
|
+
ref: this._ref,
|
|
174
|
+
onPress: this._onPress
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
exports.MFPolygon = MFPolygon;
|
|
181
|
+
MFPolygon.propTypes = propTypes;
|
|
182
|
+
var RMFPolygon = (0, _reactNative.requireNativeComponent)(`RMFPolygon`, MFPolygon);
|
|
183
|
+
//# sourceMappingURL=MFPolygon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["viewPropTypes","ViewPropTypes","View","propTypes","coordinates","PropTypes","arrayOf","shape","latitude","number","isRequired","longitude","holes","fillColor","ColorPropType","strokeColor","strokeWidth","zIndex","visible","bool","userData","object","onPress","func","MFPolygon","React","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polygon","setCoordinates","_runCommand","setHoles","setFillColor","color","processColor","setStrokeColor","setStrokeWidth","width","setVisible","setZIndex","setUserData","_getHandle","findNodeHandle","name","args","Platform","OS","NativeModules","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPolygon","requireNativeComponent"],"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;;AACA;;AACA;;AACA;;;;;;AAQA;AACA,MAAMA,aAAa,GAAGC,6CAAA,IAAiBC,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGH,aADa;;EAGhB;AACF;AACA;EACEI,WAAW,EAAEC,kBAAA,CAAUC,OAAV,CACXD,kBAAA,CAAUE,KAAV,CAAgB;IACd;AACN;AACA;IACMC,QAAQ,EAAEH,kBAAA,CAAUI,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAEN,kBAAA,CAAUI,MAAV,CAAiBC;EALd,CAAhB,CADW,CANG;;EAgBhB;AACF;AACA;EACEE,KAAK,EAAEP,kBAAA,CAAUC,OAAV,CACLD,kBAAA,CAAUC,OAAV,CACED,kBAAA,CAAUE,KAAV,CAAgB;IACd;AACR;AACA;IACQC,QAAQ,EAAEH,kBAAA,CAAUI,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAEN,kBAAA,CAAUI,MAAV,CAAiBC;EALd,CAAhB,CADF,CADK,CAnBS;;EA+BhB;AACF;AACA;EACEG,SAAS,EAAEC,6CAlCK;;EAoChB;AACF;AACA;EACEC,WAAW,EAAED,6CAvCG;;EAyChB;AACF;AACA;EACEE,WAAW,EAAEX,kBAAA,CAAUI,MA5CP;;EA8ChB;AACF;AACA;EACEQ,MAAM,EAAEZ,kBAAA,CAAUI,MAjDF;;EAmDhB;AACF;AACA;EACES,OAAO,EAAEb,kBAAA,CAAUc,IAtDH;;EAwDhB;AACF;AACA;EACEC,QAAQ,EAACf,kBAAA,CAAUgB,MA3DH;;EA6DhB;AACF;AACA;EACEC,OAAO,EAAEjB,kBAAA,CAAUkB;AAhEH,CAAlB;;AAoEA,MAAMC,SAAN,SAAwBC,cAAA,CAAMC,SAA9B,CAAwC;EACtCC,WAAW,CAACC,K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|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MFPolyline = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _deprecatedReactNativePropTypes = require("deprecated-react-native-prop-types");
|
|
13
|
+
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
|
+
|
|
20
|
+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
21
|
+
const viewPropTypes = _deprecatedReactNativePropTypes.ViewPropTypes || View.propTypes;
|
|
22
|
+
const propTypes = { ...viewPropTypes,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* An array of coordinates to describe the polyline
|
|
26
|
+
*/
|
|
27
|
+
coordinates: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
28
|
+
/**
|
|
29
|
+
* Latitude/Longitude coordinates
|
|
30
|
+
*/
|
|
31
|
+
latitude: _propTypes.default.number.isRequired,
|
|
32
|
+
longitude: _propTypes.default.number.isRequired
|
|
33
|
+
})),
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The color to use for the path.
|
|
37
|
+
*/
|
|
38
|
+
color: _deprecatedReactNativePropTypes.ColorPropType,
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The stroke width to use for the path.
|
|
42
|
+
*/
|
|
43
|
+
width: _propTypes.default.number,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The default style is `solid`.
|
|
47
|
+
*/
|
|
48
|
+
lineStyle: _propTypes.default.oneOf(['solid', 'dotted']),
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* zIndex
|
|
52
|
+
*/
|
|
53
|
+
zIndex: _propTypes.default.number,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* visible
|
|
57
|
+
*/
|
|
58
|
+
visible: _propTypes.default.bool,
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* userData
|
|
62
|
+
*/
|
|
63
|
+
userData: _propTypes.default.object,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Callback that is called when the user presses on the polyline
|
|
67
|
+
*/
|
|
68
|
+
onPress: _propTypes.default.func
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
class MFPolyline extends _react.default.Component {
|
|
72
|
+
constructor(props) {
|
|
73
|
+
super(props);
|
|
74
|
+
this._onPress = this._onPress.bind(this);
|
|
75
|
+
this._ref = this._ref.bind(this);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_onPress(event) {
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
|
|
81
|
+
if (this.props.onPress) {
|
|
82
|
+
this.props.onPress(event);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
_ref(ref) {
|
|
87
|
+
this.polyline = ref;
|
|
88
|
+
} // TODO - bug
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
setCoordinates(coordinates) {
|
|
92
|
+
this._runCommand("setCoordinates", [coordinates]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
setWidth(width) {
|
|
96
|
+
this._runCommand("setWidth", [width]);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setColor(color) {
|
|
100
|
+
this._runCommand("setColor", [(0, _reactNative.processColor)(color)]);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setVisible(visible) {
|
|
104
|
+
this._runCommand("setVisible", [visible]);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
setTouchable(touchable) {
|
|
108
|
+
this._runCommand("setTouchable", [touchable]);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setZIndex(zIndex) {
|
|
112
|
+
this._runCommand("setZIndex", [zIndex]);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
setLineStyle(style) {
|
|
116
|
+
this._runCommand("setLineStyle", [style]);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
setUserData(userData) {
|
|
120
|
+
this._runCommand("setUserData", [userData]);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_getHandle() {
|
|
124
|
+
return (0, _reactNative.findNodeHandle)(this.polyline);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
_runCommand(name, args) {
|
|
128
|
+
switch (_reactNative.Platform.OS) {
|
|
129
|
+
case 'android':
|
|
130
|
+
_reactNative.NativeModules.UIManager.dispatchViewManagerCommand(this._getHandle(), this._uiManagerCommand(name), args);
|
|
131
|
+
|
|
132
|
+
break;
|
|
133
|
+
|
|
134
|
+
case 'ios':
|
|
135
|
+
this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
136
|
+
|
|
137
|
+
break;
|
|
138
|
+
|
|
139
|
+
default:
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
_uiManagerCommand(name) {
|
|
145
|
+
const UIManager = _reactNative.NativeModules.UIManager;
|
|
146
|
+
const componentName = "RMFPolyline";
|
|
147
|
+
|
|
148
|
+
if (!UIManager.getViewManagerConfig) {
|
|
149
|
+
// RN < 0.58
|
|
150
|
+
return UIManager[componentName].Commands[name];
|
|
151
|
+
} // RN >= 0.58
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
return UIManager.getViewManagerConfig(componentName).Commands[name];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
_mapManagerCommand(name) {
|
|
158
|
+
return _reactNative.NativeModules[`RMFPolyline`][name];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
render() {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(RMFPolyline, _extends({}, this.props, {
|
|
163
|
+
ref: this._ref,
|
|
164
|
+
onPress: this._onPress
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
exports.MFPolyline = MFPolyline;
|
|
171
|
+
MFPolyline.propTypes = propTypes;
|
|
172
|
+
var RMFPolyline = (0, _reactNative.requireNativeComponent)(`RMFPolyline`, MFPolyline);
|
|
173
|
+
//# sourceMappingURL=MFPolyline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["viewPropTypes","ViewPropTypes","View","propTypes","coordinates","PropTypes","arrayOf","shape","latitude","number","isRequired","longitude","color","ColorPropType","width","lineStyle","oneOf","zIndex","visible","bool","userData","object","onPress","func","MFPolyline","React","Component","constructor","props","_onPress","bind","_ref","event","stopPropagation","ref","polyline","setCoordinates","_runCommand","setWidth","setColor","processColor","setVisible","setTouchable","touchable","setZIndex","setLineStyle","style","setUserData","_getHandle","findNodeHandle","name","args","Platform","OS","NativeModules","UIManager","dispatchViewManagerCommand","_uiManagerCommand","_mapManagerCommand","componentName","getViewManagerConfig","Commands","render","RMFPolyline","requireNativeComponent"],"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;;AACA;;AACA;;AACA;;;;;;AAQA;AACA,MAAMA,aAAa,GAAGC,6CAAA,IAAiBC,IAAI,CAACC,SAA5C;AAEA,MAAMA,SAAS,GAAG,EAChB,GAAGH,aADa;;EAGhB;AACF;AACA;EACEI,WAAW,EAAEC,kBAAA,CAAUC,OAAV,CACXD,kBAAA,CAAUE,KAAV,CAAgB;IACd;AACN;AACA;IACMC,QAAQ,EAAEH,kBAAA,CAAUI,MAAV,CAAiBC,UAJb;IAKdC,SAAS,EAAEN,kBAAA,CAAUI,MAAV,CAAiBC;EALd,CAAhB,CADW,CANG;;EAgBhB;AACF;AACA;EACEE,KAAK,EAAEC,6CAnBS;;EAqBhB;AACF;AACA;EACEC,KAAK,EAAET,kBAAA,CAAUI,MAxBD;;EA0BhB;AACF;AACA;EACEM,SAAS,EAAEV,kBAAA,CAAUW,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,CAAhB,CA7BK;;EA+BhB;AACF;AACA;EACEC,MAAM,EAAEZ,kBAAA,CAAUI,MAlCF;;EAoChB;AACF;AACA;EACES,OAAO,EAAEb,kBAAA,CAAUc,IAvCH;;EAyChB;AACF;AACA;EACEC,QAAQ,EAACf,kBAAA,CAAUgB,MA5CH;;EA8ChB;AACF;AACA;EACEC,OAAO,EAAEjB,kBAAA,CAAUkB;AAjDH,CAAlB;;AAqDA,MAAMC,UAAN,SAAyBC,cAAA,CAAMC,SAA/B,CAAyC;EACvCC,WAAW,CAACC,KAA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
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MFTileOverlay = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _deprecatedReactNativePropTypes = require("deprecated-react-native-prop-types");
|
|
13
|
+
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
// if ViewPropTypes is not defined fall back to View.propType (to support RN < 0.44)
|
|
19
|
+
const viewPropTypes = _deprecatedReactNativePropTypes.ViewPropTypes || _reactNative.View.propTypes;
|
|
20
|
+
const propTypes = { ...viewPropTypes,
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
|
|
24
|
+
* For example, https://tile.openstreetmap.de/{z}/{x}/{y}.png
|
|
25
|
+
*/
|
|
26
|
+
urlTemplate: _propTypes.default.string.isRequired,
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* visible
|
|
30
|
+
*/
|
|
31
|
+
visible: _propTypes.default.bool,
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The order in which this tile overlay is drawn with respect to other overlays. An overlay
|
|
35
|
+
* with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays
|
|
36
|
+
* with the same z-index is arbitrary. The default zIndex is 0.
|
|
37
|
+
*/
|
|
38
|
+
zIndex: _propTypes.default.number
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
class MFTileOverlay extends _react.default.Component {
|
|
42
|
+
render() {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(RMFTileOverlay, this.props);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports.MFTileOverlay = MFTileOverlay;
|
|
49
|
+
MFTileOverlay.propTypes = propTypes;
|
|
50
|
+
var RMFTileOverlay = (0, _reactNative.requireNativeComponent)(`RMFTileOverlay`, MFTileOverlay);
|
|
51
|
+
//# sourceMappingURL=MFTileOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["viewPropTypes","ViewPropTypes","View","propTypes","urlTemplate","PropTypes","string","isRequired","visible","bool","zIndex","number","MFTileOverlay","React","Component","render","props","RMFTileOverlay","requireNativeComponent"],"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;;AACA;;AACA;;AACA;;;;AAKA;AACA,MAAMA,aAAa,GAAGC,6CAAA,IAAiBC,iBAAA,CAAKC,SAA5C;AACA,MAAMA,SAAS,GAAG,EAChB,GAAGH,aADa;;EAGhB;AACF;AACA;AACA;EACEI,WAAW,EAAEC,kBAAA,CAAUC,MAAV,CAAiBC,UAPd;;EAShB;AACF;AACA;EACEC,OAAO,EAAEH,kBAAA,CAAUI,IAZH;;EAchB;AACF;AACA;AACA;AACA;EACEC,MAAM,EAAEL,kBAAA,CAAUM;AAnBF,CAAlB;;AAsBA,MAAMC,aAAN,SAA4BC,cAAA,CAAMC,SAAlC,CAA4C;EAC1CC,MAAM,GAAG;IACP,oBAAO,6BAAC,cAAD,EACD,KAAKC,KADJ,CAAP;EAGD;;AALyC;;;AAQ5CJ,aAAa,CAACT,SAAd,GAA0BA,SAA1B;AAEA,IAAIc,cAAc,GAAG,IAAAC,mCAAA,EAAwB,gBAAxB,EAAyCN,aAAzC,CAArB"}
|