@@ -8,7 +8,8 @@ import { action } from '@storybook/addon-actions';
8
8
storiesOf ( 'MapView' , module )
9
9
. add ( 'basic' , ( ) => (
10
10
< View style = { styles . container } >
11
- < MapView region = { { latitude : 48.86 , longitude : 2.34 } } />
11
+ < MapView defaultZoom = { 15 } region = { { latitude : 48.86 , longitude : 2.34 } } />
12
+ < MapView defaultZoom = { 10 } region = { { latitude : 48.86 , longitude : 2.34 } } />
12
13
</ View >
13
14
) )
14
15
. add ( 'onRegionChangeComplete' , ( ) => (
@@ -48,26 +49,47 @@ storiesOf('MapView', module)
48
49
storiesOf ( 'Marker' , module )
49
50
. add ( 'basic' , ( ) => (
50
51
< View style = { styles . container } >
51
- < MapView region = { { latitude : 48.88 , longitude : 2.32 } } >
52
+ < MapView ref = { map => ( this . map = map ) } region = { { latitude : 48.88 , longitude : 2.32 } } >
52
53
< MapView . Marker
53
54
title = "BAM"
54
55
description = "Shape the future of mobile with us"
55
56
coordinate = { { latitude : 48.8828463 , longitude : 2.3229091 } }
56
- onPress = { action ( 'onPresss' ) }
57
+ onPress = { ( ) => {
58
+ this . map . animateToRegion ( {
59
+ latitude : 48.8828463 ,
60
+ longitude : 2.3229091 ,
61
+ latitudeDelta : 0.1 ,
62
+ longitudeDelta : 0.1 ,
63
+ } ) ;
64
+ } }
65
+ />
66
+ < MapView . Marker
67
+ title = "BAM"
68
+ description = "Shape the future of mobile with us"
69
+ coordinate = { { latitude : 48.8828463 , longitude : 2.3 } }
70
+ onPress = { ( ) => {
71
+ this . map . animateCamera ( {
72
+ zoom : 20 ,
73
+ center : {
74
+ lat : 48.8828463 ,
75
+ lng : 2.3 ,
76
+ } ,
77
+ } ) ;
78
+ } }
57
79
/>
58
80
</ MapView >
59
81
</ View >
60
82
) )
61
83
. add ( 'Callout' , ( ) => (
62
84
< View style = { styles . container } >
63
- < MapView region = { { latitude : 48.88 , longitude : 2.32 } } >
85
+ < MapView ref = { map => ( this . map = map ) } region = { { latitude : 48.88 , longitude : 2.32 } } >
64
86
< MapView . Marker
65
87
title = "BAM"
66
88
ref = { marker => ( this . marker = marker ) }
67
89
description = "Shape the future of mobile with us"
68
90
coordinate = { { latitude : 48.8828463 , longitude : 2.3229091 } }
69
91
onPress = { ( ) => {
70
- this . marker . showCallout ( ) ;
92
+ this . marker1 . showCallout ( ) ;
71
93
} } >
72
94
< MapView . Callout onPress = { action ( 'onPress callout' ) } >
73
95
< View style = { { padding : 10 } } >
0 commit comments