asata / react-native-daummap Goto Github PK
View Code? Open in Web Editor NEWreact-native용 Daum 지도
License: MIT License
react-native용 Daum 지도
License: MIT License
저는 windows 10, Visual Studio Code를 이용하고 있습니다.
sample 소스대로 따라했는데 안돼서 며칠째 삽질하고 있습니다 ㅠ.ㅠ
Android
2021-01-05 03:41:52.625 1011-1011/? E/SDAgentPackageStateReceiver: Not going to handle 'com.gmap_test'! 2021-01-05 03:41:52.636 5788-5788/? E/Friday_PackageManagerReceiver: This package will be replaced = com.gmap_test 2021-01-05 03:41:52.792 1011-1011/? E/SDAgentPackageStateReceiver: Not going to handle 'com.gmap_test'! 2021-01-05 03:41:53.859 8904-8904/? E/com.gmap_test: Unknown bits set in runtime_flags: 0x8000 2021-01-05 03:41:54.642 1011-1098/? E/WindowManager: win=Window{c513784 u0 Splash Screen com.gmap_test EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1248 com.android.server.wm.AppWindowToken.destroySurfaces:1229 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.WindowStateAnimator.onAnimationFinished:320 com.android.server.wm.WindowState.onAnimationFinished:5630 com.android.server.wm.-$$Lambda$yVRF8YoeNdTa8GR1wDStVsHu8xM.run:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0$SurfaceAnimator:100 2021-01-05 03:41:55.308 8904-8904/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.gmap_test, PID: 8904 java.lang.UnsatisfiedLinkError at net.daum.mf.map.n.api.NativeMapLibraryLoader.loadLibrary(NativeMapLibraryLoader.java:39) at net.daum.mf.map.n.api.NativeThread.<clinit>(NativeThread.java:6) at android.opengl.alt.GLSurfaceView.setRenderer(GLSurfaceView.java:302) at net.daum.android.map.MapView.init(MapView.java:43) at net.daum.android.map.MapView.<init>(MapView.java:55) at net.daum.mf.map.api.MapView.<init>(MapView.java:460) at com.teamsf.daummap.RNMapView.<init>(RNMapView.java:20) at com.teamsf.daummap.DaumMapManager.createViewInstance(DaumMapManager.java:52) at com.teamsf.daummap.DaumMapManager.createViewInstance(DaumMapManager.java:30) at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139) at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83) at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:261) at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:186) at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:911) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1028) at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:48) at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1088) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29) at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175) at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997) at android.view.Choreographer.doCallbacks(Choreographer.java:797) at android.view.Choreographer.doFrame(Choreographer.java:728) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) 2021-01-05 03:41:55.423 1011-1297/? E/InputDispatcher: channel '68fb4ea com.gmap_test/com.gmap_test.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 2021-01-05 03:41:55.441 1011-1763/? E/WindowManager: win=Window{68fb4ea u0 com.gmap_test/com.gmap_test.MainActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1248 com.android.server.wm.AppWindowToken.destroySurfaces:1229 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.-$$Lambda$01bPtngJg5AqEoOWfW3rWfV7MH4.accept:2 java.util.ArrayList.forEach:1262 com.android.server.wm.AppWindowToken.onAnimationFinished:3931 com.android.server.wm.AppWindowToken.commitVisibility:913
error Something went wrong while unlinking. Reason Cannot read property 'find' of undefined. Run CLI with --verbose flag for more details. TypeError: Cannot read property 'find' of undefined at removeFromProjectReferences (/Users/sanghyun/Documents/GitHub/gmap_test/node_modules/@react-native-community/cli-platform-ios/build/link/removeFromProjectReferences.js:30:53)
와 같은 오류가 발생되어 무시한 채 manual link 시도
5. MainApplication.java 부분에서
@Override protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); packages.add(new DaumMapPackage()); //I add this Line return packages; }
이 예시와 달라 위 주석과 같이 수정
6. 빌드 성공
7. 빌드 됨과 동시에 에러 발생하여 강제종료
8. 내용은 최상단 내용과 같음.
Invariant Violation: requireNativeComponent: "DaumMap" was not found in the UIManager.
react-native 0.56.0 환경, 안드로이드에서 작업하였고.
맵 렌더시에, GPS권한을 묻고, 허용을 하면 바로 앱이 강제종료 되어 버립니다.
혹시 짐작가는 문제가 있으신가요?
(디버그 메세지도 아무것도 찍히지 않아서, 어떤 정보를 드려야 할지 모르겠네요;)
I have this problem on Android when I wanna open the MapView.
Tried to use permissions API but the host Activity doesn't implement PermissionAwareActivity.
Do you know how to fix it. Thank you.
@ReactProp(name = "region")
public void setRegion(MapView mMapView, ReadableMap initialRegion) {
double latitude = initialRegion.hasKey("latitude") ? initialRegion.getDouble("latitude") : 36.143099;
double longitude = initialRegion.hasKey("longitude") ? initialRegion.getDouble("longitude") : 128.392905; mMapView.setMapCenterPoint(MapPoint.mapPointWithGeoCoord(latitude, longitude), true);
}
위 소스가 빠진 거 아닐까 싶어서 수정해서 사용 중입니다.
IOS는 잘 적용이 안되어서 (header 부분에서 못 찾거나 찾아도 실제로 적용이 안되는 문제) 그냥 소스를 해당 프로젝트로 옮기고 사용 중입니다.
유용한 프로젝트를 공유해주셔서 감사합니다.
Invariant Violation: requireNativeComponent: "DaumMap" was not found in the UIManager.
This error is located at:
in DaumMap (at react-native-daummap/index.js:54)
in DaumMapView (at App.js:9)
in RCTView (at View.js:44)
in App (at withExpoRoot.js:22)
in RootErrorBoundary (at withExpoRoot.js:21)
in ExpoRootComponent (at renderApplication.js:34)
in RCTView (at View.js:44)
in RCTView (at View.js:44)
in AppContainer (at renderApplication.js:33)
2021-01-05 03:41:52.625 1011-1011/? E/SDAgentPackageStateReceiver: Not going to handle 'com.gmap_test'!
2021-01-05 03:41:52.636 5788-5788/? E/Friday_PackageManagerReceiver: This package will be replaced = com.gmap_test
2021-01-05 03:41:52.792 1011-1011/? E/SDAgentPackageStateReceiver: Not going to handle 'com.gmap_test'!
2021-01-05 03:41:53.859 8904-8904/? E/com.gmap_test: Unknown bits set in runtime_flags: 0x8000
2021-01-05 03:41:54.642 1011-1098/? E/WindowManager: win=Window{c513784 u0 Splash Screen com.gmap_test EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1248 com.android.server.wm.AppWindowToken.destroySurfaces:1229 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.WindowStateAnimator.onAnimationFinished:320 com.android.server.wm.WindowState.onAnimationFinished:5630 com.android.server.wm.-$$Lambda$yVRF8YoeNdTa8GR1wDStVsHu8xM.run:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0$SurfaceAnimator:100
2021-01-05 03:41:55.308 8904-8904/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.gmap_test, PID: 8904
java.lang.UnsatisfiedLinkError
at net.daum.mf.map.n.api.NativeMapLibraryLoader.loadLibrary(NativeMapLibraryLoader.java:39)
at net.daum.mf.map.n.api.NativeThread.<clinit>(NativeThread.java:6)
at android.opengl.alt.GLSurfaceView.setRenderer(GLSurfaceView.java:302)
at net.daum.android.map.MapView.init(MapView.java:43)
at net.daum.android.map.MapView.<init>(MapView.java:55)
at net.daum.mf.map.api.MapView.<init>(MapView.java:460)
at com.teamsf.daummap.RNMapView.<init>(RNMapView.java:20)
at com.teamsf.daummap.DaumMapManager.createViewInstance(DaumMapManager.java:52)
at com.teamsf.daummap.DaumMapManager.createViewInstance(DaumMapManager.java:30)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:261)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:186)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:911)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1028)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:48)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1088)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997)
at android.view.Choreographer.doCallbacks(Choreographer.java:797)
at android.view.Choreographer.doFrame(Choreographer.java:728)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
2021-01-05 03:41:55.423 1011-1297/? E/InputDispatcher: channel '68fb4ea com.gmap_test/com.gmap_test.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2021-01-05 03:41:55.441 1011-1763/? E/WindowManager: win=Window{68fb4ea u0 com.gmap_test/com.gmap_test.MainActivity EXITING} destroySurfaces: appStopped=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.AppWindowToken.destroySurfaces:1248 com.android.server.wm.AppWindowToken.destroySurfaces:1229 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.-$$Lambda$01bPtngJg5AqEoOWfW3rWfV7MH4.accept:2 java.util.ArrayList.forEach:1262 com.android.server.wm.AppWindowToken.onAnimationFinished:3931 com.android.server.wm.AppWindowToken.commitVisibility:913
error Something went wrong while unlinking. Reason Cannot read property 'find' of undefined. Run CLI with --verbose flag for more details. TypeError: Cannot read property 'find' of undefined at removeFromProjectReferences (/Users/sanghyun/Documents/GitHub/gmap_test/node_modules/@react-native-community/cli-platform-ios/build/link/removeFromProjectReferences.js:30:53)
와 같은 오류가 발생되어 무시한 채 manual link 시도
5. MainApplication.java 부분에서
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new DaumMapPackage()); //I add this Line
return packages;
}
이 예시와 달라 위 주석과 같이 수정
2021-01-05 04:07:10.028 18263-18263/? E/com.gmap_test: Unknown bits set in runtime_flags: 0x8000
2021-01-05 04:07:10.681 18263-20222/com.gmap_test E/unknown:ReactNative: Exception in native call
java.lang.IllegalStateException: Native module DaumMap tried to override DaumMapModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.
at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:55)
at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1347)
at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1318)
at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1225)
at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:131)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1016)
at java.lang.Thread.run(Thread.java:919)
2021-01-05 04:07:10.858 18263-18263/com.gmap_test E/DecorView: mWindow.mActivityCurrentConfig is null
추가 에러
2021-01-05 04:12:56.910 20503-20503/com.gmap_test E/com.gmap_test: Unknown bits set in runtime_flags: 0x8000
2021-01-05 04:12:59.204 20503-24097/com.gmap_test E/OpenGLRenderer: ReliableSurface: perform returned an error
2021-01-05 04:12:59.249 20503-24138/com.gmap_test E/ReactNativeJNI: logMarker CREATE_REACT_CONTEXT_END
2021-01-05 04:12:59.249 20503-24137/com.gmap_test E/unknown:ReactNative: ReactInstanceManager.createReactContext: mJSIModulePackage null
2021-01-05 04:12:59.250 20503-24138/com.gmap_test E/ReactNativeJNI: logMarker RUN_JS_BUNDLE_START
2021-01-05 04:12:59.257 20503-24139/com.gmap_test E/unknown:ReactNative: ReactInstanceManager.attachRootViewToInstance()
2021-01-05 04:12:59.338 20503-24139/com.gmap_test E/unknown:ReactRootView: runApplication: call AppRegistry.runApplication
2021-01-05 04:12:59.397 20503-20503/com.gmap_test E/unknown:ReactNative: ReactInstanceManager.attachRootViewToInstance()
2021-01-05 04:12:59.399 20503-20503/com.gmap_test E/unknown:ReactRootView: runApplication: call AppRegistry.runApplication
2021-01-05 04:12:59.614 20503-24138/com.gmap_test E/ReactNativeJNI: logMarker RUN_JS_BUNDLE_END
2021-01-05 04:12:59.738 20503-20503/com.gmap_test E/net.daum.mf.map.n.api.NativeMapLibraryLoader: Can`t load DaumMapEngineApi.so file
2021-01-05 04:12:59.740 20503-20503/com.gmap_test E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.gmap_test, PID: 20503
java.lang.UnsatisfiedLinkError
at net.daum.mf.map.n.api.NativeMapLibraryLoader.loadLibrary(NativeMapLibraryLoader.java:39)
at net.daum.mf.map.n.api.NativeThread.<clinit>(NativeThread.java:6)
at android.opengl.alt.GLSurfaceView.setRenderer(GLSurfaceView.java:302)
at net.daum.android.map.MapView.init(MapView.java:43)
at net.daum.android.map.MapView.<init>(MapView.java:55)
at net.daum.mf.map.api.MapView.<init>(MapView.java:460)
at com.teamsf.daummap.RNMapView.<init>(RNMapView.java:20)
at com.teamsf.daummap.DaumMapManager.createViewInstance(DaumMapManager.java:52)
at com.teamsf.daummap.DaumMapManager.createViewInstance(DaumMapManager.java:30)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:261)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:186)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:911)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1028)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:48)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1088)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:997)
at android.view.Choreographer.doCallbacks(Choreographer.java:797)
at android.view.Choreographer.doFrame(Choreographer.java:728)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:984)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
문서 보고 object array형태로 MapView의 markers prop에 전달하는거라고 추측해서
<MapView
initialRegion={{
latitude: 37.5030682,
longitude: 127.0222213,
zoomLevel: 2,
}}
mapType={'Standard'}
style={{width: 320, height: 400 }}
markers={[
{latitude: 37.5030682, longitude: 127.0222213, title: '테스트', draggable: true},
]}
/>
이런식으로 넣어봤는데 마커가 뜨지 않네요.
사용법이 틀린건가요?
안녕하세요. 다음맵 패키지를 iOS 에 세팅하던 중 에러가 발생했는데
혼자 해결이 안되서 글 올립니다.
에러 내용
node_modules/react-native-daummap/ios/DaumMap/DaumMap.m:3:9: fatal error: 'DaumMap/MTMapView.h' file not found
#import <DaumMap/MTMapView.h>
iOS 프로젝트 세팅
Framework Search paths : $(PROJECT_DIR)/DaumMap.embeddedframework (non-recursive)
Header Search paths : $(SRCROOT)/../node_modules/react-native-daummap/ios/DaumMap
#4 이문제와 관련된 문제인지는 모르겠습니다.
빌드환경:
xcode: 10.1
map-sdk-version: 1.3.1
에뮬레이터(아이폰SE - iOS12.1)
디바이스(아이폰X - iOS12.1)
"react": "16.6.1",
"react-native": "0.57.7",
지도가 스크롤이 되지 않으며 덜덜 떨리는 현상이 있습니다.
좋은 라이브러리를 만들어 주셔서 감사합니다.
며칠동안 삽질했는데 지도 화면으로 이동하면 앱이 죽네요 삭제하고 딴거 씁시다
ScrollView 안에 MapView를 넣으면, MapView가 스크롤이 되지않습니다.
확인부탁드립니다.
xcode 10 버전에서 빌드시 libstdc++.6.dylib 파일이 없어 오류 발생
https://devtalk.kakao.com/t/xcode-10-beta-libstdc-6-dylib/51858/3
Could you please add a sample daum-map application?
I still cannot integrate the map to a clean application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.