-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkakaomap.js
More file actions
42 lines (35 loc) · 992 Bytes
/
kakaomap.js
File metadata and controls
42 lines (35 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react'
import { requireNativeComponent } from 'react-native'
import PropTypes from 'prop-types'
const Map = requireNativeComponent('KakaoMap', MapView)
const MapView = props => {
const _onMapDragEnded = event => {
if (!props.onMapDragEnded) {
return
}
props.onMapDragEnded(event.nativeEvent)
}
const _onMarkerSelect = event => {
if (!props.onMapDragEnded) {
return
}
props.onMarkerSelect(event.nativeEvent)
}
const _onMapTouch = event => {
if (!props.onMapTouch) {
return
}
props.onMapTouch(event.nativeEvent)
}
return <Map {...props} onMapDragEnded={_onMapDragEnded} onMarkerSelect={_onMarkerSelect} onMapTouch={_onMapTouch} />
}
MapView.propTypes = {
markers: PropTypes.any,
initialRegion: PropTypes.any,
isTracking: PropTypes.bool,
selectPoiTag: PropTypes.string,
onMapDragEnded: PropTypes.func,
onMarkerSelect: PropTypes.func,
onMapTouch: PropTypes.func,
}
export default MapView