MCPcopy Create free account
hub / github.com/react-native-maps/react-native-maps / render

Method render

example/src/examples/Callouts.tsx:74–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72 }
73
74 render() {
75 const {region, markers} = this.state;
76 return (
77 <View style={styles.container}>
78 <MapView
79 provider={this.props.provider}
80 style={styles.map}
81 initialRegion={region}
82 zoomTapEnabled={false}>
83 <Marker
84 ref={ref => {
85 this.marker1 = ref;
86 }}
87 coordinate={markers[0].coordinate}
88 title="This is a native view"
89 description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation"
90 />
91 <Marker coordinate={markers[1].coordinate}>
92 <Callout style={styles.plainView}>
93 <View>
94 <Text>This is a plain view</Text>
95 </View>
96 </Callout>
97 </Marker>
98 <Marker
99 coordinate={markers[2].coordinate}
100 calloutOffset={{x: -8, y: 28}}
101 calloutAnchor={{x: 0.5, y: 0.4}}
102 ref={ref => {
103 this.marker2 = ref;
104 }}>
105 <Callout
106 alphaHitTest
107 tooltip
108 onPress={_ => {
109 Alert.alert('callout pressed');
110 }}
111 style={styles.customView}>
112 <CustomCallout>
113 <Text>{`This is a custom callout bubble view ${this.state.cnt}`}</Text>
114 {Platform.OS === 'ios' && (
115 <CalloutSubview
116 onPress={() => {
117 this.setState({cnt: this.state.cnt + 1}, () => {
118 this.marker2.redrawCallout();
119 });
120 }}
121 style={[styles.calloutButton]}>
122 <Text>Click me</Text>
123 </CalloutSubview>
124 )}
125 </CustomCallout>
126 </Callout>
127 </Marker>
128 <Marker
129 ref={ref => {
130 this.marker4 = ref;
131 }}

Callers

nothing calls this directly

Calls 3

showMethod · 0.95
hideMethod · 0.95
redrawCalloutMethod · 0.65

Tested by

no test coverage detected