Skip to content

Commit 8496a9b

Browse files
author
Aurore
committed
Add onPress props
1 parent 2b2288e commit 8496a9b

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The supported components are `MapView` and `MapView.Marker`.
4242
- The supported events are:
4343
- `onRegionChange`
4444
- `onRegionChangeComplete`
45+
- `onPress`
4546

4647
`MapView.Marker`:
4748
- The supported props are:

docs/stories/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ storiesOf('MapView', module)
99
.add('basic', () => <MapView region={{ latitude: 48.86, longitude: 2.34 }} />)
1010
.add('onRegionChangeComplete', () => (
1111
<View>
12-
<MapView region={{ latitude: 48.86, longitude: 2.34 }} onRegionChangeComplete={action('new coordinates')} />
12+
<MapView
13+
region={{ latitude: 48.86, longitude: 2.34 }}
14+
onRegionChangeComplete={action('onRegionChangeComplete toggled')}
15+
/>
1316
</View>
14-
));&
15-
17+
))
18+
.add('onPress', () => (
19+
<View>
20+
<MapView region={{ latitude: 48.86, longitude: 2.34 }} onPress={action('onPress toggled')} />
21+
</View>
22+
));
1623
storiesOf('Marker', module).add('basic', () => (
1724
<MapView region={{ latitude: 48.88, longitude: 2.32 }}>
1825
<MapView.Marker title="BAM" coordinate={{ latitude: 48.8828463, longitude: 2.3229091 }} />

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class MapView extends Component {
3636
onDragStart={!!this.props.onRegionChange && this.props.onRegionChange}
3737
onDragEnd={this.onDragEnd}
3838
defaultZoom={15}
39+
onClick={this.props.onPress}
3940
>
4041
{this.props.children}
4142
</GoogleMapContainer>

0 commit comments

Comments
 (0)