UNPKG

react-native-anavi

Version:

react native amap navigation component, Android + iOS

60 lines (52 loc) 2.24 kB
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 React from 'react'; import * as PropTypes from 'prop-types'; import { ViewPropTypes, requireNativeComponent, Image } from 'react-native'; import Component from '../map-view/component'; import { mapEventsPropType, LatLngPropType } from '../prop-types'; const events = ['onSearchStart', 'onSearchComplete']; export class DrivePath extends Component { constructor(...args) { super(...args); _defineProperty(this, "nativeComponent", 'DrivePath'); } render() { const props = { ...this.props, ...this.handlers(events) }; for (let k in props) { if (k.indexOf('Icon') > -1) { props[k] = Image.resolveAssetSource(props[k]); } } return /*#__PURE__*/React.createElement(ADrivePath, props); } } // @ts-ignore _defineProperty(DrivePath, "propTypes", { ...ViewPropTypes, ...mapEventsPropType(events), startPoint: LatLngPropType.isRequired, endPoint: LatLngPropType.isRequired, pathWidth: PropTypes.number, pathColor: PropTypes.string, nodeVisible: PropTypes.bool, startMarkerTitle: PropTypes.string, endMarkerTitle: PropTypes.string, startMarkerIcon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), endMarkerIcon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), nodeMarkerIcon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), throughMarkerIcon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), wayPoints: PropTypes.arrayOf(LatLngPropType), avoidRegion: PropTypes.arrayOf(PropTypes.arrayOf(LatLngPropType)), avoidRoad: PropTypes.string, throughPoints: PropTypes.arrayOf(LatLngPropType), throughMarkerVisible: PropTypes.bool, realTimeTraffic: PropTypes.bool, searchMode: PropTypes.number, normalPathColor: PropTypes.string, slowlyPathColor: PropTypes.string, blockedPathColor: PropTypes.string, severeBlockedPathColor: PropTypes.string, throughPointIcon: PropTypes.string }); const ADrivePath = requireNativeComponent('DrivePath', DrivePath); //# sourceMappingURL=drive-path.js.map