[React Native] react native maps
- this ordered seed list will be replaced by the toc
1. <MapView />
Component API
๐ย Props
Prop | Type | Default | Note | ย | ย | ย |
---|---|---|---|---|---|---|
provider | string | ย | ๋งต ๊ณต๊ธ์๋ฅผ ์ค์ ํฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ Google Maps์ด๋ฉฐ, google ๋๋ apple๋ก ์ค์ ํ ์ ์์ต๋๋ค. | ย | ย | ย |
region | Region | ย | ์ด๊ธฐ ์ง์ญ์ ์ค์ | ย | ย | ย |
initialRegion | Region | ย | region๊ณผ ๋์ผํฉ๋๋ค. region์ด ์ค์ ๋๋ฉด ๋ฌด์๋ฉ๋๋ค. | ย | ย | ย |
camera | Camera | ย | ์ด๊ธฐ ์นด๋ฉ๋ผ ์์น์ ์ค ๋ ๋ฒจ์ ์ค์ ํฉ๋๋ค. | ย | ย | ย |
initialCamera | Camera | ย | camera์ ๋์ผํฉ๋๋ค. camera๊ฐ ์ค์ ๋๋ฉด ๋ฌด์๋ฉ๋๋ค. | ย | ย | ย |
mapPadding | EdgePadding | ย | ๋งต ํจ๋ฉ ๊ฐ์ ์ค์ | ย | ย | ย |
paddingAdjustmentBehavior | โalwaysโ | โautomaticโ | โneverโ | โneverโ | paddingAdjustmentBehavior ์์ฑ์ ์ง๋๋ฅผ ๋ํํ๋ ์ปจํ ์ด๋์ ํจ๋ฉ ์กฐ์ ๋ฐฉ๋ฒ์ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. ์ด ์์ฑ์ iOS ๊ธฐ๊ธฐ์์๋ง ์ง์ | ย |
liteMode | Boolean | false | ๋งต ๋ผ์ดํธ ๋ชจ๋๋ฅผ ์ฌ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
mapType | String | โstandardโ | ๋งต ํ์ ์ ์ค์ ํฉ๋๋ค. standard, satellite, hybrid ์ค ํ๋๋ฅผ ์ฌ์ฉ | ย | ย | ย |
customMapStyle | Array | ย | ๋งต์ ์ฌ์ฉ์ ์ ์ ์คํ์ผ์ ์ค์ ํฉ๋๋ค. | ย | ย | ย |
userInterfaceStyle | โlightโ | โdarkโ | ย | iOS ๊ธฐ๊ธฐ์์ ์ง๋์ ํ ๋ง๋ฅผ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ. | ย | ย |
showsUserLocation | Boolean | false | ์ฌ์ฉ์ ์์น๋ฅผ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ NOTE: You need runtime location permissions prior to setting this to true, otherwise it is going to fail silently! Checkout the excellent https://github.com/zoontek/react-native-permissions for this. | ย | ย | ย |
userLocationPriority | โbalancedโ | โhighโ | โlowโ | โpassiveโ | โhighโ | ์ฌ์ฉ์ ์์น ์ ๋ฐ์ดํธ์ ์ฐ์ ์์๋ฅผ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. ์ด ์์ฑ์ showsUserLocation ์์ฑ์ด true๋ก ์ค์ ๋์ด ์์ ๋๋ง ์ ํจ See Google APIs documentation. Note: Android only. |
userLocationUpdateInterval | Number | 5000 | mapView ์ปดํฌ๋ํธ๊ฐ ์ฌ์ฉ์์ ์์น๋ฅผ ์ฃผ๊ธฐ์ ์ผ๋ก ๊ฐฑ์ ํ๋ ๊ฐ๊ฒฉ์ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. ์ด ์์ฑ์ showsUserLocation ์์ฑ์ด true๋ก ์ค์ ๋์ด ์์ ๋๋ง ์ ํจ See Google APIs documentation. Note: Android only. | ย | ย | ย |
userLocationFastestInterval | Number | 5000 | ์ฌ์ฉ์์ ์์น๋ฅผ ๊ฐฑ์ ํ๋ ์ต์ ๊ฐ๊ฒฉ์ ์ค์ . See https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html. Note: Android only. | ย | ย | ย |
userLocationAnnotationTitle | String | ย | ์ฌ์ฉ์ ์์น ๋ง์ปค ์ ๋ชฉ์ ์ค์ . Note: iOS only. | ย | ย | ย |
followsUserLocation | Boolean | false | ๋งต ๋ทฐ๋ฅผ ์ฌ์ฉ์์ ํ์ฌ ์์น๋ฅผ ์ค์ฌ์ผ๋ก ์๋์ผ๋ก ์ด๋์ํค๋๋ก ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ Note: Apple Maps only. | ย | ย | ย |
userLocationCalloutEnabled | Boolean | false | ์ฌ์ฉ์์ ์์น๋ฅผ ํ์ํ๋ ๋ง์ปค์ ๋ํ ์ฝ์์(๋งํ์ ) ๊ธฐ๋ฅ์ ํ์ฑํ ๋๋ ๋นํ์ฑํํ๋ ๋ฐ ์ฌ์ฉ Note: Apple Maps only. | ย | ย | ย |
showsMyLocationButton | Boolean | true | ๋์ ์์น ๋ฒํผ์ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
showsPointsOfInterest | Boolean | true | ๊ด์ฌ ์ง์ ์ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
showsCompass | Boolean | true | ๋์นจ๋ฐ์ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
showsScale | Boolean | true | ๋งต ์ค์ผ์ผ์ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ . Note: Apple Maps only. | ย | ย | ย |
showsBuildings | Boolean | true | ๊ฑด๋ฌผ์ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
showsTraffic | Boolean | false | ๊ตํต ์ ๋ณด๋ฅผ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
showsIndoors | Boolean | true | ์ค๋ด ์ง๋๋ฅผ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
showsIndoorLevelPicker | Boolean | false | ์ค๋ด ์ง๋ ๋ ๋ฒจ ์ ํ๊ธฐ๋ฅผ ๋ณด์ฌ์ค์ง ์ฌ๋ถ๋ฅผ ์ค์ (either Android or iOS with PROVIDER_GOOGLE). | ย | ย | ย |
zoomEnabled | Boolean | true | ๋งต ์ค์ ํ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
zoomTapEnabled | Boolean | true | zoomTapEnabled ์์ฑ์ ๋๋ธ ํญ(double-tap) ์ ์ค์ฒ๋ฅผ ์ฌ์ฉํ์ฌ ์ง๋๋ฅผ ํ๋ํ๋ ๊ธฐ๋ฅ์ ํ์ฑํ ๋๋ ๋นํ์ฑํํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
zoomControlEnabled | Boolean | true | zoomControlEnabled ์์ฑ์ ์๋๋ก์ด๋ ๊ธฐ๊ธฐ์์ ํ๋ฉด์ ํ์๋๋ ์ค ์ปจํธ๋กค๋ฌ์ ํ์ฑํ ์ฌ๋ถ๋ฅผ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
minZoomLevel | Number | 0 | minZoomLevel ์์ฑ์ ์ง๋๊ฐ ํ์ํ๋ ์ต์ ์ค ๋ ๋ฒจ์ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋. | ย | ย | ย |
maxZoomLevel | Number | 20 | maxZoomLevel ์์ฑ์ ์ง๋๊ฐ ํ์ํ๋ ์ต๋ ์ค ๋ ๋ฒจ์ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ๋. | ย | ย | ย |
rotateEnabled | Boolean | true | ๋งต ํ์ ์ ํ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
scrollEnabled | Boolean | true | ๋งต ์คํฌ๋กค์ ํ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
scrollDuringRotateOrZoomEnabled | Boolean | true | ๋งต ํผ์น ์ ์ค์ฒ๋ฅผ ํ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
pitchEnabled | Boolean | true | pitchEnabled ์์ฑ์ ์ง๋๋ฅผ ๊ธฐ์ธ์ด๋(pitching) ๊ธฐ๋ฅ์ ํ์ฑํ ๋๋ ๋นํ์ฑํํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
toolbarEnabled | Boolean | true | Android only If false ๋งต ํด๋ฐ๋ฅผ ํ์ํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ , make sure to https://github.com/react-native-maps/react-native-maps/issues/4403#issuecomment-1219856534 | ย | ย | ย |
cacheEnabled | Boolean | false | ๋งต ํ์ผ ์บ์ฑ์ ํ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
loadingEnabled | Boolean | false | ๋งต ๋ก๋ฉ ์ค์ธ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
loadingIndicatorColor | Color | #606060 | ๋งต ๋ก๋ฉ ์ค ๋ฐฐ๊ฒฝ์์ ์ค์ , default to #606060. | ย | ย | ย |
loadingBackgroundColor | Color | #FFFFFF | ๋งต ๋ก๋ฉ ์ค ์ธ๋์ผ์ดํฐ ์์์ ์ค์ , default to #FFFFFF. | ย | ย | ย |
tintColor | color | null | tintColor ์์ฑ์ iOS ๊ธฐ๊ธฐ์์ ์ง๋์ ํดํธ(tint) ์์์ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
moveOnMarkerPress | Boolean | true | ๋ง์ปค๋ฅผ ๋๋ ์ ๋ ๋งต์ ์ด๋ํ ์ง ์ฌ๋ถ๋ฅผ ์ค์ | ย | ย | ย |
legalLabelInsets | EdgeInsets | ย | ๋งต ๋ ์ด๋ธ์์ ๋ฒ์ด๋ ์ฌ๋ฐฑ์ ์ค์ | ย | ย | ย |
kmlSrc | string | ย | kmlSrc ์์ฑ์ KML(Keyhole Markup Language) ํ์ผ์ URL์ ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
compassOffset | Point | ย | compassOffset ์์ฑ์ ์๋๋ก์ด๋ ๊ธฐ๊ธฐ์์ ๋์นจ๋ฐ(compass) ๋ชจ์์ ์์ด์ฝ์ ์์น๋ฅผ ์กฐ์ ํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
isAccessibilityElement | Boolean | false | isAccessibilityElement ์์ฑ์ ์ง๋๊ฐ ์ ๊ทผ์ฑ(accessibility) ์์๋ก ์ธ์๋๋๋ก ์ค์ ํ๋ ๋ฐ ์ฌ์ฉ | ย | ย | ย |
๐Events
To access event data, you will need to use e.nativeEvent
. For example, onPress={e => console.log(e.nativeEvent)}
will log the entire event object to your console.
Event Name | Returns | Notes |
---|---|---|
onMapReady | ย | onMapReady ์์ฑ์ ์ง๋๊ฐ ๋ ๋๋ง๋๊ณ ์ค๋น๋ ํ์ ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onKmlReady | KmlContainer | KML ๋ ์ด์ด๊ฐ ์ค๋น๋์์ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onRegionChange | (Region, {isGesture: boolean}) | ์ง์ญ ๋ณ๊ฒฝ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ ๋ ์คํํ ํจ์๋ฅผ ์ค์ ํฉ๋๋ค. |
onRegionChangeComplete | (Region, {isGesture: boolean}) | ์ง์ญ ๋ณ๊ฒฝ์ด ์๋ฃ๋ ๋ ์คํํ ํจ์๋ฅผ ์ค์ ํฉ๋๋ค. |
onUserLocationChange | { coordinate: Location } | ์ฌ์ฉ์ ์์น๊ฐ ๋ณ๊ฒฝ๋ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onPress | { coordinate: LatLng, position: Point } | ๋งต์ด ๋๋ ธ์ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onDoublePress | { coordinate: LatLng, position: Point } | onDoublePress ์์ฑ์ ์ฌ์ฉ์๊ฐ ์ง๋๋ฅผ ๋๋ธ ํญ(double tap)ํ๋ ์ด๋ฒคํธ๋ฅผ ์ฒ๋ฆฌํ๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onPanDrag | { coordinate: LatLng, position: Point } | onPanDrag ์์ฑ์ ์ฌ์ฉ์๊ฐ ์ง๋๋ฅผ ๋๋๊ทธํ๊ฑฐ๋ ํฐ์นํ๊ณ ์์ ๋ ์ง๋์ ์ค์ฌ ์ขํ๋ฅผ ๊ณ์ ์ ๋ฐ์ดํธํ๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onPoiClick | { coordinate: LatLng, position: Point, placeId: string, name: string } | onPoiClick ์์ฑ์ ์ฌ์ฉ์๊ฐ ์ง๋ ์์ POI(Point of Interest)๋ฅผ ํด๋ฆญํ ๋ ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onLongPress | { coordinate: LatLng, position: Point } | ๋งต์ด ๊ธธ๊ฒ ๋๋ ธ์ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onMarkerPress | ย | ๋ง์ปค๊ฐ ๋๋ ธ์ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onMarkerSelect | ย | ๋ง์ปค๊ฐ ์ ํ๋ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onMarkerDeselect | ย | ๋ง์ปค ์ ํ์ด ํด์ ๋ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onCalloutPress | ย | ๋ง์ปค ์ฝ์์์ด ๋๋ ธ์ ๋ ์คํํ ํจ์๋ฅผ ์ค์ |
onMarkerDragStart | { coordinate: LatLng, position: Point } | onMarkerDragStart ์์ฑ์ ์ฌ์ฉ์๊ฐ ๋ง์ปค๋ฅผ ๋๋๊ทธํ ๋ ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onMarkerDrag | { coordinate: LatLng, position: Point } | onMarkerDrag ์์ฑ์ ๋ง์ปค๋ฅผ ๋๋๊ทธํ๋ฉด ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onMarkerDragEnd | { coordinate: LatLng, position: Point } | onMarkerDragEnd ์์ฑ์ ์ฌ์ฉ์๊ฐ ๋ง์ปค ๋๋๊ทธ๋ฅผ ์๋ฃํ๊ณ ๋ง์ปค๋ฅผ ๋์ ๋ ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onIndoorLevelActivated | IndoorLevel | onIndoorLevelActivated ์์ฑ์ ์ฌ์ฉ์๊ฐ ์ง๋์ ์ค๋ด ๋ ๋ฒจ์ ๋ณ๊ฒฝํ ๋ ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
onIndoorBuildingFocused | IndoorBuilding | onIndoorBuildingFocused ์์ฑ์ ์ฌ์ฉ์๊ฐ ์ค๋ด ๊ฑด๋ฌผ์ ํด๋ฆญํ์ฌ ํฌ์ปค์ค๋ฅผ ๋ง์ถ ๋ ํธ์ถ๋๋ ์ฝ๋ฐฑ ํจ์๋ฅผ ์ง์ ํ๋ ๋ฐ ์ฌ์ฉ |
๐ย Methods
Method Name | Arguments | Notes |
---|---|---|
getCamera | ย | getCamera ์์ฑ์ ํ์ฌ ์ง๋ ๋ทฐ์ ์นด๋ฉ๋ผ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฉ์๋. |
getCamera ๋ฉ์๋๋ Promise ๊ฐ์ฒด๋ฅผ ๋ฐํํ๋ฉฐ, ์ด Promise๋ ์นด๋ฉ๋ผ ์ ๋ณด๋ฅผ ๋ด์ ๊ฐ์ฒด๋ฅผ resolveํฉ๋๋ค. ์นด๋ฉ๋ผ ์ ๋ณด ๊ฐ์ฒด์๋ ํ์ฌ ์ง๋ ๋ทฐ์ ์ค์ฌ ์ขํ, ์ค ๋ ๋ฒจ, ๊ธฐ์ธ๊ธฐ, ๋ฐฉํฅ ๋ฑ์ด ํฌํจ | ย | ย |
animateCamera | camera: Camera, { duration: Number } | animateCamera ์์ฑ์ ์ง๋ ๋ทฐ์ ์นด๋ฉ๋ผ๋ฅผ ๋ถ๋๋ฝ๊ฒ ์ ๋๋ฉ์ด์ ํ์ฌ ์ด๋์ํค๋ ๋ฉ์๋ |
setCamera | camera: Camera, { duration: Number } | setCamera ์์ฑ์ ์ง๋ ๋ทฐ์ ์นด๋ฉ๋ผ๋ฅผ ์ฆ์ ๋ณ๊ฒฝํฉ๋๋ค. |
setCamera ๋ฉ์๋๋ ๋ค์๊ณผ ๊ฐ์ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฐ์ต๋๋ค:
camera: ๋ณ๊ฒฝํ ์นด๋ฉ๋ผ ์ ๋ณด๋ฅผ ๋ด์ ๊ฐ์ฒด ๋ณ๊ฒฝํ ์นด๋ฉ๋ผ ์ ๋ณด ๊ฐ์ฒด์๋ ๋ณ๊ฒฝํ ์ง๋ ๋ทฐ์ ์ค์ฌ ์ขํ, ์ค ๋ ๋ฒจ, ๊ธฐ์ธ๊ธฐ, ๋ฐฉํฅ ๋ฑ์ด ํฌํจ | | animateToRegion | region: Region, duration: Number | animateToRegion ์์ฑ์ ํ์ฌ ์ง๋ ๋ทฐ์ ์นด๋ฉ๋ผ๋ฅผ ๋ถ๋๋ฝ๊ฒ ์ ๋๋ฉ์ด์ ํ์ฌ ์ง์ ํ ์ง์ญ์ ๋ณด์ฌ์ฃผ๋ ๋ฉ์๋์ ๋๋ค.
animateToRegion ๋ฉ์๋๋ ๋ค์๊ณผ ๊ฐ์ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฐ์ต๋๋ค:
region: ์ง๋ ๋ทฐ๊ฐ ์ด๋ํ ์ง์ญ์ ๋ํ๋ด๋ ๊ฐ์ฒด duration: ์ ๋๋ฉ์ด์ ์งํ ์๊ฐ์ ๋ํ๋ด๋ ์ซ์ (๋ฐ๋ฆฌ์ด) ๋ณ๊ฒฝํ ์ง์ญ ์ ๋ณด ๊ฐ์ฒด์๋ ๋ณ๊ฒฝํ ์ง๋ ๋ทฐ์ ์ค์ฌ ์ขํ, ๊ฐ๋ก/์ธ๋ก ๋ฐฉํฅ ๊ฑฐ๋ฆฌ, ์ค ๋ ๋ฒจ ๋ฑ์ด ํฌํจ๋ฉ๋๋ค. | | getMapBoundaries | | Promise<{northEast: LatLng, southWest: LatLng}> | | setMapBoundaries | northEast: LatLng, southWest: LatLng | setMapBoundaries ์์ฑ์ ์ง๋ ๋ทฐ์ ๊ฒฝ๊ณ๋ฅผ ์ค์ ํ์ฌ, ์ด๋ฅผ ๋ฒ์ด๋ ์ง์ญ์ผ๋ก ์ด๋ํ์ง ๋ชปํ๋๋ก ํ๋ ๋ฉ์๋ | | setIndoorActiveLevelIndex | levelIndex: Number | setIndoorActiveLevelIndex ์์ฑ์ ์ง๋ ๋ทฐ์ ํ์๋๋ ์ค๋ด ์ง๋์ ํ์ฑ ๋ ๋ฒจ์ ๋ณ๊ฒฝ | | fitToElements | options: { edgePadding: EdgePadding, animated: Boolean } | fitToElements ์์ฑ์ ์ฃผ์ด์ง ๋ง์ปค, ๊ฒฝ๋ก, ๋ชจ์, ์์ญ ๋๋ ์ค๋ด ์ง๋์ ๋ชจ๋ ์๋ฆฌ๋จผํธ๊ฐ ๋ชจ๋ ๋ณด์ด๋๋ก ์ง๋๋ฅผ ํ๋ํ๊ฑฐ๋ ์ถ์ํฉ๋๋ค.
fitToElements ๋ฉ์๋๋ ๋ค์๊ณผ ๊ฐ์ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฐ์ต๋๋ค:
edgePadding: ์ง๋ ๊ฐ์ฅ์๋ฆฌ์ ์๋ฆฌ๋จผํธ ๊ฐ์ ํจ๋ฉ์ ๋ํ๋ด๋ ๊ฐ์ฒด์ ๋๋ค. ์ผ์ชฝ, ์ค๋ฅธ์ชฝ, ์์ชฝ ๋ฐ ์๋์ชฝ ๊ฐ์ฅ์๋ฆฌ๋ฅผ ํฌํจํ๋ ์์์ ํฌ๊ธฐ๋ฅผ ๋ํ๋ด๋ top, right, bottom, left ์์ฑ์ ๊ฐ์ง๋๋ค. ์ด ๊ฐ์ ์ค์ ํ์ง ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ธ { top: 0, right: 0, bottom: 0, left: 0 }์ด ์ฌ์ฉ๋ฉ๋๋ค.
animated: ์ ๋๋ฉ์ด์ ์ฌ๋ถ๋ฅผ ๋ํ๋ด๋ ๋ถ์ธ ๊ฐ์ ๋๋ค. ์ด ๊ฐ์ด true์ด๋ฉด ์ง๋๊ฐ ๋ถ๋๋ฝ๊ฒ ํ๋ ๋๋ ์ถ์๋๋ฉฐ, false์ด๋ฉด ์ฆ์ ํ๋ ๋๋ ์ถ์๋ฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ true์ ๋๋ค.
duration: ์ ๋๋ฉ์ด์ ์ง์ ์๊ฐ์ ๋ํ๋ด๋ ์ซ์์ ๋๋ค. animated ๊ฐ์ด true์ผ ๋๋ง ์ฌ์ฉ๋ฉ๋๋ค. ๊ธฐ๋ณธ๊ฐ์ 500์ ๋๋ค.
region: ์ง๋๊ฐ ๋ณด์ฌ์ค ์ง์ญ์ ์ง์ ํ๋ ๊ฐ์ฒด์ ๋๋ค. ์ด ๊ฐ์ด ์ง์ ๋๋ฉด ์๋ฆฌ๋จผํธ๊ฐ ํฌํจ๋ ์ง์ญ์ด ์๋ ์ด ์ง์ญ์ผ๋ก ํ๋ ๋๋ ์ถ์๋ฉ๋๋ค. | ย | ย | ย | ย |
ย | fitToSuppliedMarkers | markerIDs: String[], options: { edgePadding: EdgePadding, animated: Boolean } | fitToSuppliedMarkers?: Array | boolean - ์ง๋๋ฅผ ํ๋ / ์ถ์ํ์ฌ ์ง์ ๋ ๋ง์ปค๊ฐ ๋ชจ๋ ๋ณด์ด๋๋ก ์ค์ ํฉ๋๋ค. Array๋ก ์ ๋ฌ๋ ๋ง์ปค ID์ ๋ชฉ๋ก์ ํ์ํ๊ฑฐ๋ boolean ๊ฐ true๋ฅผ ์ฌ์ฉํ์ฌ ๋ชจ๋ ๋ง์ปค๊ฐ ๋ณด์ด๋๋ก ์ค์ ํฉ๋๋ค. |
ย | fitToCoordinates | coordinates: Array | fitToCoordinates?: Array | ย |
options?: { edgePadding?: EdgePadding, animated?: boolean } - ์ง๋ ํ๋ / ์ถ์์ ๋ํ ์ต์ ์ ์ค์ ํฉ๋๋ค. edgePadding ์์ฑ์ ์ง๋ ๊ฒฝ๊ณ์ ํ๋ฉด ๊ฒฝ๊ณ ๊ฐ์ ์ฌ๋ฐฑ์ ๋ํ๋ด๋ EdgePadding ๊ฐ์ฒด์ ๋๋ค. animated ์์ฑ์ ์ง๋ ํ๋ / ์ถ์๊ฐ ์ ๋๋ฉ์ด์ ์ผ๋ก ์งํ๋์ด์ผ ํ๋์ง ์ฌ๋ถ๋ฅผ ์ค์ ํฉ๋๋ค. animated ๊ฐ์ด ์๋ต๋๋ฉด ๊ธฐ๋ณธ๊ฐ์ true์ ๋๋ค. | ย | ย | ย | ย |
ย | addressForCoordinate | coordinate: LatLng | addressForCoordinate๋ MapView์์ ํน์ ์์น์ ์ฃผ์๋ฅผ ๊ฒ์ํ๋ ๋ฐ ์ฌ์ฉ๋. | ย |
์์ฑ๊ฐ addressForCoordinate?: (coordinate: LatLng) => void - ์ฃผ์๋ฅผ ๊ฒ์ํ ์ขํ๋ฅผ ๋ํ๋ด๋ LatLng ๊ฐ์ฒด๋ฅผ ์ธ์๋ก ์ฌ์ฉํ๋ ์ฝ๋ฐฑ ํจ์์ ๋๋ค. | | pointForCoordinate | coordinate: LatLng | pointForCoordinate?: (coordinate: LatLng) => void - ํ๋ฉด ์ขํ๋ฅผ ๊ฒ์ํ ์ขํ๋ฅผ ๋ํ๋ด๋ LatLng ๊ฐ์ฒด๋ฅผ ์ธ์๋ก ์ฌ์ฉํ๋ ์ฝ๋ฐฑ ํจ์์ ๋๋ค. | | coordinateForPoint | point: Point | coordinateForPoint?: (point: Point) => void - ๊ฒ์ํ ํ๋ฉด ์ขํ๋ฅผ ๋ํ๋ด๋ Point ๊ฐ์ฒด๋ฅผ ์ธ์๋ก ์ฌ์ฉํ๋ ์ฝ๋ฐฑ ํจ์์ ๋๋ค. | | getMarkersFrames | onlyVisible: Boolean | getMarkersFrames?: () => void - ์ง๋์ ํ์๋๋ ๋ชจ๋ ๋ง์ปค์ ํ๋ ์ ์ ๋ณด๋ฅผ ๊ฒ์ํ๋ ์ฝ๋ฐฑ ํจ์์ ๋๋ค. |
๐ย Types
type Region {
latitude: Number,
longitude: Number,
latitudeDelta: Number,
longitudeDelta: Number,
}
type Camera = {
center: {
latitude: number;
longitude: number;
};
pitch: number;
heading: number;
// Only on iOS MapKit, in meters. The property is ignored by Google Maps.
altitude: number;
// Only when using Google Maps.
zoom: number;
};
์๋(latitude)์ ๊ฒฝ๋(longitude)๋ ์๋ช ํ ๊ฒ์ด์ง๋ง, ์๋์ฐจ(latitudeDelta)์ ๊ฒฝ๋์ฐจ(longitudeDelta)๋ ๊ทธ๋ ์ง ์์ ์ ์์ต๋๋ค. developer.apple.com ์น์ฌ์ดํธ์์๋ โlatitudeDeltaโ ์์ฑ์ด ๋ค์๊ณผ ๊ฐ์ด ์ค๋ช ๋ฉ๋๋ค.
์ง๋์ ํ์ํ ๋จ๋ถ ๊ฑฐ๋ฆฌ(๋ ๋จ์)์ ์์ ๋๋ค. ๊ฒฝ๋ ๊ฑฐ๋ฆฌ๋ ์๋์ ๋ฐ๋ผ ๋ฌ๋ผ์ง์ง๋ง, ์๋ 1๋๋ ํญ์ ์ฝ 111ํฌ๋ก๋ฏธํฐ(69๋ง์ผ)์ ๋๋ค.
๋ง์ฝ ์ด๊ฒ์ด ์ถฉ๋ถํ์ง ์๋ค๋ฉด, stackoverflow์์ ์๊ฐ์ ์ธ ์ค๋ช ์ ์ฐพ์ ์ ์์ต๋๋ค.
์นด๋ฉ๋ผ(Camera)๋ฅผ ์ฌ์ฉํ ๋, iOS์ MapKit์ Google Maps๋ ๋์ด(height)๋ฅผ ์ง์ ํ๋ ๋ฐฉ๋ฒ์ด ๋ค๋ฆ ๋๋ค. ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์๋ ํฌ๋ก์ค ํ๋ซํผ ์ฑ์์ ์ค ๋ ๋ฒจ(zoom level)๊ณผ ๊ณ ๋(altitude)๋ฅผ ๋ชจ๋ ๋ฐ๋ก ์ง์ ํด์ผํฉ๋๋ค.
type LatLng {
latitude: Number,
longitude: Number,
}
type Location {
latitude: Number,
longitude: Number,
altitude: Number,
timestamp: Number, //Milliseconds since Unix epoch
accuracy: Number,
altitudeAccuracy: Number,
speed: Number,
}
type Point {
x: Number,
y: Number,
}
type Frame {
x: Number,
y: Number,
width: Number,
height: Number,
}
enum MapType : String {
"standard",
"satellite",
"hybrid",
"terrain" //Android only
}
type EdgePadding {
top: Number,
right: Number,
bottom: Number,
left: Number
}
type EdgeInsets {
top: Number,
left: Number,
bottom: Number,
right: Number
}
type Marker {
id: String,
coordinate: LatLng,
title: String,
description: String
}
type KmlContainer {
markers: [Marker]
}
type IndoorBuilding {
underground: boolean,
activeLevelIndex: Number,
levels: Array<IndoorLevel>,
}
type IndoorLevel {
index: Number,
name: String,
shortName: String,
}
type Address {
name: String,
thoroughfare: String,
subThoroughfare: String,
locality: String,
subLocality: String,
administrativeArea: String,
subAdministrativeArea: String,
postalCode: String,
countryCode: String,
country: String,
}