Skip to content

Commit a418efc

Browse files
author
Aurore
committed
Add description as Marker props
1 parent 8496a9b commit a418efc

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The supported components are `MapView` and `MapView.Marker`.
4747
`MapView.Marker`:
4848
- The supported props are:
4949
- `title`
50+
- `description`
5051
- `coordinate`
5152

5253

docs/stories/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ storiesOf('MapView', module)
2222
));
2323
storiesOf('Marker', module).add('basic', () => (
2424
<MapView region={{ latitude: 48.88, longitude: 2.32 }}>
25-
<MapView.Marker title="BAM" coordinate={{ latitude: 48.8828463, longitude: 2.3229091 }} />
25+
<MapView.Marker
26+
title="BAM"
27+
description="Shape the future of mobile with us"
28+
coordinate={{ latitude: 48.8828463, longitude: 2.3229091 }}
29+
/>
2630
</MapView>
2731
));

src/Marker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MapViewMarker extends Component {
55
render() {
66
return (
77
<Marker
8-
title={this.props.title}
8+
title={this.props.description ? `${this.props.title}\n${this.props.description}` : this.props.title}
99
position={{ lat: this.props.coordinate.latitude, lng: this.props.coordinate.longitude }}
1010
/>
1111
);

0 commit comments

Comments
 (0)