├── .gitattributes ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── ReactNativeKakaoMaps.podspec ├── TROUBLESHOOTING.md ├── android ├── build.gradle ├── gradlew ├── gradlew.bat ├── libs │ └── libDaumMapAndroid.jar └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── jiggag │ │ └── rnkakaomaps │ │ ├── Constants.java │ │ ├── KakaoMapFragment.java │ │ ├── KakaoMapManager.java │ │ └── KakaoMapPackage.java │ ├── jniLibs │ ├── arm64-v8a │ │ └── libDaumMapEngineApi.so │ ├── armeabi-v7a │ │ └── libDaumMapEngineApi.so │ └── armeabi │ │ └── libDaumMapEngineApi.so │ └── res │ ├── layout │ └── kakao_map_view.xml │ └── values │ └── strings.xml ├── example.png ├── example ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── Gemfile ├── __tests__ │ └── App-test.js ├── _bundle │ └── config ├── _node-version ├── _ruby-version ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── jiggag │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── jiggag │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── newarchitecture │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ ├── components │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ └── modules │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ ├── jni │ │ │ ├── CMakeLists.txt │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ ├── MainApplicationModuleProvider.h │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ ├── MainComponentsRegistry.cpp │ │ │ ├── MainComponentsRegistry.h │ │ │ └── OnLoad.cpp │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── custom_image.png ├── index.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── RNStarter.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── _xcode.env │ ├── custom_image.png │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m ├── metro.config.js ├── package.json └── yarn.lock ├── index.d.ts ├── index.js ├── ios ├── DaumMap.embeddedframework │ ├── DaumMap.framework │ │ ├── DaumMap │ │ ├── Headers │ │ │ ├── MTMapCameraUpdate.h │ │ │ ├── MTMapCircle.h │ │ │ ├── MTMapGeometry.h │ │ │ ├── MTMapLocationMarkerItem.h │ │ │ ├── MTMapPOIItem.h │ │ │ ├── MTMapPolyline.h │ │ │ ├── MTMapReverseGeoCoder.h │ │ │ └── MTMapView.h │ │ ├── Info.plist │ │ ├── copyright.png │ │ ├── daum_copyright.png │ │ ├── daum_th_line.png │ │ ├── detail_button.png │ │ ├── info_box.png │ │ ├── info_box_tail.png │ │ ├── map_pin.png │ │ ├── map_pin@3x.png │ │ ├── map_pin_custom.png │ │ ├── map_pin_custom@3x.png │ │ ├── map_pin_red.png │ │ ├── map_pin_red@3x.png │ │ ├── map_pin_shadow.png │ │ ├── map_pin_shadow@3x.png │ │ ├── map_pinup.png │ │ ├── map_pinup@3x.png │ │ ├── map_pinup_custom.png │ │ ├── map_pinup_custom@3x.png │ │ ├── map_present.png │ │ ├── map_present_background_update.png │ │ ├── map_present_direction.png │ │ ├── map_present_tracking.png │ │ ├── noimage.png │ │ ├── noimage256.png │ │ ├── point_sprite.png │ │ ├── shadow_balloon.png │ │ └── th_line.png │ └── Resources │ │ ├── Headers │ │ ├── copyright.png │ │ ├── daum_copyright.png │ │ ├── daum_th_line.png │ │ ├── detail_button.png │ │ ├── info_box.png │ │ ├── info_box_tail.png │ │ ├── map_pin.png │ │ ├── map_pin@3x.png │ │ ├── map_pin_custom.png │ │ ├── map_pin_custom@3x.png │ │ ├── map_pin_red.png │ │ ├── map_pin_red@3x.png │ │ ├── map_pin_shadow.png │ │ ├── map_pin_shadow@3x.png │ │ ├── map_pinup.png │ │ ├── map_pinup@3x.png │ │ ├── map_pinup_custom.png │ │ ├── map_pinup_custom@3x.png │ │ ├── map_present.png │ │ ├── map_present_background_update.png │ │ ├── map_present_direction.png │ │ ├── map_present_tracking.png │ │ ├── noimage.png │ │ ├── noimage256.png │ │ ├── point_sprite.png │ │ ├── shadow_balloon.png │ │ └── th_line.png ├── KakaoMapManager.m ├── MapViewController.h ├── MapViewController.m └── RnKakaoMaps.xcodeproj │ └── project.pbxproj └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # OSX 3 | # 4 | .DS_Store 5 | 6 | # node.js 7 | # 8 | node_modules/ 9 | npm-debug.log 10 | yarn-error.log 11 | 12 | 13 | # Xcode 14 | # 15 | build/ 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | xcuserdata 25 | *.xccheckout 26 | *.moved-aside 27 | DerivedData 28 | *.hmap 29 | *.ipa 30 | *.xcuserstate 31 | project.xcworkspace 32 | 33 | 34 | # Android/IntelliJ 35 | # 36 | build/ 37 | .idea 38 | .gradle 39 | local.properties 40 | *.iml 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | 47 | android/.settings/org.eclipse.buildship.core.prefs 48 | android/.project 49 | .env 50 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example/ 2 | .env 3 | .gitattributes 4 | .project 5 | .idea 6 | .gradle 7 | .settings 8 | local.properties 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 jiggag 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## @jiggag/react-native-kakao-maps 2 | 3 | 4 | ```tsx 5 | import { KakakoMapView } from '@jiggag/react-native-kakao-maps'; 6 | 7 | return ( 8 | { 30 | // event.nativeEvent 31 | }} 32 | /> 33 | ); 34 | ``` 35 | 36 | ## 시작하기 37 | ### 설치 38 | `yarn add @jiggag/react-native-kakao-maps` 39 | 40 | ### 카카오 앱 키 설정 41 | #### 안드로이드 42 | - `./android/app/src/main/res/values/strings.xml` 43 | - 44 | ```sh 45 | 46 | ... 47 | KAKAO_APP_KEY 48 | 49 | ``` 50 | #### iOS 51 | - `./Info.plist` 52 | - 53 | ```xml 54 | KAKAO_APP_KEY 55 | KAKAO_APP_KEY 56 | ``` 57 | 58 | ### 커스텀 마커 이미지 등록 59 | 1. 마커 이미지 URL `markerImageUrl` 옵션으로 설정하여 사용 60 | 2. 마커 이미지 등록 후 `markerImageName` 옵션으로 `{이미지}` 호출하여 사용 61 | ``` 62 | - 안드로이드: ./android/app/src/main/res/drawable/{이미지}.png 63 | - iOS: xcode 프로젝트 폴더에 {이미지}.png 추가 + Copy items if needed 64 | ``` 65 | 66 | ## [갑자기 문제가 생겼습니다](./TROUBLESHOOTING.md) 67 | -------------------------------------------------------------------------------- /ReactNativeKakaoMaps.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | # Returns the version number for a package.json file 4 | pkg_version = lambda do |dir_from_root = '', version = 'version'| 5 | path = File.join(__dir__, dir_from_root, 'package.json') 6 | JSON.parse(File.read(path))[version] 7 | end 8 | 9 | # Let the main package.json decide the version number for the pod 10 | package_version = pkg_version.call 11 | 12 | Pod::Spec.new do |s| 13 | s.name = "ReactNativeKakaoMaps" 14 | s.version = package_version 15 | s.summary = "A react native module kakao maps" 16 | s.description = <<-DESC 17 | A react native module kakao maps 18 | DESC 19 | s.homepage = "https://github.com/jiggag/react-native-kakao-maps" 20 | s.license = "MIT" 21 | s.author = { "Atul R" => "jiggag90@gmail.com" } 22 | s.platform = :ios, "9.0" 23 | s.source = { :git => "https://github.com/jiggag/react-native-kakao-maps.git", :tag => s.version.to_s } 24 | s.source_files = "ios/*.{h,m}" 25 | 26 | s.vendored_frameworks = 'ios/DaumMap.embeddedframework/DaumMap.framework' 27 | s.resources = ['ios/DaumMap.embeddedframework/Resources/*.png'] 28 | s.dependency "React" 29 | 30 | end 31 | -------------------------------------------------------------------------------- /TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | ## 갑자기 문제가 생겼습니다 2 | ### iOS 빌드가 되지 않아요 3 | ```shell 4 | ❌ ld: symbol(s) not found for architecture x86_64 5 | ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation) 6 | ``` 7 | 8 |
9 | 에러 메세지 자세히 보기 10 | 11 | ```shell 12 | Undefined symbols for architecture x86_64: 13 | "_sqlite3_bind_blob", referenced from: 14 | mapEngine::ResourceCacheDao::_updateCacheData(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 15 | mapEngine::ResourceCacheDao::_insertCacheData(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 16 | "_sqlite3_bind_double", referenced from: 17 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 18 | mapCore::DiskCacheDao::updateEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 19 | mapCore::DiskCacheDao::updateAccessTime(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 20 | mapEngine::ResourceCacheDao::_updateCacheEntity(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 21 | mapEngine::ResourceCacheDao::_insertCacheEntity(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 22 | mapEngine::ResourceCacheDao::updateAccessTime(mobileToolkit::BasicString const*) in DaumMap(ResourceCacheDao.o) 23 | "_sqlite3_bind_int", referenced from: 24 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 25 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 26 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 27 | mapCore::DiskCacheDao::updateEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 28 | mapCore::DiskCacheDao::deleteEntitiesByType(int) in DaumMap(DiskCacheDao.o) 29 | mapCore::DiskCacheDao::invalidateAllEntries() in DaumMap(DiskCacheDao.o) 30 | mapEngine::ResourceCacheDao::selectCleaningList(int, int) in DaumMap(ResourceCacheDao.o) 31 | ... 32 | "_sqlite3_bind_text", referenced from: 33 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 34 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 35 | mapCore::DiskCacheDao::updateEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 36 | mapCore::DiskCacheDao::updateAccessTime(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 37 | mapCore::DiskCacheDao::deleteEntity(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 38 | mapEngine::ResourceCacheDao::selectCacheEntity(mobileToolkit::BasicString const*) in DaumMap(ResourceCacheDao.o) 39 | mapEngine::ResourceCacheDao::selectCacheData(mobileToolkit::BasicString const*, mobileToolkit::BasicString*) in DaumMap(ResourceCacheDao.o) 40 | ... 41 | "_sqlite3_close", referenced from: 42 | mapCore::DiskCacheDao::_openOrCreateDB() in DaumMap(DiskCacheDao.o) 43 | mapCore::BaseSqliteDao::~BaseSqliteDao() in DaumMap(BaseSqliteDao.o) 44 | mapCore::BaseSqliteDao::open() in DaumMap(BaseSqliteDao.o) 45 | mapCore::BaseSqliteDao::close() in DaumMap(BaseSqliteDao.o) 46 | "_sqlite3_column_blob", referenced from: 47 | mapEngine::ResourceCacheDao::selectCacheData(mobileToolkit::BasicString const*, mobileToolkit::BasicString*) in DaumMap(ResourceCacheDao.o) 48 | "_sqlite3_column_bytes", referenced from: 49 | mapEngine::ResourceCacheDao::selectCacheData(mobileToolkit::BasicString const*, mobileToolkit::BasicString*) in DaumMap(ResourceCacheDao.o) 50 | "_sqlite3_column_double", referenced from: 51 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 52 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 53 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 54 | mapEngine::ResourceCacheDao::selectCacheEntity(mobileToolkit::BasicString const*) in DaumMap(ResourceCacheDao.o) 55 | mapEngine::ResourceCacheDao::selectCleaningList(int, int) in DaumMap(ResourceCacheDao.o) 56 | "_sqlite3_column_int", referenced from: 57 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 58 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 59 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 60 | mapEngine::ResourceCacheDao::selectCacheEntity(mobileToolkit::BasicString const*) in DaumMap(ResourceCacheDao.o) 61 | "_sqlite3_column_text", referenced from: 62 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 63 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 64 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 65 | mapEngine::ResourceCacheDao::selectCacheEntity(mobileToolkit::BasicString const*) in DaumMap(ResourceCacheDao.o) 66 | mapEngine::ResourceCacheDao::selectCleaningList(int, int) in DaumMap(ResourceCacheDao.o) 67 | mapEngine::ResourceCacheDao::selectDanglingList(mobileToolkit::BasicString*) in DaumMap(ResourceCacheDao.o) 68 | "_sqlite3_errmsg", referenced from: 69 | mapCore::BaseSqliteDao::~BaseSqliteDao() in DaumMap(BaseSqliteDao.o) 70 | mapCore::BaseSqliteDao::open() in DaumMap(BaseSqliteDao.o) 71 | mapCore::BaseSqliteDao::_logError(char const*) in DaumMap(BaseSqliteDao.o) 72 | mapCore::BaseSqliteDao::close() in DaumMap(BaseSqliteDao.o) 73 | mapCore::BaseSqliteDao::_logErrorOnPrepareStatement() in DaumMap(BaseSqliteDao.o) 74 | "_sqlite3_exec", referenced from: 75 | mapCore::DiskCacheDao::_openOrCreateDB() in DaumMap(DiskCacheDao.o) 76 | mapEngine::ResourceCacheDao::_attachDatabase(mobileToolkit::BasicString const*, mobileToolkit::BasicString const*) in DaumMap(ResourceCacheDao.o) 77 | mapEngine::ResourceCacheDao::updateEntity(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 78 | mapEngine::ResourceCacheDao::insertEntity(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 79 | mapEngine::ResourceCacheDao::deleteEntity(mapEngine::ResourceCacheEntity const*) in DaumMap(ResourceCacheDao.o) 80 | "_sqlite3_finalize", referenced from: 81 | mapCore::DiskCacheDao::onAfterInitializeDb() in DaumMap(DiskCacheDao.o) 82 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 83 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 84 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 85 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 86 | mapCore::DiskCacheDao::updateEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 87 | mapCore::DiskCacheDao::updateAccessTime(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 88 | ... 89 | "_sqlite3_free", referenced from: 90 | mapCore::DiskCacheDao::_openOrCreateDB() in DaumMap(DiskCacheDao.o) 91 | "_sqlite3_last_insert_rowid", referenced from: 92 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 93 | mapEngine::ResourceCacheDao::insertEntity(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 94 | "_sqlite3_open", referenced from: 95 | mapCore::DiskCacheDao::_openOrCreateDB() in DaumMap(DiskCacheDao.o) 96 | mapCore::BaseSqliteDao::open() in DaumMap(BaseSqliteDao.o) 97 | "_sqlite3_prepare_v2", referenced from: 98 | mapCore::DiskCacheDao::onAfterInitializeDb() in DaumMap(DiskCacheDao.o) 99 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 100 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 101 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 102 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 103 | mapCore::DiskCacheDao::updateEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 104 | mapCore::DiskCacheDao::updateAccessTime(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 105 | ... 106 | "_sqlite3_reset", referenced from: 107 | mapEngine::ResourceCacheDao::_insertCacheEntity(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 108 | mapEngine::ResourceCacheDao::_insertCacheData(mapEngine::ResourceCacheEntity*) in DaumMap(ResourceCacheDao.o) 109 | "_sqlite3_step", referenced from: 110 | mapCore::DiskCacheDao::selectByKey(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 111 | mapCore::DiskCacheDao::selectByType(int, bool) in DaumMap(DiskCacheDao.o) 112 | mapCore::DiskCacheDao::selectCleaningList(int, int) in DaumMap(DiskCacheDao.o) 113 | mapCore::DiskCacheDao::insertEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 114 | mapCore::DiskCacheDao::updateEntity(mapCore::DiskCacheEntity*) in DaumMap(DiskCacheDao.o) 115 | mapCore::DiskCacheDao::updateAccessTime(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 116 | mapCore::DiskCacheDao::deleteEntity(mobileToolkit::BasicString const*) in DaumMap(DiskCacheDao.o) 117 | ... 118 | ld: symbol(s) not found for architecture x86_64 119 | clang: error: linker command failed with exit code 1 (use -v to see invocation) 120 | 121 | Undefined symbol: _sqlite3_bind_blob 122 | 123 | Undefined symbol: _sqlite3_bind_double 124 | 125 | Undefined symbol: _sqlite3_bind_int 126 | 127 | Undefined symbol: _sqlite3_bind_text 128 | 129 | Undefined symbol: _sqlite3_close 130 | 131 | Undefined symbol: _sqlite3_column_blob 132 | 133 | Undefined symbol: _sqlite3_column_bytes 134 | 135 | Undefined symbol: _sqlite3_column_double 136 | 137 | Undefined symbol: _sqlite3_column_int 138 | 139 | Undefined symbol: _sqlite3_column_text 140 | 141 | Undefined symbol: _sqlite3_errmsg 142 | 143 | Undefined symbol: _sqlite3_exec 144 | 145 | Undefined symbol: _sqlite3_finalize 146 | 147 | Undefined symbol: _sqlite3_free 148 | 149 | Undefined symbol: _sqlite3_last_insert_rowid 150 | 151 | Undefined symbol: _sqlite3_open 152 | 153 | Undefined symbol: _sqlite3_prepare_v2 154 | 155 | Undefined symbol: _sqlite3_reset 156 | 157 | Undefined symbol: _sqlite3_step 158 | ``` 159 |
160 | 161 | #### 해결방법 162 | `Build Phases > Link Binary With Libraries > libsqlite3.tbd 추가` 163 | 164 | ------ 165 | ### iOS 빌드가 되지 않아요 166 | ```shell 167 | ❌ ld: in /Users/jiggag/react-native-kakao-maps/example/node_modules/@jiggag/react-native-kakao-maps/ios/DaumMap.embeddedframework/DaumMap.framework/DaumMap(HashUtils.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/jiggag/react-native-kakao-maps/example/node_modules/@jiggag/react-native-kakao-maps/ios/DaumMap.embeddedframework/DaumMap.framework/DaumMap' for architecture arm64 168 | ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation) 169 | ``` 170 | 171 | #### 해결방법 172 | `xcode > example.xcworkspace` 열어서 빌드 173 | 174 | ------ 175 | ### 지도가 보이지 않아요 176 | [카카오 지도 개발자 문서](https://apis.map.kakao.com/android/guide/#step2)를 참고하여 앱 키 발급 및 키 해시를 등록해주세요 177 | 178 |
179 | 안드로이드 키 해시 추출하기 180 | 181 | ```shell 182 | keytool -exportcert -alias {key_alias} -keystore {keystore_path} -storepass {store_password} -keypass {key_password} | openssl sha1 -binary | openssl base64 183 | keytool -exportcert -alias androiddebugkey -keystore ./android/app/debug.keystore -storepass android -keypass android | openssl sha1 -binary | openssl base64 184 | ``` 185 |
186 | 187 | #### 해결방법 188 | 발급 받은 앱 키 `strings.xml > kakao_app_key` 교체 및 `앱 설정 > 플랫폼` 키 해시 등록 189 | 190 | ------ 191 | ### 안드로이드 에뮬레이터에서 지도를 열면 앱이 크래시 발생해요 192 | ```shell 193 | java.lang.UnsatisfiedLinkError 194 | at net.daum.mf.map.n.api.NativeMapLibraryLoader.loadLibrary(NativeMapLibraryLoader.java:39) 195 | ... 196 | ``` 197 | #### 해결방법 198 | - 안드로이드 에뮬레이터(x86, x86_64)에서는 카카오 맵을 지원하지 않고 있습니다. ([관련 이슈 #31](https://github.com/jiggag/react-native-kakao-maps/issues/31#issuecomment-1435983575)) 199 | - 실기기를 이용해주세요. 200 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | 9 | } 10 | } 11 | 12 | apply plugin: 'com.android.library' 13 | 14 | def getExtValue(rootProject,key,defaultValue ) { 15 | if (rootProject.hasProperty('ext')) { 16 | if (rootProject.ext.has(key)) { 17 | return rootProject.ext[key] 18 | } 19 | } 20 | return defaultValue 21 | } 22 | 23 | android { 24 | compileSdkVersion getExtValue(rootProject,'compileSdkVersion',23) 25 | buildToolsVersion getExtValue(rootProject,'buildToolsVersion', "23.0.1") 26 | 27 | defaultConfig { 28 | minSdkVersion getExtValue(rootProject,'minSdkVersion', 16) 29 | targetSdkVersion getExtValue(rootProject,'targetSdkVersion', 22) 30 | versionCode 1 31 | versionName "1.0" 32 | } 33 | lintOptions { 34 | abortOnError false 35 | } 36 | } 37 | 38 | repositories { 39 | mavenCentral() 40 | } 41 | 42 | dependencies { 43 | implementation 'com.facebook.react:react-native:+' 44 | implementation files('libs/libDaumMapAndroid.jar') 45 | } 46 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/libs/libDaumMapAndroid.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/android/libs/libDaumMapAndroid.jar -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/java/com/jiggag/rnkakaomaps/Constants.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.rnkakaomaps; 2 | 3 | public class Constants { 4 | public static final String LOG_TAG = "KakaoMapView"; 5 | public static final Double INIT_LAT = 37.537229; 6 | public static final Double INIT_LNG = 127.005515; 7 | public static final String PARAM_MARKER_NAME = "markerName"; 8 | public static final String PARAM_MARKER_IMAGE_URL = "markerImageUrl"; 9 | public static final String PARAM_MARKER_LIST = "markerList"; 10 | public static final String PARAM_LAT = "lat"; 11 | public static final String PARAM_LNG = "lng"; 12 | } 13 | -------------------------------------------------------------------------------- /android/src/main/java/com/jiggag/rnkakaomaps/KakaoMapFragment.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.rnkakaomaps; 2 | 3 | import android.os.Bundle; 4 | import android.util.Log; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.graphics.Bitmap; 9 | import android.graphics.BitmapFactory; 10 | 11 | import net.daum.mf.map.api.MapLayout; 12 | import net.daum.mf.map.api.MapPoint; 13 | import net.daum.mf.map.api.MapPOIItem; 14 | import net.daum.mf.map.api.MapView; 15 | 16 | import java.io.IOException; 17 | import java.io.InputStream; 18 | import java.net.HttpURLConnection; 19 | import java.net.URL; 20 | import java.util.ArrayList; 21 | import java.util.HashMap; 22 | import java.util.Map; 23 | 24 | import androidx.fragment.app.Fragment; 25 | 26 | import com.facebook.react.bridge.Arguments; 27 | import com.facebook.react.bridge.ReactContext; 28 | import com.facebook.react.bridge.WritableMap; 29 | import com.facebook.react.common.MapBuilder; 30 | import com.facebook.react.uimanager.events.RCTEventEmitter; 31 | 32 | public class KakaoMapFragment extends Fragment implements MapView.OpenAPIKeyAuthenticationResultListener, MapView.MapViewEventListener { 33 | ReactContext reactContext; 34 | ViewGroup mapViewContainer; 35 | private MapView mMapView; 36 | private MapPOIItem mDefaultMarker; 37 | private Bitmap markerImage = null; 38 | private MapPoint.GeoCoordinate mapCenterPoint; 39 | MapLayout mapLayout; 40 | 41 | private void createMapView() { 42 | if (mMapView == null) { 43 | mMapView = mapLayout.getMapView(); 44 | mMapView.setDaumMapApiKey(this.getString(R.string.kakao_app_key)); 45 | mMapView.setOpenAPIKeyAuthenticationResultListener(this); 46 | mMapView.setMapViewEventListener(this); 47 | mMapView.setMapType(MapView.MapType.Standard); 48 | } 49 | 50 | mMapView.removeAllPOIItems(); 51 | 52 | if (mapCenterPoint == null) { 53 | Double lat = getArguments().getDouble(Constants.PARAM_LAT); 54 | Double lng = getArguments().getDouble(Constants.PARAM_LNG); 55 | mMapView.setMapCenterPoint(MapPoint.mapPointWithGeoCoord(lat, lng), true); 56 | } else { 57 | mMapView.setMapCenterPoint(MapPoint.mapPointWithGeoCoord(mapCenterPoint.latitude, mapCenterPoint.longitude), true); 58 | } 59 | 60 | ArrayList> markerList = (ArrayList>) getArguments().get(Constants.PARAM_MARKER_LIST); 61 | String markerImageUrl = getArguments().getString(Constants.PARAM_MARKER_IMAGE_URL); 62 | String markerImageName = getArguments().getString(Constants.PARAM_MARKER_NAME); 63 | int markerImageResourceId = markerImageName != null ? this.getResources().getIdentifier(markerImageName, "drawable", getActivity().getPackageName()) : 0; 64 | 65 | new Thread(() -> { 66 | getBitmapFromUrl(markerImageUrl); 67 | createMarker(markerList, markerImage, markerImageResourceId); 68 | }).start(); 69 | } 70 | 71 | @Override 72 | public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { 73 | super.onCreateView(inflater, parent, savedInstanceState); 74 | 75 | mapLayout = new MapLayout(getActivity()); 76 | View rootView = inflater.inflate(R.layout.kakao_map_view, parent, false); 77 | 78 | createMapView(); 79 | 80 | mapViewContainer = rootView.findViewById(R.id.kakao_map_view); 81 | mapViewContainer.addView(mapLayout); 82 | 83 | return rootView; 84 | } 85 | 86 | @Override 87 | public void onResume() { 88 | super.onResume(); 89 | createMapView(); 90 | } 91 | 92 | // ///////////////////////////////////////////////////////////////////////////////////////////////// 93 | // net.daum.mf.map.api.MapView.OpenAPIKeyAuthenticationResultListener 94 | 95 | @Override 96 | public void onDaumMapOpenAPIKeyAuthenticationResult(MapView mapView, int resultCode, String resultMessage) { 97 | Log.i(Constants.LOG_TAG, String.format("Open API Key Authentication Result : code=%d, message=%s", resultCode, resultMessage)); 98 | } 99 | 100 | ///////////////////////////////////////////////////////////////////////////////////////////////// 101 | // net.daum.mf.map.api.MapView.MapViewEventListener 102 | 103 | public void onMapViewInitialized(MapView mapView) { 104 | Log.i(Constants.LOG_TAG, "MapView had loaded. Now, MapView APIs could be called safely"); 105 | } 106 | 107 | @Override 108 | public void onMapViewCenterPointMoved(MapView mapView, MapPoint mapCenterPoint) { 109 | MapPoint.GeoCoordinate mapPointGeo = mapCenterPoint.getMapPointGeoCoord(); 110 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewCenterPointMoved (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 111 | } 112 | 113 | @Override 114 | public void onMapViewDoubleTapped(MapView mapView, MapPoint mapPoint) { 115 | MapPoint.GeoCoordinate mapPointGeo = mapPoint.getMapPointGeoCoord(); 116 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewDoubleTapped (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 117 | } 118 | 119 | @Override 120 | public void onMapViewLongPressed(MapView mapView, MapPoint mapPoint) { 121 | MapPoint.GeoCoordinate mapPointGeo = mapPoint.getMapPointGeoCoord(); 122 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewLongPressed (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 123 | } 124 | 125 | @Override 126 | public void onMapViewSingleTapped(MapView mapView, MapPoint mapPoint) { 127 | MapPoint.GeoCoordinate mapPointGeo = mapPoint.getMapPointGeoCoord(); 128 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewSingleTapped (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 129 | } 130 | 131 | @Override 132 | public void onMapViewDragStarted(MapView mapView, MapPoint mapPoint) { 133 | MapPoint.GeoCoordinate mapPointGeo = mapPoint.getMapPointGeoCoord(); 134 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewDragStarted (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 135 | } 136 | 137 | @Override 138 | public void onMapViewDragEnded(MapView mapView, MapPoint mapPoint) { 139 | MapPoint.GeoCoordinate mapPointGeo = mapPoint.getMapPointGeoCoord(); 140 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewDragEnded (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 141 | } 142 | 143 | @Override 144 | public void onMapViewMoveFinished(MapView mapView, MapPoint mapPoint) { 145 | MapPoint.GeoCoordinate mapPointGeo = mapPoint.getMapPointGeoCoord(); 146 | mapCenterPoint = mapPointGeo; 147 | WritableMap event = Arguments.createMap(); 148 | event.putDouble("lat", mapPointGeo.latitude); 149 | event.putDouble("lng", mapPointGeo.longitude); 150 | event.putDouble("zoomLevel", mapView.getZoomLevel()); 151 | onReceiveNativeEvent(event); 152 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewMoveFinished (%f,%f)", mapPointGeo.latitude, mapPointGeo.longitude)); 153 | } 154 | 155 | @Override 156 | public void onMapViewZoomLevelChanged(MapView mapView, int zoomLevel) { 157 | Log.i(Constants.LOG_TAG, String.format("MapView onMapViewZoomLevelChanged (%d)", zoomLevel)); 158 | } 159 | 160 | private void onReceiveNativeEvent(WritableMap event) { 161 | reactContext 162 | .getJSModule(RCTEventEmitter.class) 163 | .receiveEvent(getId(), "topChange", event); 164 | } 165 | 166 | private Map getExportedCustomBubblingEventTypeConstants() { 167 | return MapBuilder.builder().put( 168 | "topChange", 169 | MapBuilder.of( 170 | "phasedRegistrationNames", 171 | MapBuilder.of("bubbled", "onChange") 172 | ) 173 | ).build(); 174 | } 175 | 176 | private void getBitmapFromUrl(String imageUrl) { 177 | if (imageUrl == null) { 178 | return; 179 | } 180 | 181 | try { 182 | URL url = new URL(imageUrl); 183 | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 184 | connection.setDoInput(true); 185 | connection.connect(); 186 | InputStream input = connection.getInputStream(); 187 | 188 | markerImage = BitmapFactory.decodeStream(input); 189 | } catch (IOException e) { 190 | Log.e("getBitmapFromUrl", e.getMessage()); 191 | } 192 | } 193 | 194 | private void createMarker(ArrayList> markerList, Bitmap markerImage, int markerResourceId) { 195 | mMapView.removeAllPOIItems(); 196 | if ((markerList != null ? markerList.size() : 0) > 0) { 197 | for (int i = 0; i < markerList.size(); i++) { 198 | String markerName = (String) markerList.get(i).get(Constants.PARAM_MARKER_NAME); 199 | Double lat = (Double) markerList.get(i).get(Constants.PARAM_LAT); 200 | Double lng = (Double) markerList.get(i).get(Constants.PARAM_LNG); 201 | addMarker(mMapView, markerName, lat, lng, i, markerImage, markerResourceId); 202 | } 203 | } 204 | } 205 | 206 | private void addMarker(MapView mapView, String markName, Double lat, Double lng, int tag, Bitmap markerImage, int markerResourceId) { 207 | mDefaultMarker = new MapPOIItem(); 208 | mDefaultMarker.setItemName(markName); 209 | mDefaultMarker.setTag(tag); 210 | mDefaultMarker.setMapPoint(MapPoint.mapPointWithGeoCoord(lat, lng)); 211 | mDefaultMarker.setMarkerType(MapPOIItem.MarkerType.BluePin); 212 | mDefaultMarker.setSelectedMarkerType(MapPOIItem.MarkerType.RedPin); 213 | 214 | if (markerImage != null) { 215 | mDefaultMarker.setMarkerType(MapPOIItem.MarkerType.CustomImage); 216 | mDefaultMarker.setCustomImageBitmap(markerImage); 217 | } 218 | 219 | if (markerResourceId > 0) { 220 | mDefaultMarker.setMarkerType(MapPOIItem.MarkerType.CustomImage); 221 | mDefaultMarker.setCustomImageResourceId(markerResourceId); 222 | } 223 | 224 | mapView.addPOIItem(mDefaultMarker); 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /android/src/main/java/com/jiggag/rnkakaomaps/KakaoMapManager.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.rnkakaomaps; 2 | 3 | import android.os.Bundle; 4 | import android.view.Choreographer; 5 | import android.view.View; 6 | import android.widget.FrameLayout; 7 | import android.view.ViewGroup; 8 | 9 | import androidx.annotation.NonNull; 10 | import androidx.annotation.Nullable; 11 | import androidx.fragment.app.FragmentActivity; 12 | 13 | import com.facebook.react.bridge.ReactApplicationContext; 14 | import com.facebook.react.bridge.ReadableArray; 15 | import com.facebook.react.bridge.ReadableMap; 16 | import com.facebook.react.common.MapBuilder; 17 | import com.facebook.react.uimanager.annotations.ReactProp; 18 | import com.facebook.react.uimanager.ViewGroupManager; 19 | import com.facebook.react.uimanager.ThemedReactContext; 20 | 21 | import java.util.ArrayList; 22 | import java.util.Map; 23 | 24 | public class KakaoMapManager extends ViewGroupManager { 25 | 26 | public static final String REACT_CLASS = "KakaoMapView"; 27 | public final int COMMAND_CREATE = 1; 28 | 29 | private ReactApplicationContext reactContext; 30 | private KakaoMapFragment fragment; 31 | private int containerViewId; 32 | private ArrayList markerList; 33 | private double paramLat = Constants.INIT_LAT; 34 | private double paramLng = Constants.INIT_LNG; 35 | private String markerImageName; 36 | private String markerImageUrl; 37 | 38 | public KakaoMapManager(ReactApplicationContext reactContext) { 39 | this.reactContext = reactContext; 40 | } 41 | 42 | @Override 43 | public String getName() { 44 | return REACT_CLASS; 45 | } 46 | 47 | @Override 48 | public FrameLayout createViewInstance(ThemedReactContext reactContext) { 49 | return new FrameLayout(reactContext); 50 | } 51 | 52 | @Nullable 53 | @Override 54 | public Map getCommandsMap() { 55 | return MapBuilder.of("create", COMMAND_CREATE); 56 | } 57 | 58 | @Override 59 | public void receiveCommand( 60 | @NonNull FrameLayout root, 61 | String commandId, 62 | @Nullable ReadableArray args 63 | ) { 64 | super.receiveCommand(root, commandId, args); 65 | containerViewId = args.getInt(0); 66 | int commandIdInt = Integer.parseInt(commandId); 67 | if (commandIdInt == COMMAND_CREATE) { 68 | createFragment(root); 69 | } 70 | } 71 | 72 | @ReactProp(name = "markerList") 73 | public void setMarkerList(FrameLayout view, @Nullable ReadableArray _markerList) { 74 | if (_markerList != null) { 75 | markerList = _markerList.toArrayList(); 76 | } 77 | bundleFragment(); 78 | } 79 | 80 | @ReactProp(name = "centerPoint") 81 | public void setCenterPoint(FrameLayout view, @Nullable ReadableMap centerPoint) { 82 | if (centerPoint != null) { 83 | paramLat = centerPoint.getDouble(Constants.PARAM_LAT); 84 | paramLng = centerPoint.getDouble(Constants.PARAM_LNG); 85 | } 86 | bundleFragment(); 87 | } 88 | 89 | @ReactProp(name = "markerImageName") 90 | public void setMarkerImageName(FrameLayout view, @Nullable String _markerImageName) { 91 | markerImageName = _markerImageName; 92 | bundleFragment(); 93 | } 94 | 95 | @ReactProp(name = "markerImageUrl") 96 | public void setMarkerImageUrl(FrameLayout view, @Nullable String _markerImageUrl) { 97 | markerImageUrl = _markerImageUrl; 98 | bundleFragment(); 99 | } 100 | 101 | private void createFragment(FrameLayout root) { 102 | ViewGroup parentView = (ViewGroup) root.findViewById(containerViewId); 103 | setupLayout(parentView); 104 | fragment = new KakaoMapFragment(); 105 | bundleFragment(); 106 | } 107 | 108 | private void bundleFragment() { 109 | if (fragment == null) { 110 | return; 111 | } 112 | FragmentActivity activity = (FragmentActivity) reactContext.getCurrentActivity(); 113 | Bundle bundle = new Bundle(); 114 | bundle.putDouble(Constants.PARAM_LAT, paramLat); 115 | bundle.putDouble(Constants.PARAM_LNG, paramLng); 116 | bundle.putString(Constants.PARAM_MARKER_NAME, markerImageName); 117 | bundle.putString(Constants.PARAM_MARKER_IMAGE_URL, markerImageUrl); 118 | bundle.putParcelableArrayList(Constants.PARAM_MARKER_LIST, markerList); 119 | 120 | fragment.reactContext = reactContext; 121 | fragment.setArguments(bundle); 122 | activity.getSupportFragmentManager() 123 | .beginTransaction() 124 | .addToBackStack(null) 125 | .replace(containerViewId, fragment, String.valueOf(containerViewId)) 126 | .commitAllowingStateLoss(); 127 | fragment.onResume(); 128 | } 129 | 130 | private void setupLayout(View view) { 131 | Choreographer.getInstance().postFrameCallback(new Choreographer.FrameCallback() { 132 | @Override 133 | public void doFrame(long frameTimeNanos) { 134 | manuallyLayoutChildren(view); 135 | view.getViewTreeObserver().dispatchOnGlobalLayout(); 136 | Choreographer.getInstance().postFrameCallback(this); 137 | } 138 | }); 139 | } 140 | 141 | private void manuallyLayoutChildren(View view) { 142 | view.measure( 143 | View.MeasureSpec.makeMeasureSpec(view.getMeasuredWidth(), View.MeasureSpec.EXACTLY), 144 | View.MeasureSpec.makeMeasureSpec(view.getMeasuredHeight(), View.MeasureSpec.EXACTLY)); 145 | 146 | view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /android/src/main/java/com/jiggag/rnkakaomaps/KakaoMapPackage.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.rnkakaomaps; 2 | 3 | import java.util.List; 4 | import java.util.ArrayList; 5 | 6 | import com.facebook.react.ReactPackage; 7 | import com.facebook.react.bridge.NativeModule; 8 | import com.facebook.react.bridge.ReactApplicationContext; 9 | import com.facebook.react.uimanager.ViewManager; 10 | 11 | public class KakaoMapPackage implements ReactPackage { 12 | @Override 13 | public List createNativeModules(ReactApplicationContext reactContext) { 14 | List modules = new ArrayList<>(); 15 | return modules; 16 | } 17 | 18 | @Override 19 | public List createViewManagers(ReactApplicationContext reactContext) { 20 | List managers = new ArrayList<>(); 21 | managers.add(new KakaoMapManager(reactContext)); 22 | return managers; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/src/main/jniLibs/arm64-v8a/libDaumMapEngineApi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/android/src/main/jniLibs/arm64-v8a/libDaumMapEngineApi.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/armeabi-v7a/libDaumMapEngineApi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/android/src/main/jniLibs/armeabi-v7a/libDaumMapEngineApi.so -------------------------------------------------------------------------------- /android/src/main/jniLibs/armeabi/libDaumMapEngineApi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/android/src/main/jniLibs/armeabi/libDaumMapEngineApi.so -------------------------------------------------------------------------------- /android/src/main/res/layout/kakao_map_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | xxxxxx 3 | 4 | -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example.png -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | .*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ 15 | 16 | [untyped] 17 | .*/node_modules/@react-native-community/cli/.*/.* 18 | 19 | [include] 20 | 21 | [libs] 22 | node_modules/react-native/interface.js 23 | node_modules/react-native/flow/ 24 | 25 | [options] 26 | emoji=true 27 | 28 | exact_by_default=true 29 | 30 | format.bracket_spacing=false 31 | 32 | module.file_ext=.js 33 | module.file_ext=.json 34 | module.file_ext=.ios.js 35 | 36 | munge_underscores=true 37 | 38 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 39 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 40 | 41 | suppress_type=$FlowIssue 42 | suppress_type=$FlowFixMe 43 | suppress_type=$FlowFixMeProps 44 | suppress_type=$FlowFixMeState 45 | 46 | [lints] 47 | sketchy-null-number=warn 48 | sketchy-null-mixed=warn 49 | sketchy-number=warn 50 | untyped-type-import=warn 51 | nonstrict-import=warn 52 | deprecated-type=warn 53 | unsafe-getters-setters=warn 54 | unnecessary-invariant=warn 55 | 56 | [strict] 57 | deprecated-type 58 | nonstrict-import 59 | sketchy-null 60 | unclear-type 61 | unsafe-getters-setters 62 | untyped-import 63 | untyped-type-import 64 | 65 | [version] 66 | ^0.182.0 67 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | ios/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | .cxx/ 34 | 35 | # node.js 36 | # 37 | node_modules/ 38 | npm-debug.log 39 | yarn-error.log 40 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | *.keystore 45 | !debug.keystore 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/ 53 | 54 | **/fastlane/report.xml 55 | **/fastlane/Preview.html 56 | **/fastlane/screenshots 57 | **/fastlane/test_output 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | # Ruby / CocoaPods 63 | /ios/Pods/ 64 | /vendor/bundle/ 65 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: true, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | import React, { useCallback } from 'react'; 2 | import { SafeAreaView } from 'react-native'; 3 | import { KakaoMapView } from '@jiggag/react-native-kakao-maps'; 4 | 5 | const Constants = { 6 | CENTER_POINT: { 7 | lat: 37.59523, 8 | lng: 127.086, 9 | }, 10 | MARKER_LIST: [ 11 | { 12 | lat: 37.59523, 13 | lng: 127.086, 14 | markerName: 'marker', 15 | }, 16 | { 17 | lat: 37.59523, 18 | lng: 127.08705, 19 | markerName: 'marker2', 20 | }, 21 | ], 22 | }; 23 | 24 | const App = () => { 25 | const onChange = useCallback(event => { 26 | console.log('[onChange]', event.nativeEvent); 27 | }, []); 28 | 29 | return ( 30 | 31 | 39 | 40 | ); 41 | }; 42 | 43 | export default App; 44 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /example/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /example/_bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/_node-version: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /example/_ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.jiggag.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.jiggag.example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | import org.apache.tools.ant.taskdefs.condition.Os 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: true, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: "../../node_modules/react-native/react.gradle" 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and that value will be read here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get("enableHermes", false); 123 | 124 | /** 125 | * Architectures to build native code for. 126 | */ 127 | def reactNativeArchitectures() { 128 | def value = project.getProperties().get("reactNativeArchitectures") 129 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 130 | } 131 | 132 | android { 133 | ndkVersion rootProject.ext.ndkVersion 134 | 135 | compileSdkVersion rootProject.ext.compileSdkVersion 136 | 137 | defaultConfig { 138 | applicationId "com.jiggag.example" 139 | minSdkVersion rootProject.ext.minSdkVersion 140 | targetSdkVersion rootProject.ext.targetSdkVersion 141 | versionCode 1 142 | versionName "1.0" 143 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 144 | 145 | if (isNewArchitectureEnabled()) { 146 | // We configure the CMake build only if you decide to opt-in for the New Architecture. 147 | externalNativeBuild { 148 | cmake { 149 | arguments "-DPROJECT_BUILD_DIR=$buildDir", 150 | "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", 151 | "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", 152 | "-DNODE_MODULES_DIR=$rootDir/../node_modules", 153 | "-DANDROID_STL=c++_shared" 154 | } 155 | } 156 | if (!enableSeparateBuildPerCPUArchitecture) { 157 | ndk { 158 | abiFilters (*reactNativeArchitectures()) 159 | } 160 | } 161 | } 162 | } 163 | 164 | if (isNewArchitectureEnabled()) { 165 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 166 | externalNativeBuild { 167 | cmake { 168 | path "$projectDir/src/main/jni/CMakeLists.txt" 169 | } 170 | } 171 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 172 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 173 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 174 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 175 | into("$buildDir/react-ndk/exported") 176 | } 177 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 178 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 179 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 180 | into("$buildDir/react-ndk/exported") 181 | } 182 | afterEvaluate { 183 | // If you wish to add a custom TurboModule or component locally, 184 | // you should uncomment this line. 185 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 186 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 187 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 188 | 189 | // Due to a bug inside AGP, we have to explicitly set a dependency 190 | // between configureCMakeDebug* tasks and the preBuild tasks. 191 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 192 | configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) 193 | configureCMakeDebug.dependsOn(preDebugBuild) 194 | reactNativeArchitectures().each { architecture -> 195 | tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { 196 | dependsOn("preDebugBuild") 197 | } 198 | tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { 199 | dependsOn("preReleaseBuild") 200 | } 201 | } 202 | } 203 | } 204 | 205 | splits { 206 | abi { 207 | reset() 208 | enable enableSeparateBuildPerCPUArchitecture 209 | universalApk false // If true, also generate a universal APK 210 | include (*reactNativeArchitectures()) 211 | } 212 | } 213 | signingConfigs { 214 | debug { 215 | storeFile file('debug.keystore') 216 | storePassword 'android' 217 | keyAlias 'androiddebugkey' 218 | keyPassword 'android' 219 | } 220 | } 221 | buildTypes { 222 | debug { 223 | signingConfig signingConfigs.debug 224 | } 225 | release { 226 | // Caution! In production, you need to generate your own keystore file. 227 | // see https://reactnative.dev/docs/signed-apk-android. 228 | signingConfig signingConfigs.debug 229 | minifyEnabled enableProguardInReleaseBuilds 230 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 231 | } 232 | } 233 | 234 | // applicationVariants are e.g. debug, release 235 | applicationVariants.all { variant -> 236 | variant.outputs.each { output -> 237 | // For each separate APK per architecture, set a unique version code as described here: 238 | // https://developer.android.com/studio/build/configure-apk-splits.html 239 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 240 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 241 | def abi = output.getFilter(OutputFile.ABI) 242 | if (abi != null) { // null for the universal-debug, universal-release variants 243 | output.versionCodeOverride = 244 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 245 | } 246 | 247 | } 248 | } 249 | } 250 | 251 | dependencies { 252 | implementation fileTree(dir: "libs", include: ["*.jar"]) 253 | 254 | //noinspection GradleDynamicVersion 255 | implementation "com.facebook.react:react-native:+" // From node_modules 256 | 257 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 258 | 259 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 260 | exclude group:'com.facebook.fbjni' 261 | } 262 | 263 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 264 | exclude group:'com.facebook.flipper' 265 | exclude group:'com.squareup.okhttp3', module:'okhttp' 266 | } 267 | 268 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 269 | exclude group:'com.facebook.flipper' 270 | } 271 | 272 | if (enableHermes) { 273 | //noinspection GradleDynamicVersion 274 | implementation("com.facebook.react:hermes-engine:+") { // From node_modules 275 | exclude group:'com.facebook.fbjni' 276 | } 277 | } else { 278 | implementation jscFlavor 279 | } 280 | } 281 | 282 | if (isNewArchitectureEnabled()) { 283 | // If new architecture is enabled, we let you build RN from source 284 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 285 | // This will be applied to all the imported transtitive dependency. 286 | configurations.all { 287 | resolutionStrategy.dependencySubstitution { 288 | substitute(module("com.facebook.react:react-native")) 289 | .using(project(":ReactAndroid")) 290 | .because("On New Architecture we're building React Native from source") 291 | substitute(module("com.facebook.react:hermes-engine")) 292 | .using(project(":ReactAndroid:hermes-engine")) 293 | .because("On New Architecture we're building Hermes from source") 294 | } 295 | } 296 | } 297 | 298 | // Run this once to be able to run the application with BUCK 299 | // puts all compile dependencies into folder libs for BUCK to use 300 | task copyDownloadableDepsToLibs(type: Copy) { 301 | from configurations.implementation 302 | into 'libs' 303 | } 304 | 305 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 306 | 307 | def isNewArchitectureEnabled() { 308 | // To opt-in for the New Architecture, you can either: 309 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 310 | // - Invoke gradle with `-newArchEnabled=true` 311 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 312 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 313 | } 314 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/jiggag/example/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.jiggag.example; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceEventListener; 23 | import com.facebook.react.ReactInstanceManager; 24 | import com.facebook.react.bridge.ReactContext; 25 | import com.facebook.react.modules.network.NetworkingModule; 26 | import okhttp3.OkHttpClient; 27 | 28 | public class ReactNativeFlipper { 29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 30 | if (FlipperUtils.shouldEnableFlipper(context)) { 31 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 32 | 33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 34 | client.addPlugin(new ReactFlipperPlugin()); 35 | client.addPlugin(new DatabasesFlipperPlugin(context)); 36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 37 | client.addPlugin(CrashReporterPlugin.getInstance()); 38 | 39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 40 | NetworkingModule.setCustomClientBuilder( 41 | new NetworkingModule.CustomClientBuilder() { 42 | @Override 43 | public void apply(OkHttpClient.Builder builder) { 44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 45 | } 46 | }); 47 | client.addPlugin(networkFlipperPlugin); 48 | client.start(); 49 | 50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 51 | // Hence we run if after all native modules have been initialized 52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 53 | if (reactContext == null) { 54 | reactInstanceManager.addReactInstanceEventListener( 55 | new ReactInstanceEventListener() { 56 | @Override 57 | public void onReactContextInitialized(ReactContext reactContext) { 58 | reactInstanceManager.removeReactInstanceEventListener(this); 59 | reactContext.runOnNativeModulesQueueThread( 60 | new Runnable() { 61 | @Override 62 | public void run() { 63 | client.addPlugin(new FrescoFlipperPlugin()); 64 | } 65 | }); 66 | } 67 | }); 68 | } else { 69 | client.addPlugin(new FrescoFlipperPlugin()); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/jiggag/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.example; 2 | 3 | import com.jiggag.example.BuildConfig; 4 | import com.facebook.react.ReactActivity; 5 | import com.facebook.react.ReactActivityDelegate; 6 | import com.facebook.react.ReactRootView; 7 | 8 | public class MainActivity extends ReactActivity { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | @Override 15 | protected String getMainComponentName() { 16 | return "example"; 17 | } 18 | 19 | /** 20 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 21 | * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer 22 | * (Paper). 23 | */ 24 | @Override 25 | protected ReactActivityDelegate createReactActivityDelegate() { 26 | return new MainActivityDelegate(this, getMainComponentName()); 27 | } 28 | 29 | public static class MainActivityDelegate extends ReactActivityDelegate { 30 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 31 | super(activity, mainComponentName); 32 | } 33 | 34 | @Override 35 | protected ReactRootView createRootView() { 36 | ReactRootView reactRootView = new ReactRootView(getContext()); 37 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 38 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 39 | return reactRootView; 40 | } 41 | 42 | @Override 43 | protected boolean isConcurrentRootEnabled() { 44 | // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). 45 | // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html 46 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/jiggag/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.example; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.jiggag.example.BuildConfig; 7 | import com.facebook.react.PackageList; 8 | import com.facebook.react.ReactApplication; 9 | import com.facebook.react.ReactInstanceManager; 10 | import com.facebook.react.ReactNativeHost; 11 | import com.facebook.react.ReactPackage; 12 | import com.facebook.react.config.ReactFeatureFlags; 13 | import com.facebook.soloader.SoLoader; 14 | import com.jiggag.example.newarchitecture.MainApplicationReactNativeHost; 15 | import java.lang.reflect.InvocationTargetException; 16 | import java.util.List; 17 | 18 | public class MainApplication extends Application implements ReactApplication { 19 | 20 | private final ReactNativeHost mReactNativeHost = 21 | new ReactNativeHost(this) { 22 | @Override 23 | public boolean getUseDeveloperSupport() { 24 | return BuildConfig.DEBUG; 25 | } 26 | 27 | @Override 28 | protected List getPackages() { 29 | @SuppressWarnings("UnnecessaryLocalVariable") 30 | List packages = new PackageList(this).getPackages(); 31 | // Packages that cannot be autolinked yet can be added manually here, for example: 32 | // packages.add(new MyReactNativePackage()); 33 | return packages; 34 | } 35 | 36 | @Override 37 | protected String getJSMainModuleName() { 38 | return "index"; 39 | } 40 | }; 41 | 42 | private final ReactNativeHost mNewArchitectureNativeHost = 43 | new MainApplicationReactNativeHost(this); 44 | 45 | @Override 46 | public ReactNativeHost getReactNativeHost() { 47 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 48 | return mNewArchitectureNativeHost; 49 | } else { 50 | return mReactNativeHost; 51 | } 52 | } 53 | 54 | @Override 55 | public void onCreate() { 56 | super.onCreate(); 57 | // If you opted-in for the New Architecture, we enable the TurboModule system 58 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 59 | SoLoader.init(this, /* native exopackage */ false); 60 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 61 | } 62 | 63 | /** 64 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 65 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 66 | * 67 | * @param context 68 | * @param reactInstanceManager 69 | */ 70 | private static void initializeFlipper( 71 | Context context, ReactInstanceManager reactInstanceManager) { 72 | if (BuildConfig.DEBUG) { 73 | try { 74 | /* 75 | We use reflection here to pick up the class that initializes Flipper, 76 | since Flipper library is not available in release mode 77 | */ 78 | Class aClass = Class.forName("com.jiggag.example.ReactNativeFlipper"); 79 | aClass 80 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 81 | .invoke(null, context, reactInstanceManager); 82 | } catch (ClassNotFoundException e) { 83 | e.printStackTrace(); 84 | } catch (NoSuchMethodException e) { 85 | e.printStackTrace(); 86 | } catch (IllegalAccessException e) { 87 | e.printStackTrace(); 88 | } catch (InvocationTargetException e) { 89 | e.printStackTrace(); 90 | } 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/jiggag/example/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.example.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.FabricJSIModuleProvider; 20 | import com.facebook.react.fabric.ReactNativeConfig; 21 | import com.facebook.react.uimanager.ViewManagerRegistry; 22 | import com.jiggag.example.BuildConfig; 23 | import com.jiggag.example.newarchitecture.components.MainComponentsRegistry; 24 | import com.jiggag.example.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 30 | * TurboModule delegates and the Fabric Renderer. 31 | * 32 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 33 | * `newArchEnabled` property). Is ignored otherwise. 34 | */ 35 | public class MainApplicationReactNativeHost extends ReactNativeHost { 36 | public MainApplicationReactNativeHost(Application application) { 37 | super(application); 38 | } 39 | 40 | @Override 41 | public boolean getUseDeveloperSupport() { 42 | return BuildConfig.DEBUG; 43 | } 44 | 45 | @Override 46 | protected List getPackages() { 47 | List packages = new PackageList(this).getPackages(); 48 | // Packages that cannot be autolinked yet can be added manually here, for example: 49 | // packages.add(new MyReactNativePackage()); 50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 51 | // packages.add(new TurboReactPackage() { ... }); 52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 53 | // inside a ReactPackage. 54 | return packages; 55 | } 56 | 57 | @Override 58 | protected String getJSMainModuleName() { 59 | return "index"; 60 | } 61 | 62 | @NonNull 63 | @Override 64 | protected ReactPackageTurboModuleManagerDelegate.Builder 65 | getReactPackageTurboModuleManagerDelegateBuilder() { 66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 67 | // for the new architecture and to use TurboModules correctly. 68 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 69 | } 70 | 71 | @Override 72 | protected JSIModulePackage getJSIModulePackage() { 73 | return new JSIModulePackage() { 74 | @Override 75 | public List getJSIModules( 76 | final ReactApplicationContext reactApplicationContext, 77 | final JavaScriptContextHolder jsContext) { 78 | final List specs = new ArrayList<>(); 79 | 80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 81 | // custom Fabric Components. 82 | specs.add( 83 | new JSIModuleSpec() { 84 | @Override 85 | public JSIModuleType getJSIModuleType() { 86 | return JSIModuleType.UIManager; 87 | } 88 | 89 | @Override 90 | public JSIModuleProvider getJSIModuleProvider() { 91 | final ComponentFactory componentFactory = new ComponentFactory(); 92 | CoreComponentsRegistry.register(componentFactory); 93 | 94 | // Here we register a Components Registry. 95 | // The one that is generated with the template contains no components 96 | // and just provides you the one from React Native core. 97 | MainComponentsRegistry.register(componentFactory); 98 | 99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 100 | 101 | ViewManagerRegistry viewManagerRegistry = 102 | new ViewManagerRegistry( 103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 104 | 105 | return new FabricJSIModuleProvider( 106 | reactApplicationContext, 107 | componentFactory, 108 | ReactNativeConfig.DEFAULT_CONFIG, 109 | viewManagerRegistry); 110 | } 111 | }); 112 | return specs; 113 | } 114 | }; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/jiggag/example/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.example.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/jiggag/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.jiggag.example.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("example_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | 3 | # Define the library name here. 4 | project(example_appmodules) 5 | 6 | # This file includes all the necessary to let you build your application with the New Architecture. 7 | include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace facebook { 7 | namespace react { 8 | 9 | std::shared_ptr MainApplicationModuleProvider( 10 | const std::string &moduleName, 11 | const JavaTurboModule::InitParams ¶ms) { 12 | // Here you can provide your own module provider for TurboModules coming from 13 | // either your application or from external libraries. The approach to follow 14 | // is similar to the following (for a library called `samplelibrary`: 15 | // 16 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 17 | // if (module != nullptr) { 18 | // return module; 19 | // } 20 | // return rncore_ModuleProvider(moduleName, params); 21 | 22 | // Module providers autolinked by RN CLI 23 | auto rncli_module = rncli_ModuleProvider(moduleName, params); 24 | if (rncli_module != nullptr) { 25 | return rncli_module; 26 | } 27 | 28 | return rncore_ModuleProvider(moduleName, params); 29 | } 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string &moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string &name, 26 | const std::shared_ptr &jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string &name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | const std::string &name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/jiggag/example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string &name, 25 | const std::shared_ptr &jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string &name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(const std::string &name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace facebook { 10 | namespace react { 11 | 12 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 13 | 14 | std::shared_ptr 15 | MainComponentsRegistry::sharedProviderRegistry() { 16 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 17 | 18 | // Autolinked providers registered by RN CLI 19 | rncli_registerProviders(providerRegistry); 20 | 21 | // Custom Fabric Components go here. You can register custom 22 | // components coming from your App or from 3rd party libraries here. 23 | // 24 | // providerRegistry->add(concreteComponentDescriptorProvider< 25 | // AocViewerComponentDescriptor>()); 26 | return providerRegistry; 27 | } 28 | 29 | jni::local_ref 30 | MainComponentsRegistry::initHybrid( 31 | jni::alias_ref, 32 | ComponentFactory *delegate) { 33 | auto instance = makeCxxInstance(delegate); 34 | 35 | auto buildRegistryFunction = 36 | [](EventDispatcher::Weak const &eventDispatcher, 37 | ContextContainer::Shared const &contextContainer) 38 | -> ComponentDescriptorRegistry::Shared { 39 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 40 | ->createComponentDescriptorRegistry( 41 | {eventDispatcher, contextContainer}); 42 | 43 | auto mutableRegistry = 44 | std::const_pointer_cast(registry); 45 | 46 | mutableRegistry->setFallbackComponentDescriptor( 47 | std::make_shared( 48 | ComponentDescriptorParameters{ 49 | eventDispatcher, contextContainer, nullptr})); 50 | 51 | return registry; 52 | }; 53 | 54 | delegate->buildRegistryFunction = buildRegistryFunction; 55 | return instance; 56 | } 57 | 58 | void MainComponentsRegistry::registerNatives() { 59 | registerHybrid({ 60 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 61 | }); 62 | } 63 | 64 | } // namespace react 65 | } // namespace facebook 66 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/jiggag/example/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | f6b2f864b95ed38943b8a9703dec6e52 4 | 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "31.0.0" 6 | minSdkVersion = 21 7 | compileSdkVersion = 31 8 | targetSdkVersion = 31 9 | 10 | if (System.properties['os.arch'] == "aarch64") { 11 | // For M1 Users we need to use the NDK 24 which added support for aarch64 12 | ndkVersion = "24.0.8215888" 13 | } else { 14 | // Otherwise we default to the side-by-side NDK version from AGP. 15 | ndkVersion = "21.4.7075529" 16 | } 17 | } 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | dependencies { 23 | classpath("com.android.tools.build:gradle:7.2.1") 24 | classpath("com.facebook.react:react-native-gradle-plugin") 25 | classpath("de.undercouch:gradle-download-task:5.0.1") 26 | // NOTE: Do not place your application dependencies here; they belong 27 | // in the individual module build.gradle files 28 | } 29 | } 30 | 31 | allprojects { 32 | repositories { 33 | maven { 34 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 35 | url("$rootDir/../node_modules/react-native/android") 36 | } 37 | maven { 38 | // Android JSC is installed from npm 39 | url("$rootDir/../node_modules/jsc-android/dist") 40 | } 41 | mavenCentral { 42 | // We don't want to fetch react-native from Maven Central as there are 43 | // older versions over there. 44 | content { 45 | excludeGroup "com.facebook.react" 46 | } 47 | } 48 | google() 49 | maven { url 'https://www.jitpack.io' } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.125.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | include(":ReactAndroid:hermes-engine") 10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') 11 | } 12 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/custom_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/custom_image.png -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '12.4' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'example' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | use_react_native!( 14 | :path => config[:reactNativePath], 15 | # Hermes is now enabled by default. Disable by setting this flag to false. 16 | # Upcoming versions of React Native may rely on get_default_flags(), but 17 | # we make it explicit here to aid in the React Native upgrade process. 18 | :hermes_enabled => true, 19 | :fabric_enabled => flags[:fabric_enabled], 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | :flipper_configuration => FlipperConfiguration.enabled, 25 | # An absolute path to your application root. 26 | :app_path => "#{Pod::Config.instance.installation_root}/.." 27 | ) 28 | 29 | target 'exampleTests' do 30 | inherit! :complete 31 | # Pods for testing 32 | end 33 | 34 | post_install do |installer| 35 | react_native_post_install( 36 | installer, 37 | # Set `mac_catalyst_enabled` to `true` in order to apply patches 38 | # necessary for Mac Catalyst builds 39 | :mac_catalyst_enabled => false 40 | ) 41 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /example/ios/RNStarter.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/RNStarter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/_xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/ios/custom_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/example/ios/custom_image.png -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import 8 | 9 | #if RCT_NEW_ARCH_ENABLED 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | #import 18 | 19 | static NSString *const kRNConcurrentRoot = @"concurrentRoot"; 20 | 21 | @interface AppDelegate () { 22 | RCTTurboModuleManager *_turboModuleManager; 23 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 24 | std::shared_ptr _reactNativeConfig; 25 | facebook::react::ContextContainer::Shared _contextContainer; 26 | } 27 | @end 28 | #endif 29 | 30 | @implementation AppDelegate 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | RCTAppSetupPrepareApp(application); 35 | 36 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 37 | 38 | #if RCT_NEW_ARCH_ENABLED 39 | _contextContainer = std::make_shared(); 40 | _reactNativeConfig = std::make_shared(); 41 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 42 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 43 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 44 | #endif 45 | 46 | NSDictionary *initProps = [self prepareInitialProps]; 47 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"example", initProps); 48 | 49 | if (@available(iOS 13.0, *)) { 50 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 51 | } else { 52 | rootView.backgroundColor = [UIColor whiteColor]; 53 | } 54 | 55 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 56 | UIViewController *rootViewController = [UIViewController new]; 57 | rootViewController.view = rootView; 58 | self.window.rootViewController = rootViewController; 59 | [self.window makeKeyAndVisible]; 60 | return YES; 61 | } 62 | 63 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. 64 | /// 65 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html 66 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). 67 | /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. 68 | - (BOOL)concurrentRootEnabled 69 | { 70 | // Switch this bool to turn on and off the concurrent root 71 | return true; 72 | } 73 | 74 | - (NSDictionary *)prepareInitialProps 75 | { 76 | NSMutableDictionary *initProps = [NSMutableDictionary new]; 77 | 78 | #ifdef RCT_NEW_ARCH_ENABLED 79 | initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); 80 | #endif 81 | 82 | return initProps; 83 | } 84 | 85 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 86 | { 87 | #if DEBUG 88 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 89 | #else 90 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 91 | #endif 92 | } 93 | 94 | #if RCT_NEW_ARCH_ENABLED 95 | 96 | #pragma mark - RCTCxxBridgeDelegate 97 | 98 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 99 | { 100 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 101 | delegate:self 102 | jsInvoker:bridge.jsCallInvoker]; 103 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 104 | } 105 | 106 | #pragma mark RCTTurboModuleManagerDelegate 107 | 108 | - (Class)getModuleClassFromName:(const char *)name 109 | { 110 | return RCTCoreModulesClassProvider(name); 111 | } 112 | 113 | - (std::shared_ptr)getTurboModule:(const std::string &)name 114 | jsInvoker:(std::shared_ptr)jsInvoker 115 | { 116 | return nullptr; 117 | } 118 | 119 | - (std::shared_ptr)getTurboModule:(const std::string &)name 120 | initParams: 121 | (const facebook::react::ObjCTurboModule::InitParams &)params 122 | { 123 | return nullptr; 124 | } 125 | 126 | - (id)getModuleInstanceFromClass:(Class)moduleClass 127 | { 128 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 129 | } 130 | 131 | #endif 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | KAKAO_APP_KEY 55 | f6b2f864b95ed38943b8a9703dec6e52 56 | 57 | 58 | -------------------------------------------------------------------------------- /example/ios/example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface exampleTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation exampleTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "@jiggag/react-native-kakao-maps": "0.0.12", 14 | "react": "18.1.0", 15 | "react-native": "0.70.6" 16 | }, 17 | "devDependencies": { 18 | "@babel/core": "^7.12.9", 19 | "@babel/runtime": "^7.12.5", 20 | "@react-native-community/eslint-config": "^2.0.0", 21 | "babel-jest": "^26.6.3", 22 | "eslint": "^7.32.0", 23 | "jest": "^26.6.3", 24 | "metro-react-native-babel-preset": "0.72.3", 25 | "react-test-renderer": "18.1.0" 26 | }, 27 | "jest": { 28 | "preset": "react-native" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | interface Coordinate { 4 | lat: number; 5 | lng: number; 6 | } 7 | 8 | interface Maker extends Coordinate { 9 | markerName: string; 10 | } 11 | 12 | interface MapNativeEvent { 13 | nativeEvent: { 14 | lat: number; 15 | lng: number; 16 | zoomLevel: number; 17 | } 18 | } 19 | 20 | interface Params { 21 | markerImageName?: string; 22 | markerImageUrl?: string; 23 | markerList: Maker[]; 24 | centerPoint?: Coordinate; 25 | onChange: (event: MapNativeEvent) => void; 26 | } 27 | 28 | interface ComponentProps extends Params { 29 | width: number; 30 | height: number; 31 | } 32 | 33 | declare const KakaoMapView: React.ComponentType; 34 | 35 | export { 36 | KakaoMapView 37 | }; 38 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useRef } from 'react'; 2 | import { Platform, UIManager, findNodeHandle, requireNativeComponent } from 'react-native'; 3 | 4 | const NativeComponent = requireNativeComponent('KakaoMapView'); 5 | 6 | const createFragment = viewId => 7 | UIManager.dispatchViewManagerCommand( 8 | viewId, 9 | UIManager.KakaoMapView.Commands.create.toString(), 10 | [viewId], 11 | ); 12 | 13 | export const KakaoMapView = props => { 14 | const ref = useRef(null); 15 | 16 | useEffect(() => { 17 | const viewId = findNodeHandle(ref.current); 18 | 19 | if (Platform.OS === 'android') { 20 | createFragment(viewId); 21 | } 22 | }, []); 23 | 24 | return ; 25 | }; 26 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/DaumMap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/DaumMap -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapCameraUpdate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Map CameraUpdate Class 3 | * @file MTMapCameraUpdate.h 4 | * @author Soo-Hyun Park (goaeng0824@daumcorp.com) 5 | * @date 2014/7/16 6 | * @copyright 7 | * Copyright 2014 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | 15 | /** 16 | * @brief 지도 화면 처리를 담당하는 Class 17 | * 지도 화면 이동/확대/축소 등의 기능이 제공된다. 18 | * @see MTMapView 19 | */ 20 | 21 | @interface MTMapCameraUpdate : NSObject 22 | 23 | /** 24 | * 지도 화면을 현재의 확대/축소 레벨을 유지한 상태로 25 | * 설정한 중심점으로 이동한다. 26 | * @param mapPoint 이동하는 지도 화면의 중심점 27 | */ 28 | 29 | + (MTMapCameraUpdate *)move:(MTMapPoint *)mapPoint; 30 | 31 | /** 32 | * 지도 화면을 설정한 확대/축소 레벨로 조정 및 33 | * 설정한 중심점으로 이동한다. 34 | * @param mapPoint 이동하는 지도 화면의 중심점 35 | * @param zoomLevel 변경된 지도 확대/축소 레벨 36 | */ 37 | 38 | + (MTMapCameraUpdate *)move:(MTMapPoint *)mapPoint withZoomLevel:(MTMapZoomLevel)zoomLevel; 39 | 40 | /** 41 | * 설정한 중심점으로 이동하면서 지정한 직경(meter) 영역이 보이도록 줌레벨이 조정된다. 42 | * 지정한 영역의 padding 값은 0 43 | * @param mapPoint 이동하는 지도 화면의 중심점 44 | * @param meter 직경(지름) 45 | */ 46 | 47 | + (MTMapCameraUpdate *)move:(MTMapPoint *)mapPoint withDiameter:(CGFloat)meter; 48 | 49 | /** 50 | * 설정한 중심점으로 이동하면서 지정한 직경(meter) 영역이 보이도록 줌레벨이 조정된다. 51 | * @param mapPoint 이동하는 지도 화면의 중심점 52 | * @param meter 직경(지름) 53 | * @param padding 지정한 영역의 padding 값 54 | */ 55 | 56 | + (MTMapCameraUpdate *)move:(MTMapPoint *)mapPoint withDiameter:(CGFloat)meter withPadding:(CGFloat)padding; 57 | 58 | /** 59 | * 지정한 영역이 화면에 나타나도록 지도화면 중심과 확대/축소 레벨을 자동조절한다. 60 | * 지정한 영역의 padding 값은 0 61 | * @deprecated 제거될 예정. fitMapViewWithMapBounds: 를 사용하세요. 62 | * @param bounds 화면에 보여주고자 하는 영역 (MTMapPoint 타입의 좌하단 지점과 우상단 지점을 인자로 갖는 구조체) 63 | */ 64 | 65 | + (MTMapCameraUpdate *)fitMapView:(MTMapBounds)bounds; 66 | 67 | /** 68 | * padding 값을 반영한 지정한 영역이 화면에 지정된 나타나도록 지도화면 중심과 확대/축소 레벨을 자동조절한다. 69 | * @deprecated 제거될 예정. fitMapViewWithMapBounds:withPadding: 를 사용하세요. 70 | * @param bounds 화면에 보여주고자 하는 영역 (MTMapPoint 타입의 좌하단 지점과 우상단 지점을 인자로 갖는 구조체) 71 | * @param padding 지정한 영역의 padding 값 72 | */ 73 | 74 | + (MTMapCameraUpdate *)fitMapView:(MTMapBounds)bounds withPadding:(CGFloat)padding; 75 | 76 | /** 77 | * padding 값을 반영한 지정한 영역이 화면에 지정된 나타나도록 하되 78 | * 지정한 최소 레벨과 최대 레벨 범위 안의 지도화면 중심과 확대/축소 레벨을 자동조절 한다. 79 | * @deprecated 제거될 예정. fitMapViewWithMapBounds:withPadding:withMinZoomLevel:withMaxZoomLevel: 를 사용하세요. 80 | * @param bounds 화면에 보여주고자 하는 영역 (MTMapPoint 타입의 좌하단 지점과 우상단 지점을 인자로 갖는 구조체) 81 | * @param padding 지정한 영역의 padding 값 82 | * @param minZoomLevel 지도 화면 최대 확대 레벨 값 (-2~12, 값이 작을수록 더 좁은 영역이 화면이 보임. 지도 화면이 확대됨) 83 | * @param maxZoomLevel 지도 화면 최대 축소 레벨 값 (-2~12, 값이 클수록 더 넓은 영역이 화면이 보임. 지도 화면이 축소됨) 84 | */ 85 | 86 | + (MTMapCameraUpdate *)fitMapView:(MTMapBounds)bounds withPadding:(CGFloat)padding withMinZoomLevel:(MTMapZoomLevel)minZoomLevel withMaxZoomLevel:(MTMapZoomLevel)maxZoomLevel; 87 | 88 | /** 89 | * 지정한 영역이 화면에 나타나도록 지도화면 중심과 확대/축소 레벨을 자동조절한다. 90 | * 지정한 영역의 padding 값은 0 91 | * @param bounds 화면에 보여주고자 하는 영역 (MTMapPoint 타입의 좌하단 지점과 우상단 지점을 인자로 갖는 구조체) 92 | */ 93 | 94 | + (MTMapCameraUpdate *)fitMapViewWithMapBounds:(MTMapBoundsRect *)bounds; 95 | 96 | /** 97 | * padding 값을 반영한 지정한 영역이 화면에 지정된 나타나도록 지도화면 중심과 확대/축소 레벨을 자동조절한다. 98 | * @param bounds 화면에 보여주고자 하는 영역 (MTMapPoint 타입의 좌하단 지점과 우상단 지점을 인자로 갖는 구조체) 99 | * @param padding 지정한 영역의 padding 값 100 | */ 101 | 102 | + (MTMapCameraUpdate *)fitMapViewWithMapBounds:(MTMapBoundsRect *)bounds withPadding:(CGFloat)padding; 103 | 104 | /** 105 | * padding 값을 반영한 지정한 영역이 화면에 지정된 나타나도록 하되 106 | * 지정한 최소 레벨과 최대 레벨 범위 안의 지도화면 중심과 확대/축소 레벨을 자동조절 한다. 107 | * @param bounds 화면에 보여주고자 하는 영역 (MTMapPoint 타입의 좌하단 지점과 우상단 지점을 인자로 갖는 구조체) 108 | * @param padding 지정한 영역의 padding 값 109 | * @param minZoomLevel 지도 화면 최대 확대 레벨 값 (-2~12, 값이 작을수록 더 좁은 영역이 화면이 보임. 지도 화면이 확대됨) 110 | * @param maxZoomLevel 지도 화면 최대 축소 레벨 값 (-2~12, 값이 클수록 더 넓은 영역이 화면이 보임. 지도 화면이 축소됨) 111 | */ 112 | 113 | + (MTMapCameraUpdate *)fitMapViewWithMapBounds:(MTMapBoundsRect *)bounds withPadding:(CGFloat)padding withMinZoomLevel:(MTMapZoomLevel)minZoomLevel withMaxZoomLevel:(MTMapZoomLevel)maxZoomLevel; 114 | 115 | @end 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapCircle.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Map Circle Class 3 | * @file MTMapCircle.h 4 | * @author Soo-Hyun Park (goaeng0824@daumcorp.com) 5 | * @date 2014/6/11 6 | * @copyright 7 | * Copyright 2014 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | /** 15 | * @brief 지도도화면 위에 추가되는 Circle에 해당하는 Class. 16 | * 지도화면 위에 Circle을 추가하기 위해서는 17 | * MTMapCircle 객체를 생성하여 MTMapView객체에 등록해 주어야 한다. 18 | * (MTMapView.addCircle:) 19 | * Circle의 중심점을 설정하고 선 색상, 선 두께, 영역 색깔, 반경을 지정할 수 있다. 20 | * @see MTMapView 21 | */ 22 | @interface MTMapCircle : NSObject { 23 | @private 24 | MTMapPoint* _circleCenterPoint; 25 | float _circleLineWidth; 26 | UIColor* _circleLineColor; 27 | UIColor* _circleFillColor; 28 | float _circleRadius; 29 | NSInteger _tag; 30 | } 31 | 32 | /** 33 | * MTMapCircle 객체를 생성한다. autorelease 상태로 MTMapCircle 객체를 생성하여 리턴한다. 34 | */ 35 | + (instancetype)circle; 36 | 37 | /** 38 | * Circle의 중심점을 지정한다. 39 | */ 40 | @property (nonatomic, retain) MTMapPoint* circleCenterPoint; 41 | 42 | /** 43 | * Circle의 선 두께를 지정한다. 44 | */ 45 | @property (nonatomic, assign) float circleLineWidth; 46 | 47 | /** 48 | * Circle의 선 색상을 지정한다. 49 | */ 50 | @property (nonatomic, retain) UIColor* circleLineColor; 51 | 52 | /** 53 | * Circle의 영역 색상을 지정한다. 54 | */ 55 | @property (nonatomic, retain) UIColor* circleFillColor; 56 | 57 | /** 58 | * Circle의 반경 값을 지정한다. 59 | */ 60 | @property (nonatomic, assign) float circleRadius; 61 | 62 | /** 63 | * Circle 객체에 임의의 정수값(tag)을 지정할 수 있다. 64 | * MTMapView에 등록된 Circle들 중 특정 Circle을 찾기 위한 식별자로 사용할 수 있다. 65 | * tag값을 반드시 지정해야 하는 것은 아니다. 66 | * @see MTMapView.findCircleByTag: 67 | */ 68 | @property (nonatomic, assign) NSInteger tag; 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapGeometry.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Daum Map Geometry Data Types 3 | * @file MTMapGeometry.h 4 | * @author Byung-Wan Lim (bwlim@daumcorp.com) 5 | * @date 2011/11/04 6 | * @copyright 7 | * Copyright 2012 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | * Geoid 타원체 상의 한 점을 표현하는 지도 좌표 타입 (WGS84) 14 | * 위도(latitude)와 경도(longitude)값으로 구성된다. 15 | */ 16 | typedef struct { 17 | double latitude; /**< 위도 값 */ 18 | double longitude; /**< 경도 값 */ 19 | } MTMapPointGeo; 20 | 21 | /** 22 | * 위도 경도 값으로 MTMapPointGeo 데이터 구조를 생성하는 매크로 23 | * @param latitude 위도 값 24 | * @param longitude 경도 값 25 | * @return MTMapPointGeo 데이터 구조 26 | */ 27 | #define MTMapPointGeoMake(latitude,longitude) (MTMapPointGeo){(double)latitude, (double)longitude} 28 | 29 | /** 30 | * Geoid 상의 구면 좌표를 평면으로 프로젝션한 지도 좌표 정보를 저장하는 데이터 구조 31 | * 평면 좌표 체계로는 WCONG(Daum), CONG(Daum), WTM 등이 있다. 32 | */ 33 | typedef struct { 34 | double x; /**< x 좌표값 */ 35 | double y; /**< y 좌표값 */ 36 | } MTMapPointPlain; 37 | 38 | /** 39 | * x, y 좌표 값으로 MTMapPointPlain 데이터 구조를 생성하는 매크로 40 | * @param x x 좌표값 41 | * @param y y 좌표값 42 | * @return MTMapPointGeo 데이터 구조 43 | */ 44 | #define MTMapPointPlainMake(x,y) (MTMapPointPlain){(double)x, (double)y} 45 | 46 | @class InternalCoord; // internal class processing map coordinates 47 | 48 | /** 49 | * @brief 지도 화면위 한 지점을 표현할 수 있는 Point Class. 50 | * 지도 화면 위의 위치와 관련된 작업을 처리할 때 항상 MTMapPoint 객체를 사용한다. 51 | * MTMapPoint 객체는 위경도값(WGS84)을 이용하여 생성하거나, 52 | * 평면 좌표값(WCONG(Daum), WTM)을 이용하여 생성할 수 있다. 53 | * 특정 좌표시스템의 좌표를 이용하여 MTMapPoint객체를 생성한 후에 54 | * mapPointGeo:, mapPointWCONG, mapPointWTM등의 메소드를 통해 55 | * 다른 좌표 시스템의 좌표값으로 손쉽게 조회해 볼 수 있다. 56 | */ 57 | @interface MTMapPoint : NSObject { 58 | @private 59 | InternalCoord* _internalCoord; 60 | } 61 | 62 | /** 63 | * 위경도 좌표 시스템(WGS84)의 좌표값으로 MTMapPoint 객체를 생성한다. 64 | * @param mapPointGeo 위경도 좌표 시스템(WGS84)의 좌표값 65 | * @return MTMapPoint 객체 66 | */ 67 | + (instancetype)mapPointWithGeoCoord:(MTMapPointGeo)mapPointGeo; 68 | 69 | /** 70 | * WCONG(Daum) 평면 좌표시스템의 좌표값으로 MTMapPoint 객체를 생성한다. 71 | * @param mapPointWCONG WCONG(Daum) 평면 좌표시스템의 좌표값 72 | * @return MTMapPoint 객체 73 | */ 74 | + (instancetype)mapPointWithWCONG:(MTMapPointPlain)mapPointWCONG; 75 | 76 | /** 77 | * CONG(Daum) 평면 좌표시스템의 좌표값으로 MTMapPoint 객체를 생성한다. 78 | * @param mapPointCONG CONG(Daum) 평면 좌표시스템의 좌표값 79 | * @return MTMapPoint 객체 80 | */ 81 | + (instancetype)mapPointWithCONG:(MTMapPointPlain)mapPointCONG; 82 | 83 | /** 84 | * WTM 평면 좌표시스템의 좌표값으로 MTMapPoint 객체를 생성한다. 85 | * @param mapPointWTM WCONG(Daum) WTM 평면 좌표시스템의 좌표값 86 | * @return MTMapPoint 객체 87 | */ 88 | + (instancetype)mapPointWithWTM:(MTMapPointPlain)mapPointWTM; 89 | 90 | /** 91 | * MapView의 좌상단 기준 Pixel 좌표값으로 MTMapPoint 객체를 생성한다. 92 | * @param mapPointScreenLocation Pixel 좌표시스템의 좌표값 93 | * @return MTMapPoint 객체 94 | */ 95 | + (instancetype)mapPointWithScreenLocation:(MTMapPointPlain)mapPointScreenLocation; 96 | 97 | /** 98 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 위경도 좌표시스템(WGS84)의 좌표값으로 조회한다. 99 | * @return 위경도 좌표시스템(WGS84)의 좌표값 100 | */ 101 | - (MTMapPointGeo)mapPointGeo; 102 | 103 | /** 104 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 위경도 좌표시스템(WGS84)의 좌표값을 이용하여 재설정한다. 105 | * @param mapPointGeo 위경도 좌표시스템(WGS84)의 좌표값 106 | */ 107 | - (void)setMapPointGeo:(MTMapPointGeo)mapPointGeo; 108 | 109 | /** 110 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 WCONG(Daum) 평면좌표계의 좌표값으로 조회한다. 111 | * @return WCONG(Daum) 평면좌표계의 좌표값 112 | */ 113 | - (MTMapPointPlain)mapPointWCONG; 114 | 115 | /** 116 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 WCONG(Daum) 평면좌표계의 좌표값을 이용하여 재설정한다. 117 | * @param mapPointWCONG WCONG(Daum) 평면좌표계의 좌표값 118 | */ 119 | - (void)setMapPointWCONG:(MTMapPointPlain)mapPointWCONG; 120 | 121 | /** 122 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 CONG(Daum) 평면좌표계의 좌표값으로 조회한다. 123 | * @return CONG(Daum) 평면좌표계의 좌표값 124 | */ 125 | - (MTMapPointPlain)mapPointCONG; 126 | 127 | /** 128 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 CONG(Daum) 평면좌표계의 좌표값을 이용하여 재설정한다. 129 | * @param mapPointCONG CONG(Daum) 평면좌표계의 좌표값 130 | */ 131 | - (void)setMapPointCONG:(MTMapPointPlain)mapPointCONG; 132 | 133 | /** 134 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 WTM 평면좌표계의 좌표값으로 조회한다. 135 | * @return WCONG(Daum) WTM 평면좌표계의 좌표값 136 | */ 137 | - (MTMapPointPlain)mapPointWTM; 138 | 139 | /** 140 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 WTM 평면좌표계의 좌표값을 이용하여 재설정한다. 141 | * @param mapPointWTM WTM 평면좌표계의 좌표값 142 | */ 143 | - (void)setMapPointWTM:(MTMapPointPlain)mapPointWTM; 144 | 145 | /** 146 | * MTMapPoint 객체가 나타내는 지점의 좌표값을 WTM 평면좌표계의 좌표값으로 조회한다. 147 | * @return MapView 좌상단 기준 Pixel 좌표값 148 | */ 149 | - (MTMapPointPlain)mapPointScreenLocation; 150 | 151 | @end 152 | 153 | /** 154 | * 지도 화면의 영역을 표현하는 데이터 구조 155 | * 영역의 좌하단 지점과 우상단 지점을 각각 MTMapPoint 타입의 인자로 갖는다. 156 | * @deprecated 제거될 예정. MTMapBoundsRect 클래스를 사용하세요. 157 | */ 158 | typedef struct { 159 | __unsafe_unretained MTMapPoint* bottoomLeft; /**< 영역의 좌하단 좌표 */ 160 | __unsafe_unretained MTMapPoint* topRight; /**< 영역의 우상단 좌표 */ 161 | } MTMapBounds; 162 | 163 | /** 164 | * 영역의 좌하단 좌표값과 우상단 좌표값으로 MTMapBounds 데이터 구조를 생성하는 매크로 165 | * @deprecated 제거될 예정. MTMapBoundsRect 클래스를 사용하세요. 166 | * @param bottoomLeft 영역의 좌하단 좌표 167 | * @param topRight 영역의 우상단 좌표 168 | * @return MTMapBounds 데이터 구조 169 | */ 170 | #define MTMapBoundsMake(bottoomLeft,topRight) (MTMapBounds){(MTMapPoint *)bottoomLeft, (MTMapPoint *)topRight} 171 | 172 | /** 173 | * @brief 지도 화면의 영역을 표현하는 BoundsRect Class. 174 | * 영역의 좌하단 지점과 우상단 지점을 각각 MTMapPoint 타입의 인자로 갖는다. 175 | */ 176 | @interface MTMapBoundsRect : NSObject 177 | 178 | /** 179 | * MTMapBoundsRect 객체를 생성한다. autorelease 상태로 MTMapBoundsRect 객체를 생성하여 리턴한다. 180 | */ 181 | 182 | + (instancetype)boundsRect; 183 | 184 | /** 185 | * 영역의 좌하단 좌표 186 | */ 187 | @property (nonatomic, retain) MTMapPoint *bottomLeft; 188 | 189 | /** 190 | * 영역의 우상단 좌표 191 | */ 192 | @property (nonatomic, retain) MTMapPoint *topRight; 193 | 194 | @end 195 | 196 | /** 197 | * 이미지 상의 한 픽셀의 위치를 표현하는 데이터 구조 198 | * 이미지의 좌하단이 offset (0,0)이 되고 오른쪽 방향이 x+ 위쪽 방향이 y+ 가 된다. 199 | * @see MTMapPOIItem.customImageAnchorPointOffset 200 | */ 201 | typedef struct { 202 | int offsetX; /**< x 픽셀 좌표 */ 203 | int offsetY; /**< y 픽셀 좌표 */ 204 | } MTMapImageOffset; 205 | 206 | /** 207 | * 현위치 정확도를 나타내는 데이터 타입 (단위:meter) 208 | */ 209 | typedef double MTMapLocationAccuracy; 210 | 211 | /** 212 | * 지도 회전 각도를 나타내는 데이터 타입 (단위:degree) 213 | */ 214 | typedef float MTMapRotationAngle; 215 | 216 | /** 217 | * x/y offset 값으로 MTMapImageOffset 데이터 구조를 생성하는 매크로 218 | * @param offsetX x offset 값 219 | * @param offsetY y offset 값 220 | * @return MTMapImageOffset 데이터 구조 221 | */ 222 | #define MTMapImageOffsetMake(offsetX, offsetY) (MTMapImageOffset){(int)offsetX, (int)offsetY} 223 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapLocationMarkerItem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Map Location Marker Item Class 3 | * @file MTMapLocationMarkerItem.h 4 | * @author Soo-hyun Park (goaeng0824@daumcorp.com) 5 | * @date 2014/6/16 6 | * @copyright 7 | * Copyright 2014 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | /** 14 | * @brief 지도화면 위에 추가되는 현위치 마커 Item에 해당하는 Class. 15 | * 지도화면 위의 현위치 마커를 개발자가 원하는 UI로 바꿔주기 위해서는 16 | * MTMapLocationMarkerItem 객체를 생성하여 MTMapView 객체에 등록해 주어야 한다. (updateCurrentLocationMarker:) 17 | * Default로 제공되는 현위치 마커를 사용하기 위해서는 18 | * MTMapLocationMarkerItem 객체의 값을 nil로 넘겨준다. 19 | * @see MTMapView 20 | */ 21 | 22 | @interface MTMapLocationMarkerItem : NSObject { 23 | @private 24 | NSString* _customImageName; 25 | NSString* _customTrackingImageName; 26 | NSArray* _customTrackingAnimationImageNames; 27 | float _customTrackingAnimationDuration; 28 | NSString* _customDirectionImageName; 29 | MTMapImageOffset _customImageAnchorPointOffset; 30 | MTMapImageOffset _customTrackingImageAnchorPointOffset; 31 | MTMapImageOffset _customDirectionImageAnchorPointOffset; 32 | float _radius; 33 | UIColor *_strokeColor; 34 | UIColor *_fillColor; 35 | } 36 | 37 | /** 38 | * MTMapLocationMarkerItem 객체를 생성한다. autorelease 상태로 MTMapLocationMarkerItem 객체를 생성하여 리턴한다. 39 | */ 40 | 41 | + (instancetype)mapLocationMarkerItem; 42 | 43 | /** 44 | * 기본 제공되는 Map Location Marker 아이콘 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지를 사용하고자 하는 경우에 45 | * 사용하고자 하는 Image 이름을 지정한다. 46 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 47 | */ 48 | @property (nonatomic, copy) NSString* customImageName; 49 | 50 | /** 51 | * 기본 제공되는 Map Location Marker의 Tracking 중인 아이콘 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지를 사용하고자 하는 경우에 52 | * 사용하고자 하는 Image 이름을 지정한다. 53 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 54 | */ 55 | @property (nonatomic, copy) NSString* customTrackingImageName; 56 | 57 | /** 58 | * 기본 제공되는 Map Location Marker의 Tracking 중인 아이콘 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지들로 애니매이션을 보여주고 싶은 경우 59 | * 애니매이션에 사용하고자 하는 Image 이름들을 순서대로 지정한다. 60 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 61 | */ 62 | @property (nonatomic, copy) NSArray* customTrackingAnimationImageNames; 63 | 64 | /** 65 | * 기본 제공되는 Map Location Marker의 Tracking 중인 아이콘 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지들로 애니매이션을 보여주고 싶은 경우 66 | * 애니매이션의 duration을 지정한다. default = 1.0 초 67 | */ 68 | @property (nonatomic, assign) float customTrackingAnimationDuration; 69 | 70 | /** 71 | * 기본 제공되는 Map Location Marker의 방향 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지를 사용하고자 하는 경우에 72 | * 사용하고자 하는 Image 이름을 지정한다. 73 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 74 | */ 75 | @property (nonatomic, copy) NSString* customDirectionImageName; 76 | 77 | /** 78 | * customImageName에 지정한 이미지 상의 어느 지점이 현위치 지점에 해당하는 지를 설정한다. 79 | * 이미지 상의 Pixel 좌표를 지정한다. 이미지의 좌하단이 원점(0,0)이고 오른쪽 방향이 x+축, 위쪽 방향이 y+축이 된다. 80 | * 예를들어, 이미지의 pixel 크기가 60x60인 Custom Image의 81 | * 정중앙이 현위치 좌표 지점에 해당된다면 82 | * mapView.customImageAnchorPointOffset = MTMapImageOffsetMake(30,30) 와 같이 지정할 수 있다. 83 | * 값을 지정하지 않는 경우 이미지의 중앙이 Anchor Point로 설정된다. 84 | */ 85 | @property (nonatomic, assign) MTMapImageOffset customImageAnchorPointOffset; 86 | 87 | /** 88 | * customImageName에 지정한 이미지 상의 어느 지점이 현위치 지점에 해당하는 지를 설정한다. 89 | * 이미지 상의 Pixel 좌표를 지정한다. 이미지의 좌하단이 원점(0,0)이고 오른쪽 방향이 x+축, 위쪽 방향이 y+축이 된다. 90 | * 예를들어, 이미지의 pixel 크기가 60x60인 Custom Image의 91 | * 정중앙이 현위치 좌표 지점에 해당된다면 92 | * mapView.customTrackingImageAnchorPointOffset = MTMapImageOffsetMake(30,30) 와 같이 지정할 수 있다. 93 | * 값을 지정하지 않는 경우 이미지의 중앙이 Anchor Point로 설정된다. 94 | */ 95 | @property (nonatomic, assign) MTMapImageOffset customTrackingImageAnchorPointOffset; 96 | 97 | /** 98 | * customImageName에 지정한 이미지 상의 어느 지점이 현위치 지점에 해당하는 지를 설정한다. 99 | * 이미지 상의 Pixel 좌표를 지정한다. 이미지의 좌하단이 원점(0,0)이고 오른쪽 방향이 x+축, 위쪽 방향이 y+축이 된다. 100 | * 예를들어, 이미지의 pixel 크기가 60x60인 Custom Image의 101 | * 하단 변(edge)의 정중앙이 좌표 지점에 해당된다면 102 | * mapView.customTrackingImageAnchorPointOffset = MTMapImageOffsetMake(30,0) 와 같이 지정할 수 있다. 103 | * 값을 지정하지 않는 경우 이미지의 하단 중앙이 Anchor Point로 설정된다. 104 | */ 105 | @property (nonatomic, assign) MTMapImageOffset customDirectionImageAnchorPointOffset; 106 | 107 | /** 108 | * 기본 제공되는 Map Location Marker의 Circle 반경 값을 지정한다. 109 | */ 110 | @property (nonatomic, assign) float radius; 111 | 112 | /** 113 | * 기본 제공되는 Map Location Marker의 Circle 선 색상을 지정한다. 114 | */ 115 | @property (nonatomic, retain) UIColor* strokeColor; 116 | 117 | /** 118 | * 기본 제공되는 Map Location Marker의 Circle 영역 색상을 지정한다. 119 | */ 120 | @property (nonatomic, retain) UIColor* fillColor; 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapPOIItem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Map POI Item Class 3 | * @file MTMapPOIItem.h 4 | * @author Byung-Wan Lim (bwlim@daumcorp.com) 5 | * @date 2011/11/10 6 | * @copyright 7 | * Copyright 2012 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | /** 14 | * POI Item 아이콘(마커) 타입 enumeration 15 | * @see MTMapPOIItem.markerType property 16 | */ 17 | typedef NS_ENUM(NSInteger, MTMapPOIItemMarkerType) { 18 | MTMapPOIItemMarkerTypeBluePin, /**< 파란색 핀 */ 19 | MTMapPOIItemMarkerTypeRedPin, /**< 빨간색 핀 */ 20 | MTMapPOIItemMarkerTypeYellowPin, /**< 노란색 핀 */ 21 | MTMapPOIItemMarkerTypeCustomImage /**< 개발자가 지정한 POI Item 아이콘 이미지 사용 */ 22 | }; 23 | 24 | /** 25 | * POI Item 아이콘(마커)가 선택되어진 상태 타입 enumeration 26 | * @see MTMapPOIItem.markerSelectedType property 27 | */ 28 | typedef NS_ENUM(NSInteger, MTMapPOIItemMarkerSelectedType) { 29 | MTMapPOIItemMarkerSelectedTypeNone, /**< 선택 효과를 사용하지 않음 */ 30 | MTMapPOIItemMarkerSelectedTypeBluePin, /**< 파란색 핀 */ 31 | MTMapPOIItemMarkerSelectedTypeRedPin, /**< 빨간색 핀 */ 32 | MTMapPOIItemMarkerSelectedTypeYellowPin, /**< 노란색 핀 */ 33 | MTMapPOIItemMarkerSelectedTypeCustomImage /**< 개발자가 지정한 POI Item 아이콘 이미지 사용 */ 34 | }; 35 | 36 | /** 37 | * POI Item이 화면에 추가될때 애니매이션 타입 enumeration 38 | * @see MTMapPOIItem.showAnimationType property 39 | */ 40 | typedef NS_ENUM(NSInteger, MTMapPOIItemShowAnimationType) { 41 | MTMapPOIItemShowAnimationTypeNoAnimation, /**< 애니매이션 없음 */ 42 | MTMapPOIItemShowAnimationTypeDropFromHeaven, /**< POI Item 아이콘이 하늘에서 지도 위로 떨어지는 애니매이션 */ 43 | MTMapPOIItemShowAnimationTypeSpringFromGround /**< POI Item 아이콘이 땅위에서 스프링처럼 튀어나오는 듯한 애니매이션 */ 44 | }; 45 | 46 | /** 47 | * @brief 지도화면 위에 추가되는 POI(Point Of Interest) Item에 해당하는 Class. 48 | * 지도화면 위에 POI 아이콘(마커)를 추가하기 위해서는 49 | * MTMapPOIItem 객체를 생성하여 MTMapView객체에 등록해 주어야 한다. (MTMapView.addPOIItem:, MTMapView.addPOIItems:) 50 | * 이미 제공되고 있는 POI Item 아이콘을 그대로 사용할 수도 있고, 51 | * 개발자가 지정한 임의의 이미지를 POI Item 아이콘으로 사용할 수 있다. 52 | * MTMapView에 등록된 POI Item을 사용자가 선택하면 53 | * POI Item 아이콘(마커)위에 말풍선(Callout Balloon)이 나타나게 되며 54 | * 말풍선에는 POI Item 이름이 보여지게 된다. 55 | * 단말 사용자가 길게 누른후(long press) 끌어어(dragging) 위치를 이동시킬 수 있는 56 | * Draggable POI Item 도 생성하여 MTMapViewd에 등록할 수 있다. 57 | * @see MTMapView 58 | */ 59 | @interface MTMapPOIItem : NSObject { 60 | @private 61 | NSString* _itemName; 62 | MTMapPoint* _mapPoint; 63 | MTMapPOIItemMarkerType _markerType; 64 | MTMapPOIItemMarkerSelectedType _markerSelectedType; 65 | MTMapPOIItemShowAnimationType _showAnimationType; 66 | BOOL _showDisclosureButtonOnCalloutBalloon; 67 | BOOL _draggable; 68 | NSInteger _tag; 69 | NSObject* _userObject; 70 | NSString* _customImageName; 71 | NSString* _customSelectedImageName; 72 | UIImage* _customImage; 73 | UIImage* _customSelectedImage; 74 | 75 | NSString* _imageNameOfCalloutBalloonLeftSide; 76 | NSString* _imageNameOfCalloutBalloonRightSide; 77 | MTMapImageOffset _customImageAnchorPointOffset; 78 | UIView* _customCalloutBalloonView; 79 | UIView* _customHighlightedCalloutBalloonView; 80 | } 81 | 82 | /** 83 | * MTMapPOIItem 객체를 생성한다. autorelease 상태로 MTMapPOIItem 객체를 생성하여 리턴한다. 84 | */ 85 | + (instancetype)poiItem; 86 | 87 | /** 88 | * POI Item 이름을 지정한다. 89 | * POI Item 아이콘이 선택되면 나타나는 말풍선(Callout Balloon)에 POI Item 이름이 보여지게 된다. 90 | */ 91 | @property (nonatomic, copy) NSString* itemName; 92 | 93 | /** 94 | * POI Item의 지도상 좌표 95 | */ 96 | @property (nonatomic, retain) MTMapPoint* mapPoint; 97 | 98 | /** 99 | * POI Item 아이콘(마커) 타입 100 | * 기본 제공 POI Item 아이콘을 사용하거나, 101 | * 개발자가 지정한 임의의 이미지를 POI Item 아이콘으로 사용할 수 있다. 102 | * default = MTMapPOIItemMarkerTypeBluePin 103 | * @see MTMapPOIItemMarkerType 104 | */ 105 | @property (nonatomic, assign) MTMapPOIItemMarkerType markerType; 106 | 107 | /** 108 | * POI Item 아이콘(마커)가 선택되어진 상태 타입 109 | * 기본 제공 POI Item 아이콘을 사용하거나, 110 | * 개발자가 지정한 임의의 이미지를 POI Item 아이콘으로 사용할 수 있다. 111 | * default = MTMapPOIItemMarkerTypeNone 112 | * @see MTMapPOIItemMarkerSelectedType 113 | */ 114 | @property (nonatomic, assign) MTMapPOIItemMarkerSelectedType markerSelectedType; 115 | 116 | /** 117 | * POI Item이 지도화면에 나타날때 애니매이션 종류를 지정한다. 118 | * default = MTMapPOIItemShowAnimationTypeNoAnimation 119 | * @see MTMapPOIItemShowAnimationType 120 | */ 121 | @property (nonatomic, assign) MTMapPOIItemShowAnimationType showAnimationType; 122 | 123 | /** 124 | * POI Item이 사용자에 의해 선택된 경우 나타나는 말풍선에 나타나는 글자 마지막에 125 | * Disclosure Button 이미지(꺽쇠(>)모양 이미지)를 표시할지 여부를 지정한다. 126 | * default = YES 127 | */ 128 | @property (nonatomic, assign) BOOL showDisclosureButtonOnCalloutBalloon; 129 | 130 | /** 131 | * 사용자가 위치를 변경할 수 있는 POI Item을 생성하려면 132 | * draggable property를 YES로 지정한다. 133 | * draggable = YES인 POI Item(Draggable POI Item)을 사용자가 터치하면 POI Item을 사용자가 이동할 수 있음을 알려주는 134 | * 안내문구가 지도화면에 나타난다. 135 | * 사용자가 Draggable POI Item을 길게 누른 후(long press) 원하는 위치로 끌어서(dragging) 136 | * POI Item의 위치를 변경할 수 있다. 137 | * 변경된 POI Item의 위치는 MTMapViewDelegate.MTMapView:draggablePOIItem:movedToNewMapPoint: 메소드를 통해 138 | * 통보받을 수 있다. 139 | * default = NO 140 | * @see MTMapViewDelegate 141 | */ 142 | @property (nonatomic, assign) BOOL draggable; 143 | 144 | /** 145 | * POI Item 객체에 임의의 정수값(tag)을 지정할 수 있다. 146 | * MTMapView 객체에 등록된 POI Item들 중 특정 POI Item을 찾기 위한 식별자로 사용할 수 있다. 147 | * tag값을 반드시 지정해야 하는 것은 아니다. 148 | * @see MTMapView.findPOIItemByTag: 149 | */ 150 | @property (nonatomic, assign) NSInteger tag; 151 | 152 | /** 153 | * 해당 POI Item과 관련된 정보를 저장하고 있는 임의의 객체를 저장하고자 할때 사용한다. 154 | * 사용자가 POI Item을 선택하는 경우 등에 선택된 POI Item과 관련된 정보를 손쉽게 접근할 수 있다. 155 | */ 156 | @property (nonatomic, retain) NSObject* userObject; 157 | 158 | /** 159 | * markerType이 MTMapPOIItemMarkerTypeCustomImage인 경우에만 지정한다. 160 | * 기본 제공되는 POI Item 아이콘 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지를 사용하고자 하는 경우에 161 | * 사용하고자 하는 Image 이름을 지정한다. Application Bundle에 포함된 162 | * Image Resource 이름(ex. "MyPOIIconImage.png")을 지정할 수 있다. 163 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 164 | * @see MTMapPOIItemMarkerTypeCustomImage 165 | */ 166 | @property (nonatomic, copy) NSString* customImageName; 167 | 168 | /** 169 | * markerType이 MTMapPOIItemMarkerSelectedTypeCustomImage인 경우에만 지정한다. 170 | * 개발자가 지정한 Custom 이미지를 사용하고 있는 POI Item 아이콘(마커)이 선택되었을 경우에 171 | * 사용하고자 하는 Image 이름을 지정한다. Application Bundle에 포함된 172 | * Image Resource 이름(ex. "MyPOIIconImage.png")을 지정할 수 있다. 173 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 174 | * @see MTMapPOIItemMarkerTypeCustomImage 175 | */ 176 | @property (nonatomic, copy) NSString* customSelectedImageName; 177 | 178 | /** 179 | * markerType이 MTMapPOIItemMarkerTypeCustomImage인 경우에만 지정한다. 180 | * 기본 제공되는 POI Item 아이콘 이미지를 사용하지 않고, 개발자가 지정한 Custom 이미지를 사용하고자 하는 경우에 181 | * 사용하고자 하는 Runtime 시에 생성한 이미지의 UIImage 객체를 지정한다. 182 | * customImageName에 값이 지정되어 있는 경우는 customImageName의 값이 우선 적용 된다. 183 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 184 | * @see MTMapPOIItemMarkerTypeCustomImage 185 | */ 186 | @property (nonatomic, copy) UIImage* customImage; 187 | 188 | /** 189 | * markerType이 MTMapPOIItemMarkerSelectedTypeCustomImage인 경우에만 지정한다. 190 | * 개발자가 지정한 Custom 이미지를 사용하고 있는 POI Item 아이콘(마커)이 선택되었을 경우에 191 | * 사용하고자 하는 Runtime 시에 생성한 이미지의 UIImage 객체를 지정한다. 192 | * customSelectedImageName에 값이 지정되어 있는 경우는 customSelectedImageName의 값이 우선 적용 된다. 193 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 194 | * @see MTMapPOIItemMarkerTypeCustomImage 195 | */ 196 | @property (nonatomic, copy) UIImage* customSelectedImage; 197 | 198 | /** 199 | * POI Item이 사용자에 의해 선택된 경우 나타나는 말풍선의 왼쪽 끝에 200 | * 사용하고자 하는 Image 이름을 지정한다. Application Bundle에 포함된 201 | * Image Resource 이름(ex. "MyPOIIconImage.png")을 지정할 수 있다. 202 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 203 | */ 204 | @property (nonatomic, copy) NSString* imageNameOfCalloutBalloonLeftSide; 205 | 206 | /** 207 | * POI Item이 사용자에 의해 선택된 경우 나타나는 말풍선의 오른쪽 끝에 208 | * 사용하고자 하는 Image 이름을 지정한다. Application Bundle에 포함된 209 | * Image Resource 이름(ex. "MyPOIIconImage.png")을 지정할 수 있다. 210 | * Custom Image는 Screen Scale = 2.0(Retina Display)에 대응하는 고해상도 이미지를 지정해야 한다. 211 | */ 212 | @property (nonatomic, copy) NSString* imageNameOfCalloutBalloonRightSide; 213 | 214 | /** 215 | * markerType이 MTMapPOIItemMarkerTypeCustomImage인 경우에만 지정한다. 216 | * customImageName에 지정한 이미지 상의 어느 지점이 POI Item의 좌표 지점에 해당하는 지를 설정한다. 217 | * 이미지 상의 Pixel 좌표를 지정한다. 이미지의 좌하단이 원점(0,0)이고 오른쪽 방향이 x+축, 위쪽 방향이 y+축이 된다. 218 | * 예를들어, 이미지의 pixel 크기가 60x60인 Custom Image의 219 | * 하단 변(edge)의 정중앙이 POI Item 좌표 지점에 해당된다면 220 | * mapView.customImageAnchorPointOffset = MTMapImageOffsetMake(30,0) 와 같이 지정할 수 있다. 221 | * 값을 지정하지 않는 경우 이미지의 하단 중앙이 Anchor Point로 설정된다. 222 | * @see MTMapPOIItemMarkerTypeCustomImage 223 | */ 224 | @property (nonatomic, assign) MTMapImageOffset customImageAnchorPointOffset; 225 | 226 | /** 227 | * POI Item이 사용자에 의해 선택된 경우 나타나는 말풍선 대신 228 | * Custom View를 지정할 수 있다. 229 | * @see customHighlightedCalloutBalloonView 230 | */ 231 | @property (nonatomic, retain) UIView* customCalloutBalloonView; 232 | 233 | /** 234 | * POI Item이 사용자에 의해 선택된 경우 나타나는 말풍선 대신 235 | * Custom View를 사용할 경우에만 지정한다. 236 | * Custom View가 선택되어진 상태일 때의 View를 237 | * 별도로 지정할 수 있다. 238 | * @see customCalloutBalloonView 239 | */ 240 | @property (nonatomic, retain) UIView* customHighlightedCalloutBalloonView; 241 | 242 | /** 243 | * POI Item이 나타내는 Marker의 회전 각을 지정 한다. 244 | * 각도는 0~360의 값을 지정하면 된다. 245 | */ 246 | @property (nonatomic, assign) float rotation; 247 | 248 | 249 | - (void) move:(MTMapPoint*)pt withAnimation:(BOOL)animate; 250 | 251 | 252 | @end 253 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapPolyline.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Map Polyline Class 3 | * @file MTMapPolyline.h 4 | * @author Byung-Wan Lim (bwlim@daumcorp.com) 5 | * @date 2011/11/10 6 | * @copyright 7 | * Copyright 2012 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | /** 15 | * @brief 지도도화면 위에 추가되는 Polyline에 해당하는 Class. 16 | * Polyline은 여러 개의 점들을 순서대로 연결한 선들의 집합이다. 17 | * 지도화면 위에 Polyline을 추가하여 경로나 영역등을 표현할 수 있다. 18 | * 지도화면 위에 Polyline을 추가하기 위해서는 19 | * MTMapPolyline 객체를 생성하여 MTMapView객체에 등록해 주어야 한다. 20 | * (MTMapView.addPolyline:) 21 | * Polyline을 구성하는 좌표 리스트를 설정하고 선 색상을 지정할 수 있다. 22 | * @see MTMapView 23 | */ 24 | @interface MTMapPolyline : NSObject { 25 | @private 26 | NSMutableArray* _mapPointList; 27 | UIColor* _polylineColor; 28 | NSInteger _tag; 29 | } 30 | 31 | /** 32 | * MTMapPolyline 객체를 생성한다. autorelease 상태로 MTMapPolyline 객체를 생성하여 리턴한다. 33 | */ 34 | + (instancetype)polyLine; 35 | 36 | /** 37 | * MTMapPolyline 객체를 생성하고 Polyline을 구성하는 점들을 저장하는 Array의 크기를 미리 지정한다. 38 | * autorelease 상태로 MTMapPolyline 객체를 생성하여 리턴한다. 39 | * Polyline을 구성하는 점들의 개수를 미리 알수 있는 경우 capacity값을 지정하면 메모리를 효율적으로 사용할 수 있다. 40 | * @param capacity Polyline을 구성하는 점들의 좌표를 저장하는 Array의 메모리 할당 크기 (Polyline의 점 개수를 지정한다.) 41 | */ 42 | + (instancetype)polyLineWithCapacity:(NSUInteger)capacity; // capacity : reserved map point array size 43 | 44 | /** 45 | * Polyline을 구성하는 점들의 리스트를 조회할 수 있다. 46 | */ 47 | @property (nonatomic, readonly) NSArray* mapPointList; 48 | 49 | /** 50 | * Polyline의 선 색상을 지정한다. 51 | */ 52 | @property (nonatomic, retain) UIColor* polylineColor; 53 | 54 | /** 55 | * Polyline 객체에 임의의 정수값(tag)을 지정할 수 있다. 56 | * MTMapView에 등록된 Polyline들 중 특정 Polyline을 찾기 위한 식별자로 사용할 수 있다. 57 | * tag값을 반드시 지정해야 하는 것은 아니다. 58 | * @see MTMapView.findPolylineByTag: 59 | */ 60 | @property (nonatomic, assign) NSInteger tag; 61 | 62 | 63 | /** 64 | * Polyline에 점 하나를 추가한다. 65 | * Polyline 객체가 MTMapView에 등록된 후에는 점들을 추가해도 지도화면에 반영되지 않는다. 66 | * @param mapPoint 추가하고자 하는 점의 좌표 객체 67 | */ 68 | - (void)addPoint:(MTMapPoint*)mapPoint; 69 | 70 | /** 71 | * Polyline에 점 리스트를 추가한다. 72 | * Polyline 객체가 MTMapView 객체에 등록된 후에는 점들을 추가해도 지도화면에 반영되지 않는다. 73 | * @param mapPointList 추가하고자 하는 점들의 좌표 객체 리스트 74 | */ 75 | - (void)addPoints:(NSArray*)mapPointList; // Array of MTMapPoint 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Headers/MTMapReverseGeoCoder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Map POI Item Class 3 | * @file MTMapReverseGeoCoder.h 4 | * @author Byung-Wan Lim (bwlim@daumcorp.com) 5 | * @date 2011/11/17 6 | * @copyright 7 | * Copyright 2012 Daum Communications Corp. All rights reserved. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | @class MTMapReverseGeoCoderInternal; 14 | @protocol MTMapReverseGeoCoderDelegate; 15 | 16 | /** 17 | * @brief 지도 좌표를 주소 정보로 변환(Reverse Geo-Coding)하는 기능을 제공하는 Class 18 | */ 19 | @interface MTMapReverseGeoCoder : NSObject { 20 | @private 21 | MTMapReverseGeoCoderInternal* _internalImpl; 22 | } 23 | 24 | enum AddressType { ShortAddress = 1, FullAddress }; 25 | 26 | 27 | /** 28 | * MTMapReverseGeoCoder 객체를 생성한다. 29 | * 주소정보를 알고자 하는 지도 좌표와 Reverse Geo-coding 결과를 통보받을 수 있는 delegate 객체를 설정한다. 30 | * 비동기(Asynchronous) 방식으로 Reverse Geo-coding을 수행하고자 하는 경우 MTMapReverseGeoCoder 객체를 생성한다. 31 | * 동기(Synchronous, Blocking) 방식으로 Reverse Geo-coding을 실행하는 경우에는 findAddressForMapPoint:withAddressType: static 메소드를 사용한다. 32 | * @deprecated 제거될 예정입니다. 비동기(Asynchronous) 방식으로 Reverse Geo-coding을 수행하고자 하는 경우 executeFindingAddressForMapPoint:openAPIKey:completionHandler: 를 사용하십시오. 33 | * @param mapPoint 주소정보로 변화하고자하는 지도 좌표 34 | * @param delegate Reverse Geo-coding 결과를 통보받을 수 있는 delegate 객체 35 | * @param openAPIKey Open API Key 36 | */ 37 | - (instancetype)initWithMapPoint:(MTMapPoint*)mapPoint withDelegate:(id)delegate withOpenAPIKey:(NSString*)openAPIKey; 38 | 39 | /** 40 | * Reverse Geo-coding(Asynchronous) 서비스를 요청한다. 41 | * 주소 정보는 비동기 방식으로 delegate 객체에 전달된다. 42 | * @deprecated executeFindingAddressForMapPoint:openAPIKey:completionHandler: 를 사용하십시오. 43 | */ 44 | - (void)startFindingAddress; 45 | 46 | /** 47 | * @deprecated executeFindingAddressForMapPoint:openAPIKey:addressType:completionHandler: 를 사용하십시오. 48 | * @param addressType 변환 받을 주소 정보의 타입 49 | */ 50 | - (void)startFindingAddressWithAddressType:(enum AddressType)addressType; 51 | 52 | /** 53 | * Reverse Geo-coding(Asynchronous) 서비스 요청을 취소한다. 54 | */ 55 | - (void)cancelFindingAddress; 56 | 57 | /** 58 | * 동기(Synchronous, Blocking) 방식으로 Reverse Geo-coding 을 수행한다. 59 | * 메소드를 호출한 thread는 Reverse Geo-Coding 서비스가 수행되는 동한 block된 후 60 | * 변환된 주소정보를 리턴받는다. 61 | * @param mapPoint 주소정보로 변화하고자하는 지도 좌표 62 | * @param openAPIKey Open API Key 63 | * @return 주소정보 문자열 64 | */ 65 | + (NSString *)findAddressForMapPoint:(MTMapPoint*)mapPoint withOpenAPIKey:(NSString*)openAPIKey; 66 | 67 | /** 68 | * @param mapPoint 주소정보로 변화하고자하는 지도 좌표 69 | * @param openAPIKey Open API Key 70 | * @param addressType 변환 받을 주소 정보의 타입 71 | * @return 주소정보 문자열 72 | */ 73 | + (NSString *)findAddressForMapPoint:(MTMapPoint*)mapPoint withOpenAPIKey:(NSString*)openAPIKey withAddressType:(enum AddressType)addressType; 74 | 75 | /** 76 | * Reverse Geo-coding 서비스 호출 결과 block 타입 77 | */ 78 | typedef void (^MTMapReverseGeoCoderCompletionHandler) (BOOL success, NSString *addressForMapPoint, NSError *error); 79 | 80 | /** 81 | * 비동기(Asynchronous) 방식으로 Reverse Geo-coding을 수행한다. 82 | * 변환 받을 주소 정보는 addressType의 default 값인 ShortAddress인 형태로 요청한다. 83 | * @param mapPoint 주소 정보로 변화하고자하는 지도 좌표 84 | * @param openAPIKey Open API Key 85 | * @param handler Reverse Geo-Coding 서비스 호출 결과의 block 86 | */ 87 | + (void)executeFindingAddressForMapPoint:(MTMapPoint *)mapPoint 88 | openAPIKey:(NSString *)openAPIKey 89 | completionHandler:(MTMapReverseGeoCoderCompletionHandler)handler; 90 | 91 | /** 92 | * 비동기(Asynchronous) 방식으로 Reverse Geo-coding을 수행한다. 93 | * @param mapPoint 주소 정보로 변화하고자하는 지도 좌표 94 | * @param openAPIKey Open API Key 95 | * @param addressType 변환 받을 주소 정보의 타입 96 | * @param handler Reverse Geo-Coding 서비스 호출 결과의 block 97 | */ 98 | + (void)executeFindingAddressForMapPoint:(MTMapPoint *)mapPoint 99 | openAPIKey:(NSString *)openAPIKey 100 | addressType:(enum AddressType)addressType 101 | completionHandler:(MTMapReverseGeoCoderCompletionHandler)handler; 102 | 103 | @end 104 | 105 | 106 | /** 107 | * Reverse Geo-Coding 결과를 비동기적으로 통보받는 객체가 구현해야하는 interface protocol 108 | * @deprecated 제거될 예정입니다. 109 | */ 110 | @protocol MTMapReverseGeoCoderDelegate 111 | @optional 112 | 113 | /** 114 | * 주소를 찾은 경우 호출된다. 115 | * @deprecated 제거될 예정입니다. 116 | * @param rGeoCoder MTMapReverseGeoCoder 객체 117 | * @param addressString 결과 주소 문자열 118 | */ 119 | - (void)MTMapReverseGeoCoder:(MTMapReverseGeoCoder*)rGeoCoder foundAddress:(NSString*)addressString; 120 | 121 | /** 122 | * Reverse Geo-Coding 서비스 호출에 실패한 경우 호출된다. 123 | * @deprecated 제거될 예정입니다. 124 | * @param rGeoCoder MTMapReverseGeoCoder 객체 125 | * @param error NSError 객체 126 | */ 127 | - (void)MTMapReverseGeoCoder:(MTMapReverseGeoCoder*)rGeoCoder failedToFindAddressWithError:(NSError*)error; 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/Info.plist -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/copyright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/copyright.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/daum_copyright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/daum_copyright.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/daum_th_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/daum_th_line.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/detail_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/detail_button.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/info_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/info_box.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/info_box_tail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/info_box_tail.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_custom.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_custom@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_custom@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_red.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_red@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_red@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_shadow.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_shadow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pin_shadow@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup_custom.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup_custom@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_pinup_custom@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_present.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_present.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_present_background_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_present_background_update.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_present_direction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_present_direction.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/map_present_tracking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/map_present_tracking.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/noimage.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/noimage256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/noimage256.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/point_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/point_sprite.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/shadow_balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/shadow_balloon.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/DaumMap.framework/th_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jiggag/react-native-kakao-maps/bdd5782775c7cd229c2f824073ef6d7a90f23da8/ios/DaumMap.embeddedframework/DaumMap.framework/th_line.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/Headers: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/Headers -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/copyright.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/copyright.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/daum_copyright.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/daum_copyright.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/daum_th_line.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/daum_th_line.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/detail_button.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/detail_button.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/info_box.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/info_box.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/info_box_tail.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/info_box_tail.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin@3x.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin_custom.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin_custom.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin_custom@3x.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin_custom@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin_red.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin_red.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin_red@3x.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin_red@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin_shadow.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin_shadow.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pin_shadow@3x.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pin_shadow@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pinup.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pinup.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pinup@3x.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pinup@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pinup_custom.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pinup_custom.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_pinup_custom@3x.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_pinup_custom@3x.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_present.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_present.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_present_background_update.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_present_background_update.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_present_direction.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_present_direction.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/map_present_tracking.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/map_present_tracking.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/noimage.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/noimage.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/noimage256.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/noimage256.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/point_sprite.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/point_sprite.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/shadow_balloon.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/shadow_balloon.png -------------------------------------------------------------------------------- /ios/DaumMap.embeddedframework/Resources/th_line.png: -------------------------------------------------------------------------------- 1 | ../DaumMap.framework/th_line.png -------------------------------------------------------------------------------- /ios/KakaoMapManager.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface KakaoMapManager : RCTViewManager 5 | @end 6 | 7 | @implementation KakaoMapManager 8 | 9 | RCT_EXPORT_MODULE(KakaoMapView) 10 | 11 | RCT_EXPORT_VIEW_PROPERTY(markerList, NSArray) 12 | RCT_EXPORT_VIEW_PROPERTY(centerPoint, NSDictionary) 13 | RCT_EXPORT_VIEW_PROPERTY(markerImageUrl, NSString) 14 | RCT_EXPORT_VIEW_PROPERTY(markerImageName, NSString) 15 | RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock) 16 | 17 | - (UIView *)view 18 | { 19 | return [[MapViewController alloc] init]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ios/MapViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | @interface MapViewController : UIView 6 | 7 | @property(nonatomic, assign, nonnull) NSArray *markerList; 8 | @property(nonatomic, assign) double lat; 9 | @property(nonatomic, assign) double lng; 10 | @property(nonatomic, assign, nonnull) NSString *markerImageUrl; 11 | @property(nonatomic, assign, nonnull) NSString *markerImageName; 12 | @property (nonatomic, copy, nonnull) RCTBubblingEventBlock onChange; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ios/MapViewController.m: -------------------------------------------------------------------------------- 1 | #import "MapViewController.h" 2 | 3 | @interface MapViewController () { 4 | MTMapView *_mapView; 5 | NSArray *__markerList; 6 | NSString *__markerImageUrl; 7 | NSString *__markerImageName; 8 | } 9 | 10 | @end 11 | 12 | @implementation MapViewController 13 | 14 | NSArray *createMarker(NSArray *markerList, NSString *markerImageUrl, NSString *markerImageName) { 15 | NSMutableArray *pointList = [[NSMutableArray alloc] init]; 16 | 17 | for (NSDictionary *point in markerList) { 18 | MTMapPOIItem* item = [MTMapPOIItem poiItem]; 19 | item.itemName = point[@"markerName"]; 20 | item.mapPoint = [MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake([point[@"lat"] doubleValue], [point[@"lng"] doubleValue])]; 21 | item.showAnimationType = MTMapPOIItemShowAnimationTypeSpringFromGround; 22 | 23 | item.markerType = markerImageUrl != nil || markerImageName != nil ? MTMapPOIItemMarkerTypeCustomImage : MTMapPOIItemMarkerTypeBluePin; 24 | 25 | if (markerImageUrl != nil) { 26 | item.customImage = [[[UIImage alloc] init] initWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: markerImageUrl]]]; 27 | } 28 | if (markerImageName != nil) { 29 | item.customImageName = markerImageName; 30 | } 31 | 32 | [pointList addObject:item]; 33 | } 34 | 35 | return pointList; 36 | } 37 | 38 | - (void)setMarkerImageName:(NSString *)markerImageName { 39 | __markerImageName = markerImageName; 40 | [self load]; 41 | } 42 | 43 | - (void)setMarkerImageUrl:(NSString *)markerImageUrl { 44 | __markerImageUrl = markerImageUrl; 45 | [self load]; 46 | } 47 | 48 | - (void)setMarkerList:(NSArray *)markerList { 49 | __markerList = markerList; 50 | [self load]; 51 | } 52 | 53 | - (void)setCenterPoint:(NSDictionary *)centerPoint { 54 | if (centerPoint == nil) { 55 | _lat = 37.59523; 56 | _lng = 127.08600; 57 | } else { 58 | _lat = [centerPoint[@"lat"] doubleValue]; 59 | _lng = [centerPoint[@"lng"] doubleValue]; 60 | } 61 | [self load]; 62 | } 63 | 64 | - (void)load { 65 | if (_mapView == nil) { 66 | return; 67 | } 68 | 69 | [_mapView removeAllPOIItems]; 70 | [_mapView addPOIItems: createMarker(__markerList, __markerImageUrl, __markerImageName)]; 71 | [_mapView setMapCenterPoint: [MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake(_lat, _lng)] animated:YES]; 72 | 73 | [self addSubview: _mapView]; 74 | } 75 | 76 | - (instancetype)init 77 | { 78 | self = [super init]; 79 | if (self && _mapView == nil) { 80 | _mapView = [[MTMapView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame))]; 81 | _mapView.delegate = self; 82 | _mapView.baseMapType = MTMapTypeStandard; 83 | [_mapView fitMapViewAreaToShowAllPOIItems]; 84 | 85 | [self load]; 86 | } 87 | return self; 88 | } 89 | 90 | - (void)mapView:(MTMapView*)mapView finishedMapMoveAnimation:(MTMapPoint*)mapCenterPoint 91 | { 92 | _onChange(@{ 93 | @"zoomLevel": @(mapView.zoomLevel), 94 | @"lat": @(mapCenterPoint.mapPointGeo.latitude), 95 | @"lng": @(mapCenterPoint.mapPointGeo.longitude) 96 | }); 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@jiggag/react-native-kakao-maps", 3 | "version": "0.0.12", 4 | "description": "react native kakao map", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "react-native", 11 | "kakao", 12 | "map" 13 | ], 14 | "author": "jiggag", 15 | "license": "MIT", 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/jiggag/react-native-kakao-maps.git" 19 | }, 20 | "bugs": { 21 | "url": "https://github.com/jiggag/react-native-kakao-maps/issues" 22 | }, 23 | "homepage": "https://github.com/jiggag/react-native-kakao-maps#readme" 24 | } 25 | --------------------------------------------------------------------------------