UNPKG

@react-native-kakao/map

Version:

React Native Kakao Map SDK

48 lines 1.84 kB
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import { forwardRef, useImperativeHandle, useMemo } from 'react'; import { kAssert } from '@react-native-kakao/core'; import NativeKakaoMapComponent from '../spec/RNCKakaoMapViewNativeComponent'; import { Const } from '../util/Const'; import { nullCamera } from '../util/Util'; const KakaoMapView = /*#__PURE__*/forwardRef(({ baseMapType = 'map', buildingScale = 0.5, poiEnabled = true, poiClickable = true, poiScale = 'regular', language, overlays, camera: cameraProp, cameraMinLevel = Const.nullNumber, cameraMaxLevel = Const.nullNumber, cameraAnimationDuration = 0, isShowScaleBar = true, isShowCompass = true, ...rest }, ref) => { kAssert(buildingScale >= 0 && buildingScale <= 1, '[KakaoMapView] buildingScale range should be 0..1'); useImperativeHandle(ref, () => ({}), []); const camera = useMemo(() => { return { ...nullCamera, ...cameraProp }; }, [cameraProp]); return /*#__PURE__*/React.createElement(NativeKakaoMapComponent, _extends({ baseMapType: baseMapType, buildingScale: buildingScale, camera: camera, cameraMinLevel: cameraMinLevel, cameraMaxLevel: cameraMaxLevel, cameraAnimationDuration: cameraAnimationDuration, poiEnabled: poiEnabled, poiClickable: poiClickable, poiScale: poiScale, language: language, overlays: overlays, isShowScaleBar: isShowScaleBar, isShowCompass: isShowCompass }, rest)); }); export { KakaoMapView }; //# sourceMappingURL=KakaoMapView.js.map