react-native-anavi
Version:
react native amap navigation component, Android + iOS
49 lines (41 loc) • 1.76 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 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 WalkPath extends Component {
constructor(...args) {
super(...args);
_defineProperty(this, "nativeComponent", 'WalkPath');
}
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(AWalkPath, props);
}
} // @ts-ignore
_defineProperty(WalkPath, "propTypes", { ...ViewPropTypes,
...mapEventsPropType(events),
drawPath: PropTypes.bool,
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])
});
const AWalkPath = requireNativeComponent('WalkPath', WalkPath);
//# sourceMappingURL=walk-path.js.map