react-native-anavi
Version:
react native amap navigation component, Android + iOS
44 lines (37 loc) • 1.43 kB
JavaScript
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { ColorPropType, Platform, processColor, requireNativeComponent, ViewPropTypes } from 'react-native';
import { LatLngPropType } from '../prop-types';
/**
* @ignore
*/
export default class Polyline extends React.PureComponent {
render() {
var _this$props$colors;
const props = { ...this.props,
...Platform.select({
android: {
colors: (_this$props$colors = this.props.colors) === null || _this$props$colors === void 0 ? void 0 : _this$props$colors.map(processColor)
}
})
};
return /*#__PURE__*/React.createElement(AMapPolyline, props);
}
} // @ts-ignore
_defineProperty(Polyline, "propTypes", { ...ViewPropTypes,
coordinates: PropTypes.arrayOf(LatLngPropType).isRequired,
width: PropTypes.number,
color: ColorPropType,
zIndex: PropTypes.number,
colors: PropTypes.arrayOf(ColorPropType),
gradient: PropTypes.bool,
geodesic: PropTypes.bool,
dashed: PropTypes.bool,
onPress: PropTypes.func
});
_defineProperty(Polyline, "defaultProps", {
colors: []
});
const AMapPolyline = requireNativeComponent('AMapPolyline', Polyline);
//# sourceMappingURL=polyline.js.map