Commit 3b37bcf7 authored by Pavlo Aksonov's avatar Pavlo Aksonov
Browse files

add id attribute to Annotation

Showing with 5 additions and 10 deletions
+5 -10
......@@ -20,7 +20,7 @@ const viewConfig = {
const propTypes = {
...View.propTypes,
id: PropTypes.string.isRequired,
title: PropTypes.string,
subtitle: PropTypes.string,
coordinate: PropTypes.shape({
......@@ -31,13 +31,15 @@ const propTypes = {
};
class MapboxAnnotation extends React.Component {
setNativeProps(nativeProps) {
this.marker.setNativeProps(nativeProps);
}
render() {
return (
<RCTMapboxAnnotation
ref={ref => { this.marker = ref; }}
{...this.props}
style={[styles.marker, this.props.style]}
/>
);
}
......@@ -46,12 +48,5 @@ class MapboxAnnotation extends React.Component {
MapboxAnnotation.propTypes = propTypes;
MapboxAnnotation.viewConfig = viewConfig;
const styles = StyleSheet.create({
marker: {
position: 'absolute',
backgroundColor: 'transparent',
},
});
const RCTMapboxAnnotation = requireNativeComponent('RCTMapboxAnnotation', MapboxAnnotation);
module.exports = MapboxAnnotation;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment