├── .gitignore
├── DaumMap.podspec
├── LICENSE
├── README.md
├── android
├── app
│ ├── build.gradle
│ ├── libs
│ │ ├── arm64-v8a
│ │ │ └── libDaumMapEngineApi.so
│ │ ├── armeabi-v7a
│ │ │ └── libDaumMapEngineApi.so
│ │ ├── armeabi
│ │ │ └── libDaumMapEngineApi.so
│ │ └── libDaumMapAndroid.jar
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── teamsf
│ │ │ └── daummap
│ │ │ ├── DaumMapManager.java
│ │ │ ├── DaumMapModule.java
│ │ │ ├── DaumMapPackage.java
│ │ │ └── RNMapView.java
│ │ └── jniLibs
│ │ ├── arm64-v8a
│ │ └── libDaumMapEngineApi.so
│ │ ├── armeabi-v7a
│ │ └── libDaumMapEngineApi.so
│ │ └── armeabi
│ │ └── libDaumMapEngineApi.so
├── arm64-v8a
│ └── libDaumMapEngineApi.so
├── armeabi-v7a
│ └── libDaumMapEngineApi.so
├── armeabi
│ └── libDaumMapEngineApi.so
└── libDaumMapAndroid.jar
├── index.d.ts
├── index.js
├── ios
├── 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
├── DaumMap.xcodeproj
│ └── project.pbxproj
└── DaumMap
│ ├── DaumMap.h
│ ├── DaumMap.m
│ ├── DaumMapManager.h
│ └── DaumMapManager.m
├── package.json
└── react-native.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # node.js
6 | #
7 | node_modules/
8 | npm-debug.log
9 | yarn-error.log
10 |
11 |
12 | # Xcode
13 | #
14 | build/
15 | *.pbxuser
16 | !default.pbxuser
17 | *.mode1v3
18 | !default.mode1v3
19 | *.mode2v3
20 | !default.mode2v3
21 | *.perspectivev3
22 | !default.perspectivev3
23 | xcuserdata
24 | xcshareddata
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 | .project
42 | .settings/
43 | gradlew*
44 | gradle/
45 |
46 |
47 | # BUCK
48 | buck-out/
49 | \.buckd/
50 | *.keystore
51 |
--------------------------------------------------------------------------------
/DaumMap.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 | pjson = JSON.parse(File.read('package.json'))
3 |
4 | Pod::Spec.new do |s|
5 |
6 | s.name = "DaumMap"
7 | s.version = pjson["version"]
8 | s.homepage = "https://github.com/pksung1/react-native-daummap"
9 | s.summary = pjson["description"]
10 | s.license = pjson["license"]
11 | s.author = { "JeongHun Kang" => "asata@teamsf.co.kr" }
12 |
13 | s.ios.deployment_target = '9.0'
14 |
15 | s.source = { :git => "https://github.com/pksung1/react-native-daummap", :tag => "v#{s.version}" }
16 | s.ios.source_files = "ios/**/*.{h,m}"
17 |
18 | s.ios.framework = "SystemConfiguration", "CoreLocation", "QuartzCore", "OpenGLES"
19 | s.ios.library = 'xml2', 'c++', 'sqlite3'
20 | s.dependency 'React'
21 | end
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 JeongHun Kang
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.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-daummap
2 |
3 | [](https://nodei.co/npm/react-native-daummap/)
4 |
5 | # Content
6 | - [Installation](#installation)
7 | - [Usage](#usage)
8 | - [Daum Map](#daum-map)
9 | - [Local Map API](#local-restapi)
10 |
11 | ***
12 |
13 | | iOS | Android |
14 | |-----|---------|
15 | |
|
|
16 |
17 | ***
18 |
19 | # Installation
20 | ## 1. Download
21 | `npm i -S react-native-daummap`
22 |
23 | ## 2. Plugin Installation
24 | ### RN >= 6.0
25 | #### iOS
26 |
27 | ```
28 | cd pod
29 | pod install
30 | ```
31 |
32 | #### Android
33 |
34 | Mostly automatic installation
35 |
36 | ### RN < 6.0
37 |
38 | `react-native link react-native-daummap`
39 |
40 | ### Manual installation
41 | #### iOS
42 | 1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
43 | 2. Go to node_modules ➜ react-native-daummap and add DaumMap.xcodeproj
44 | 3. In XCode, in the project navigator, select your project. Add libDaumMap.a to your project's Build Phases ➜ Link Binary With Libraries
45 | 4. Select your project → Build Settings → Search Paths → Header Search Paths to add:
46 | `$(SRCROOT)/../node_modules/react-native-daummap/ios/DaumMap`
47 | 5. Select your project → "General" or "Build Phases" → Link Binary With Libraries에 아래 항목 추가
48 | - OpenGLES.framework
49 | - SystemConfigure.framework
50 | - CoreLocation.framework
51 | - QuartzCore.framework
52 | - libstdc++.6.dylib (libc++.tbd in XCode 10)
53 | - libxml2.dylib (libxml2.tbd in Xcode 10)
54 | - libsqlite3.dylib (libsqlite3.tbd in Xcode 10)
55 |
56 | #### Android
57 | 1. In your android/settings.gradle file, make the following additions:
58 | ```
59 | include ':react-native-daummap'
60 | project(':react-native-daummap').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-daummap/android/app')
61 | ```
62 | 2. In your android/app/build.gradle file, add the :react-native-splash-screen project as a compile-time dependency:
63 | ```
64 | ...
65 | dependencies {
66 | ...
67 | compile project(':react-native-daummap')
68 | }
69 | ```
70 |
71 | 3. Update the MainApplication.java file to use react-native-splash-screen via the following changes:
72 | ```
73 | ...
74 | import com.teamsf.daummap.DaumMapPackage;
75 | ...
76 |
77 | public class MainApplication extends Application implements ReactApplication {
78 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
79 |
80 | ...
81 |
82 | @Override
83 | protected List getPackages() {
84 | return Arrays.asList(
85 | new MainReactPackage(),
86 | new DaumMapPackage()
87 | );
88 | }
89 |
90 | ...
91 | }
92 | }
93 | ```
94 |
95 | ## 3. 다음 지도 SDK 추가
96 | ##### iOS
97 | 1. [다음 지도 SDK 다운로드](http://apis.map.daum.net/ios/guide/)
98 | 2. XCode Project navigator에서 Frameworks 폴더를 마우스 오른쪽 버튼으로 클릭 후 "Add Files to [your project's name]" 선택
99 | 3. 다운로드 받은 SDK 폴더로 이동해 libs폴더 안에 있는 DaumMap.embeddedframework 폴더에서 DaumMap.framework 파일 선택, 아래 "Copy items if needed"와 "Add to targets"를 선택 후 Add
100 |
101 | 
102 |
103 | 4. XCode에서 프로젝트 이름을 선택 후 General - Linked Frameworks and Libraries에 3번에서 추가한 DaumMap.framework를 추가
104 |
105 |
106 |
107 | #### Android
108 | - 별도 작업 없음
109 |
110 | ## 4. 네이티브 앱 키 발급 및 Bundle ID, 키 해시 등록
111 | 1. [Kakao Developer](https://developers.kakao.com/apps)에서 애플리케이션을 등록
112 | 2. 등록한 애플리케이션을 선택 후 설정 - 일반으로 이동
113 | 3. 플랫폼(iOS, Android) 추가
114 |
115 | #### iOS
116 | 4. 번들 ID에 개발 앱 번들 ID 등록 후 저장
117 | 5. 상단에 있는 "네이티브 앱 키"를 복사
118 | 6. Info.plist에 KAKAO_APP_KEY 추가
119 | ```
120 |
121 | ...
122 | KAKAO_APP_KEY
123 | 발급 받은 APP KEY
124 | ...
125 |
126 | ```
127 |
128 | 7. 트래킹 모드, 나침반 모드 기능 사용시 Info.plist에 아래 내용 추가
129 | ```
130 |
131 | ...
132 | NSLocationWhenInUseUsageDescription
133 | 권한 이용 설명 기재
134 | ...
135 |
136 | ```
137 | 8. 프로젝트 선택 → Build Settings에서 아래 항목 수정
138 | - Objective-C Automatic Reference Counting : No 선택
139 |
140 | #### Android
141 | 4. 패키지명에 개발 앱 패키지명 추가
142 | 5. 키 해시는 터미널에서 아래 명령 수행한 결과 값 입력
143 | ```
144 | keytool -exportcert -alias androiddebugkey -keystore [keystore_path] -storepass android -keypass android | openssl sha1 -binary | openssl base64
145 | ```
146 | - Debug일 경우 Keystore 경로는 ~/.android/debug.keystore에 저장되며 비밀번호는 android
147 | 6. 상단에 있는 "네이티브 앱 키"를 복사
148 | 7. AndroidManifest.xml에 Permission 과 APP KEY 추가
149 | ```
150 |
151 |
152 |
153 | ...
154 |
155 | ...
156 |
157 | ```
158 |
159 | ***
160 |
161 | # Usage
162 | # Daum Map
163 | ```
164 | import MapView from 'react-native-daummap';
165 |
166 |
175 | ```
176 |
177 | ## Properties
178 | | Property | Type | Default | Description |
179 | |---------------------------|-----------|-----------|-------------|
180 | | initialRegion | Object | {} | 지도 초기 화면 좌표 및 확대/축소 레벨 |
181 | | style | | {} | 지도 View Style |
182 | | mapType | String | Standard | 지도 종류 (기본 지도 - Standard, 위성 지도 - Satellite, 하이브리드 지도 - Hybrid)
183 | | markers | Array | [] | 지도 위에 추가되는 마커 정보 |
184 | | region | Object | {} | 지도 중심점 좌표, 지도 이동시 사용 |
185 | | polyLines | Object | {} | 정해진 좌표로 선을 그림 |
186 | | circles | Array | [] | 지정한 좌표에 원을 그림 |
187 | | isTracking | Bool | false | 현위치 트래킹 모드 (지도화면 중심을 단말의 현재 위치로 이동) |
188 | | isCompass | Bool | false | 나침반 모드 (단말의 방향에 따라 지도화면이 회전), 트래킹 모드를 활성화 시켜야 사용 가능 |
189 | | isCurrentMarker | Bool | false | 현 위치를 표시하는 마커 표시 여부, 트래킹 모드 활성화시 true |
190 | | permissionDeniedView | Component | null | (Android) 위치 권한이 없을 경우 표시될 View |
191 | | permissionsAndroidTitle | String | | (Android) 위치 권한 요청시 Alert창 제목 |
192 | | permissionsAndroidMessage | String | | (Android) 위치 권한 요청시 Alert창 본문 |
193 | | onRegionChange | Function | | 지도 이동시 변경되는 좌표값 반환 |
194 | | onMarkerSelect | Function | | 마커 핀을 선택한 경우 |
195 | | onMarkerPress | Function | | 마커 위 말풍선을 선택한 경우 |
196 | | onMarkerMoved | Function | | 마커를 이동시킨 경우 |
197 | | onUpdateCurrentLocation | Function | | 트래킹 모드 사용중 좌표가 변경된 경우 |
198 | | onUpdateCurrentHeading | Function | | 나침반 모드 사용시 방향 각도 값이 변경된 경우 |
199 |
200 | ### initialRegion
201 | | Property | Type | Default | Description |
202 | |-------------------|--------|--------------|---------------|
203 | | latitude | Number | 36.143099 | 위도 좌표값 |
204 | | longitude | Number | 128.392905 | 경도 좌표값 |
205 | | zoomLevel | Number | 2 | 확대/축소 레벨 (-2~12, 값이 클수록 더 넓은 영역이 보임) |
206 |
207 | ### markers
208 | | Property | Type | Default | Description |
209 | |-------------------|--------|--------------|---------------|
210 | | latitude | Number | 36.143099 | 위도 좌표값 |
211 | | longitude | Number | 128.392905 | 경도 좌표값 |
212 | | title | String | | 마커 이름, 마커 선택시 표시 |
213 | | pinColor | String | blue | 마커 핀 색상 (blue, yellow, red, image) |
214 | | markerImage | String | | 마커 사용자 이미지 |
215 | | pinColorSelect | String | red | 선택된 마커 핀 색상 (blue, yellow, red, image) |
216 | | markerImageSelect | String | | 선택된 마커 사용자 이미지 |
217 | | draggable | Bool | false | 마커 이동 여부 |
218 | * 사용자 이미지는 추가 위치
219 | - Android : android/app/src/main/res/drawable
220 | - iOS : Xcode Project에 추가
221 |
222 | ### region
223 | | Property | Type | Default | Description |
224 | |-------------------|--------|--------------|---------------|
225 | | latitude | Number | | 위도 좌표값 |
226 | | longitude | Number | | 경도 좌표값 |
227 |
228 | ### polyLines
229 | | Property | Type | Default | Description |
230 | |-------------------|--------|--------------|---------------|
231 | | tag | Number | | 고유 IDX 값 |
232 | | color | String | | 선 색상 (blue, yellow, red, white, black, green) |
233 | | points | Array | | 위경도 좌표값 배열 {latitude: ??, longitude: ??} |
234 |
235 | ### circles
236 | | Property | Type | Default | Description |
237 | |-------------------|--------|--------------|---------------|
238 | | latitude | Number | 36.143099 | 위도 좌표값 |
239 | | longitude | Number | 128.392905 | 경도 좌표값 |
240 | | lineColor | String | | 원 테두리 색상 (blue, yellow, red, white, black, green) |
241 | | fillColor | String | | 원 내부 색상 (blue, yellow, red, white, black, green) |
242 | | lineWidth | Number | 10 | 원 테두리 굵기 |
243 | | radius | Number | 50 | 원 반지름 (단위 : m) |
244 |
245 | ***
246 |
247 | # Local RestAPI
248 | ```
249 | import DaumMap from 'react-native-daummap';
250 |
251 | componentDidMount () {
252 | DaumMap.setRestApiKey("********************************");
253 | }
254 |
255 |
256 | functionName () {
257 | DaumMap.serachAddress("양호동")
258 | .then((responseJson) => {
259 | // API 결과값 반환
260 | console.log(responseJson);
261 | }).catch((error) => {
262 | // API 호출 중 오류 발생시
263 | console.log(error);
264 | });
265 | }
266 | ```
267 |
268 | ## 기능
269 | | 기능명 | Function Name | URL |
270 | |------|---------------|-----|
271 | | Rest API Key 설정 | setRestApiKey | |
272 | | 주소 검색 | serachAddress | https://developers.kakao.com/docs/restapi/local#주소-검색 |
273 | | 좌표 → 행정구역정보 변환 | getCoordToRegionArea | https://developers.kakao.com/docs/restapi/local#좌표-행정구역정보-변환 |
274 | | 좌표 → 주소 변환 | getCoordToAddress | https://developers.kakao.com/docs/restapi/local#좌표-주소-변환 |
275 | | 좌표계 변환 | transCoord | https://developers.kakao.com/docs/restapi/local#좌표계-변환 |
276 | | 키워드로 장소 검색 | searchKeyword | https://developers.kakao.com/docs/restapi/local#키워드로-장소-검색 |
277 | | 카테고리로 장소 검색 | searchCategory | https://developers.kakao.com/docs/restapi/local#카테고리로-장소-검색 |
278 | * API Key는 "네이티브 앱 키"가 아닌 "REST API 키"입니다.
279 | - 네이티브 앱 키 사용시 에러가 발생합니다.
280 | * 각 API 호출 반환값은 Daum API 문서를 참고 해 주세요.
281 |
282 | ## 각 함수 설명
283 | * Rest API Key 설정 (setRestApiKey)
284 | - RestAPI Key 설정
285 | - Parameter : API Key(필수)
286 | - Example : setRestApiKey(API_Key)
287 |
288 |
289 | * 주소 검색 (serachAddress)
290 | - 주소를 지도 위에 정확하게 표시하기 위해 해당 주소의 좌표 정보를 제공
291 | - Parameter : 검색어(필수), 결과 페이지 번호(선택, 기본값 : 1), 한 페이지에 보여질 문서의 개수(선택, 기본값 : 10)
292 | - Example : serachAddress("양호동", 1, 10) or serachAddress("양호동")
293 |
294 |
295 | * 좌표 → 행정구역정보 변환 (getCoordToRegionArea)
296 | - 해당 좌표에 부합되는 행정동, 법정동을 얻는 API
297 | - Parameter : 위도(필수), 경도(필수), 입력되는 값에 대한 좌표 체계(선택, 기본값 : WGS84), 결과에 출력될 좌표 체계(선택, 기본값 : WGS84), 결과 언어(선택, 기본값 : ko)
298 | - Example : getCoordToRegionArea(36.143099, 128.392905, "WGS84", "WGS84", "ko") or getCoordToRegionArea(36.143099, 128.392905)
299 |
300 |
301 | * 좌표 → 주소 변환 (getCoordToRegionArea)
302 | - 해당 좌표의 구주소와 도로명 주소 정보를 표출하는 API
303 | - Parameter : 위도(필수), 경도(필수), 입력되는 값에 대한 좌표 체계(선택, 기본값 : WGS84)
304 | - Example : getCoordToAddress(36.143099, 128.392905, "WGS84") or getCoordToAddress(36.143099, 128.392905)
305 |
306 |
307 | * 좌표계 변환 (transCoord)
308 | - x, y 값과 입력/출력 좌표계를 지정하여 변환된 좌표값
309 | - Parameter : 위도(필수), 경도(필수), 입력되는 값에 대한 좌표 체계(선택, 기본값 : WGS84), 결과에 출력될 좌표 체계(선택, 기본값 : WGS84)
310 | - Example : transCoord(36.143099, 128.392905, "WGS84", "WGS84") or transCoord(36.143099, 128.392905)
311 |
312 |
313 | * 키워드로 장소 검색 (searchKeyword)
314 | - 질의어에 매칭된 장소 검색 결과를 지정된 정렬 기준에 따라 제공
315 | - Parameter : 검색어(필수), 카테고리 그룹 코드(선택, 기본값 : ""), 위도(선택), 경도(선택), 중심 좌표부터의 반경거리(선택, 기본값 : 500, 단위 : m, 0~20000), 결과 페이지 번호(선택, 기본값 : 1, 1~45), 한 페이지에 보여질 문서의 개수(선택, 기본값 : 15, 1~15), 결과 정렬 순서(선택, 기본값 : accuracy)
316 | - 카테고리 그룹 코드는 Daum API 문서 참고
317 | - Example : searchKeyword("편의점", "CS2", 36.143099, 128.392905, 100, 1, 10, "accuracy") or searchKeyword("편의점")
318 |
319 |
320 | * 카테고리로 장소 검색 (searchCategory)
321 | - 미리 정의된 그룹코드에 해당하는 장소 검색 결과를 지정된 정렬 기준에 따라 제공
322 | - Parameter : 카테고리 그룹 코드(필수), 위도(필수), 경도(필수), 중심 좌표부터의 반경거리(필수, 기본값 : 500, 단위 : m, 0~20000), 결과 페이지 번호(선택, 기본값 : 1, 1~45), 한 페이지에 보여질 문서의 개수(선택, 기본값 : 15, 1~15), 결과 정렬 순서(선택, 기본값 : accuracy)
323 | - 카테고리 그룹 코드는 Daum API 문서 참고
324 | - Example : searchCategory("CS2", 36.143099, 128.392905, 100, 1, 10, "accuracy") or searchCategory("CS2", 36.143099, 128.392905, 100)
325 |
326 | ***
327 |
328 | ## License
329 | MIT © Cory Asata 2018
330 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | def DEFAULT_COMPILE_SDK_VERSION = 23
4 | def DEFAULT_BUILD_TOOLS_VERSION = "23.0.1"
5 | def DEFAULT_TARGET_SDK_VERSION = 2
6 |
7 | android {
8 | compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
9 | buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
10 |
11 | defaultConfig {
12 | minSdkVersion 16
13 | }
14 | }
15 |
16 | dependencies {
17 | compile fileTree(dir: 'libs', include: ['*.jar'])
18 | compile "com.facebook.react:react-native:+"
19 | compile files('libs/libDaumMapAndroid.jar')
20 | }
21 |
--------------------------------------------------------------------------------
/android/app/libs/arm64-v8a/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/libs/arm64-v8a/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/app/libs/armeabi-v7a/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/libs/armeabi-v7a/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/app/libs/armeabi/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/libs/armeabi/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/app/libs/libDaumMapAndroid.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/libs/libDaumMapAndroid.jar
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/teamsf/daummap/DaumMapManager.java:
--------------------------------------------------------------------------------
1 | package com.teamsf.daummap;
2 |
3 | import android.view.View;
4 | import android.util.Log;
5 | import android.graphics.Color;
6 |
7 | import com.facebook.react.common.MapBuilder;
8 | import com.facebook.react.bridge.WritableMap;
9 | import com.facebook.react.bridge.ReactContext;
10 | import com.facebook.react.bridge.WritableNativeMap;
11 | import com.facebook.react.bridge.ReadableMap;
12 | import com.facebook.react.bridge.ReadableArray;
13 | import com.facebook.react.bridge.ReactApplicationContext;
14 | import com.facebook.react.uimanager.UIManagerModule;
15 | import com.facebook.react.uimanager.events.RCTEventEmitter;
16 | import com.facebook.react.uimanager.SimpleViewManager;
17 | import com.facebook.react.uimanager.ThemedReactContext;
18 | import com.facebook.react.uimanager.annotations.ReactProp;
19 |
20 | import net.daum.mf.map.api.MapLayout;
21 | import net.daum.mf.map.api.MapPoint;
22 | import net.daum.mf.map.api.MapView;
23 | import net.daum.mf.map.api.MapPOIItem;
24 | import net.daum.mf.map.api.MapPolyline;
25 | import net.daum.mf.map.api.MapCircle;
26 |
27 | import javax.annotation.Nullable;
28 | import java.util.Map;
29 |
30 | public class DaumMapManager extends SimpleViewManager implements MapView.MapViewEventListener, MapView.CurrentLocationEventListener, MapView.POIItemEventListener {
31 | public static final String REACT_CLASS = "DaumMap";
32 | public static final String TAG = "DaumMap";
33 | private final ReactApplicationContext appContext;
34 | private RNMapView rnMapView;
35 | private boolean initialRegionSet = false;
36 | private boolean isTracking = false;
37 | private boolean isCompass = false;
38 | private int tagIDX = 0;
39 |
40 | public DaumMapManager (ReactApplicationContext context) {
41 | super();
42 | this.appContext = context;
43 | }
44 |
45 | @Override
46 | public String getName() {
47 | return REACT_CLASS;
48 | }
49 |
50 | @Override
51 | public RNMapView createViewInstance(ThemedReactContext context) {
52 | RNMapView rMapView = new RNMapView(context, this.appContext);
53 | rnMapView = rMapView;
54 |
55 | rMapView.setOpenAPIKeyAuthenticationResultListener(new MapView.OpenAPIKeyAuthenticationResultListener() {
56 | public void onDaumMapOpenAPIKeyAuthenticationResult(MapView mapView, int resultCode, String resultMessage) {
57 | Log.i(TAG, String.format("Open API Key Authentication Result : code=%d, message=%s", resultCode, resultMessage));
58 | }
59 | });
60 |
61 | rMapView.setMapViewEventListener(this);
62 | rMapView.setPOIItemEventListener(this);
63 | rMapView.setCurrentLocationEventListener(this);
64 |
65 | return rMapView;
66 | }
67 |
68 | @ReactProp(name = "initialRegion")
69 | public void setInitialRegion(MapView mMapView, ReadableMap initialRegion) {
70 | double latitude = initialRegion.hasKey("latitude") ? initialRegion.getDouble("latitude") : 36.143099;
71 | double longitude = initialRegion.hasKey("longitude") ? initialRegion.getDouble("longitude") : 128.392905;
72 | int zoomLevel = initialRegion.hasKey("zoomLevel") ? initialRegion.getInt("zoomLevel") : 2;
73 |
74 | if (!initialRegionSet) {
75 | mMapView.setMapCenterPointAndZoomLevel(MapPoint.mapPointWithGeoCoord(latitude, longitude), zoomLevel, true);
76 | initialRegionSet = true;
77 | }
78 | }
79 |
80 | @ReactProp(name = "mapType")
81 | public void setMapType(MapView mMapView, String mapType) {
82 | mapType = mapType.toLowerCase();
83 | if (mapType.equals("standard")) {
84 | mMapView.setMapType(MapView.MapType.Standard);
85 | } else if (mapType.equals("satellite")) {
86 | mMapView.setMapType(MapView.MapType.Satellite);
87 | } else if (mapType.equals("hybrid")) {
88 | mMapView.setMapType(MapView.MapType.Hybrid);
89 | } else {
90 | mMapView.setMapType(MapView.MapType.Standard);
91 | }
92 | }
93 |
94 | @ReactProp(name = "markers")
95 | public void setMarkers(MapView mMapView, ReadableArray markers) {
96 | for (int i = 0; i < markers.size(); i++) {
97 | ReadableMap markerInfo = markers.getMap(i);
98 | double latitude = markerInfo.hasKey("latitude") ? markerInfo.getDouble("latitude") : 36.143099;
99 | double longitude = markerInfo.hasKey("longitude") ? markerInfo.getDouble("longitude") : 128.392905;
100 |
101 | MapPOIItem.MarkerType markerType = MapPOIItem.MarkerType.BluePin;
102 |
103 | if (markerInfo.hasKey("pinColor")) {
104 | String pinColor = markerInfo.getString("pinColor").toLowerCase();
105 | if (pinColor.equals("red")) {
106 | markerType = MapPOIItem.MarkerType.RedPin;
107 | } else if (pinColor.equals("yellow")) {
108 | markerType = MapPOIItem.MarkerType.YellowPin;
109 | } else if (pinColor.equals("blue")) {
110 | markerType = MapPOIItem.MarkerType.BluePin;
111 | } else if (pinColor.equals("image") || pinColor.equals("custom")) {
112 | markerType = MapPOIItem.MarkerType.CustomImage;
113 | }
114 | }
115 |
116 | MapPOIItem.MarkerType sMarkerType = MapPOIItem.MarkerType.RedPin;
117 | if (markerInfo.hasKey("pinColorSelect")) {
118 | String pinColor = markerInfo.getString("pinColorSelect").toLowerCase();
119 | if (pinColor.equals("red")) {
120 | sMarkerType = MapPOIItem.MarkerType.RedPin;
121 | } else if (pinColor.equals("yellow")) {
122 | sMarkerType = MapPOIItem.MarkerType.YellowPin;
123 | } else if (pinColor.equals("blue")) {
124 | sMarkerType = MapPOIItem.MarkerType.BluePin;
125 | } else if (pinColor.equals("image") || pinColor.equals("custom")) {
126 | sMarkerType = MapPOIItem.MarkerType.CustomImage;
127 | } else if (pinColor.equals("none")) {
128 | sMarkerType = null;
129 | }
130 | }
131 |
132 | MapPOIItem marker = new MapPOIItem();
133 | if (markerInfo.hasKey("title")) {
134 | marker.setItemName(markerInfo.getString("title"));
135 | }
136 |
137 | marker.setTag(i);
138 |
139 | // 마커 좌표
140 | marker.setMapPoint(MapPoint.mapPointWithGeoCoord(latitude, longitude));
141 |
142 | // 기본 마커 모양
143 | marker.setMarkerType(markerType);
144 | if (markerType == MapPOIItem.MarkerType.CustomImage) {
145 | if (markerInfo.hasKey("markerImage")) {
146 | String markerImage = markerInfo.getString("markerImage");
147 | int resID = appContext.getResources().getIdentifier(markerImage, "drawable", appContext.getApplicationContext().getPackageName());
148 | marker.setCustomImageResourceId(resID);
149 | }
150 | }
151 |
152 | // 마커를 선택한 경우
153 | marker.setSelectedMarkerType(sMarkerType);
154 | if (sMarkerType == MapPOIItem.MarkerType.CustomImage) {
155 | if (markerInfo.hasKey("markerImageSelect")) {
156 | String markerImage = markerInfo.getString("markerImageSelect");
157 | int resID = appContext.getResources().getIdentifier(markerImage, "drawable", appContext.getApplicationContext().getPackageName());
158 | marker.setCustomImageResourceId(resID);
159 | }
160 | }
161 | marker.setShowAnimationType(MapPOIItem.ShowAnimationType.SpringFromGround); // 마커 추가시 효과
162 | marker.setShowDisclosureButtonOnCalloutBalloon(false); // 마커 클릭시, 말풍선 오른쪽에 나타나는 > 표시 여부
163 |
164 | // 마커 드래그 가능 여부
165 | boolean draggable = false;
166 | if (markerInfo.hasKey("draggable")) {
167 | draggable = markerInfo.getBoolean("draggable");
168 | }
169 | marker.setDraggable(draggable);
170 |
171 | mMapView.addPOIItem(marker);
172 | }
173 | }
174 |
175 | @ReactProp(name = "isCurrentMarker")
176 | public void setIsCurrentMarker(MapView mMapView, boolean tCurrentMarker) {
177 | mMapView.setShowCurrentLocationMarker(tCurrentMarker);
178 | }
179 |
180 | @ReactProp(name = "isTracking")
181 | public void setIsTracking(MapView mMapView, boolean tTracking) {
182 | isTracking = tTracking;
183 | setMapTrackingMode(mMapView);
184 | }
185 | @ReactProp(name = "isCompass")
186 | public void setIsCompass(MapView mMapView, boolean tCompass) {
187 | isCompass = tCompass;
188 | setMapTrackingMode(mMapView);
189 | }
190 |
191 | private void setMapTrackingMode (MapView mMapView) {
192 | MapView.CurrentLocationTrackingMode trackingModeValue = MapView.CurrentLocationTrackingMode.TrackingModeOff;
193 | if (isTracking && isCompass) {
194 | trackingModeValue = MapView.CurrentLocationTrackingMode.TrackingModeOnWithHeading;
195 | } else if (isTracking && !isCompass) {
196 | trackingModeValue = MapView.CurrentLocationTrackingMode.TrackingModeOnWithoutHeading;
197 | } else {
198 | trackingModeValue = MapView.CurrentLocationTrackingMode.TrackingModeOff;
199 | }
200 |
201 | if (mMapView != null) {
202 | mMapView.setCurrentLocationTrackingMode(trackingModeValue);
203 | }
204 | }
205 |
206 | @ReactProp(name = "polyLines")
207 | public void setPolyLines(MapView mMapView, ReadableMap polyLines) {
208 | mMapView.removeAllPolylines();
209 |
210 | if (polyLines.hasKey("points")) {
211 | MapPolyline polyline1 = new MapPolyline();
212 | String lineColorStr = polyLines.hasKey("color") ? polyLines.getString("color").toLowerCase() : "white";
213 | ReadableArray polyLineList = polyLines.getArray("points");
214 |
215 | polyline1.setLineColor(getColor(lineColorStr));
216 |
217 | for (int i = 0; i < polyLineList.size(); i++) {
218 | ReadableMap polyLineInfo= polyLineList.getMap(i);
219 | double latitude = polyLineInfo.hasKey("latitude") ? polyLineInfo.getDouble("latitude") : 36.143099;
220 | double longitude = polyLineInfo.hasKey("longitude") ? polyLineInfo.getDouble("longitude") : 128.392905;
221 | int tagIdx = polyLineInfo.hasKey("tag") ? polyLineInfo.getInt("tag") : tagIDX++;
222 |
223 | polyline1.addPoint(MapPoint.mapPointWithGeoCoord(latitude, longitude));
224 | }
225 |
226 | mMapView.addPolyline(polyline1);
227 | }
228 | }
229 |
230 | @ReactProp(name = "circles")
231 | public void setCircles(MapView mMapView, ReadableArray circles) {
232 | mMapView.removeAllCircles();
233 |
234 | for (int i = 0; i < circles.size(); i++) {
235 | ReadableMap circleInfo = circles.getMap(i);
236 | double latitude = circleInfo.hasKey("latitude") ? circleInfo.getDouble("latitude") : 36.143099;
237 | double longitude = circleInfo.hasKey("longitude") ? circleInfo.getDouble("longitude") : 128.392905;
238 | String fillColorStr = circleInfo.hasKey("fillColor") ? circleInfo.getString("fillColor").toLowerCase() : "white";
239 | String lineColorStr = circleInfo.hasKey("lineColor") ? circleInfo.getString("lineColor").toLowerCase() : "white";
240 | int tagIdx = circleInfo.hasKey("tag") ? circleInfo.getInt("tag") : tagIDX++;
241 | int lineWidth = circleInfo.hasKey("lineWidth") ? circleInfo.getInt("lineWidth") : 10;
242 | int radius = circleInfo.hasKey("radius") ? circleInfo.getInt("radius") : 50;
243 |
244 | MapCircle circle1 = new MapCircle(
245 | MapPoint.mapPointWithGeoCoord(latitude, longitude), // center
246 | radius, // radius
247 | getColor(lineColorStr), // strokeColor
248 | getColor(fillColorStr) // fillColor
249 | );
250 | circle1.setTag(tagIdx);
251 | mMapView.addCircle(circle1);
252 | }
253 | }
254 |
255 | private int getColor(String colorString) {
256 | if (colorString.equals("red")) {
257 | return Color.RED;
258 | } else if (colorString.equals("blue")) {
259 | return Color.BLUE;
260 | } else if (colorString.equals("yellow")) {
261 | return Color.YELLOW;
262 | } else if (colorString.equals("black")) {
263 | return Color.BLACK;
264 | } else if (colorString.equals("green")) {
265 | return Color.GREEN;
266 | } else if (colorString.equals("white")) {
267 | return Color.WHITE;
268 | } else {
269 | return Color.TRANSPARENT;
270 | }
271 | }
272 |
273 | @Override
274 | @Nullable
275 | public Map getExportedCustomDirectEventTypeConstants() {
276 | Map> map = MapBuilder.of(
277 | "onMarkerSelect", MapBuilder.of("registrationName", "onMarkerSelect"),
278 | "onMarkerPress", MapBuilder.of("registrationName", "onMarkerPress"),
279 | "onMarkerPressEvent", MapBuilder.of("registrationName", "onMarkerPressEvent"),
280 | "onMarkerMoved", MapBuilder.of("registrationName", "onMarkerMoved"),
281 | "onRegionChange", MapBuilder.of("registrationName", "onRegionChange"),
282 | "onUpdateCurrentLocation", MapBuilder.of("registrationName", "onUpdateCurrentLocation"),
283 | "onUpdateCurrentHeading", MapBuilder.of("registrationName", "onUpdateCurrentHeading")
284 | );
285 |
286 | return map;
287 | }
288 |
289 | /************************************************************************/
290 | // MapViewEvent
291 | /************************************************************************/
292 | // MapView가 사용 가능한 상태가 되었을 때 호출
293 | @Override
294 | public void onMapViewInitialized(MapView mapView) {
295 |
296 | }
297 |
298 | // 지도 중심 좌표가 이동했을 때
299 | @Override
300 | public void onMapViewCenterPointMoved(MapView mapView, MapPoint mapCenterPoint) {
301 | WritableMap event = new WritableNativeMap();
302 |
303 | WritableMap coordinate = new WritableNativeMap();
304 | coordinate.putDouble("latitude", mapCenterPoint.getMapPointGeoCoord().latitude);
305 | coordinate.putDouble("longitude", mapCenterPoint.getMapPointGeoCoord().longitude);
306 | event.putMap("coordinate", coordinate);
307 | event.putString("action", "regionChange");
308 |
309 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onRegionChange", event);
310 | }
311 |
312 | // 지도 확대/축소 레벨이 변경된 경우
313 | @Override
314 | public void onMapViewZoomLevelChanged(MapView mapView, int zoomLevel) {
315 |
316 | }
317 |
318 | // 지도 위를 터치한 경우
319 | @Override
320 | public void onMapViewSingleTapped(MapView mapView, MapPoint mapPoint) {
321 |
322 | }
323 |
324 | // 지도 위 한 지점을 더블 터치한 경우
325 | @Override
326 | public void onMapViewDoubleTapped(MapView mapView, MapPoint mapPoint) {
327 |
328 | }
329 |
330 | // 지도 위 한 지점을 길게 누른 경우
331 | @Override
332 | public void onMapViewLongPressed(MapView mapView, MapPoint mapPoint) {
333 |
334 | }
335 |
336 | // 지도 드래그를 시작한 경우
337 | @Override
338 | public void onMapViewDragStarted(MapView mapView, MapPoint mapPoint) {
339 |
340 | }
341 |
342 | // 지도 이동이 완료된 경우
343 | @Override
344 | public void onMapViewDragEnded(MapView mapView, MapPoint mapPoint) {
345 |
346 | }
347 |
348 | @Override
349 | public void onMapViewMoveFinished(MapView mapView, MapPoint mapPoint) {
350 | // Log.d(TAG, "onMapViewMoveFinished");
351 | }
352 |
353 | /************************************************************************/
354 | // Current Location Event
355 | /************************************************************************/
356 | @Override
357 | public void onCurrentLocationUpdate(MapView mapView, MapPoint currentLocation, float accuracyInMeters) {
358 | WritableMap event = new WritableNativeMap();
359 |
360 | WritableMap coordinate = new WritableNativeMap();
361 | coordinate.putDouble("latitude", currentLocation.getMapPointGeoCoord().latitude);
362 | coordinate.putDouble("longitude", currentLocation.getMapPointGeoCoord().longitude);
363 | event.putMap("coordinate", coordinate);
364 | event.putDouble("accuracyInMeters", accuracyInMeters);
365 | event.putString("action", "currentLocation");
366 |
367 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onUpdateCurrentLocation", event);
368 |
369 | }
370 |
371 | @Override
372 | public void onCurrentLocationDeviceHeadingUpdate(MapView mapView, float headingAngle) {
373 | WritableMap event = new WritableNativeMap();
374 |
375 | WritableMap coordinate = new WritableNativeMap();
376 | event.putDouble("headingAngle", headingAngle);
377 | event.putString("action", "currentHeading");
378 |
379 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onUpdateCurrentHeading", event);
380 | }
381 |
382 | @Override
383 | public void onCurrentLocationUpdateFailed(MapView mapView) {
384 |
385 | }
386 |
387 | @Override
388 | public void onCurrentLocationUpdateCancelled(MapView mapView) {
389 |
390 | }
391 |
392 |
393 | /************************************************************************/
394 | // POIItemEvent
395 | /************************************************************************/
396 | // Marker를 선택한 경우
397 | @Override
398 | public void onPOIItemSelected(MapView mapView, MapPOIItem poiItem) {
399 | WritableMap event = new WritableNativeMap();
400 |
401 | WritableMap coordinate = new WritableNativeMap();
402 | coordinate.putDouble("latitude", poiItem.getMapPoint().getMapPointGeoCoord().latitude);
403 | coordinate.putDouble("longitude", poiItem.getMapPoint().getMapPointGeoCoord().longitude);
404 | event.putMap("coordinate", coordinate);
405 | event.putString("action", "markerSelect");
406 | event.putInt("id", poiItem.getTag());
407 |
408 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onMarkerSelect", event);
409 | }
410 |
411 | // Marker 말풍선을 선택한 경우
412 | @Override
413 | public void onCalloutBalloonOfPOIItemTouched(MapView mapView, MapPOIItem poiItem) {
414 | WritableMap event = new WritableNativeMap();
415 |
416 | WritableMap coordinate = new WritableNativeMap();
417 | coordinate.putDouble("latitude", poiItem.getMapPoint().getMapPointGeoCoord().latitude);
418 | coordinate.putDouble("longitude", poiItem.getMapPoint().getMapPointGeoCoord().longitude);
419 | event.putMap("coordinate", coordinate);
420 | event.putString("action", "markerPress");
421 | event.putInt("id", poiItem.getTag());
422 |
423 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onMarkerPress", event);
424 |
425 | }
426 | @Override
427 | public void onCalloutBalloonOfPOIItemTouched(MapView mapView, MapPOIItem poiItem, MapPOIItem.CalloutBalloonButtonType buttonType) {
428 | WritableMap event = new WritableNativeMap();
429 |
430 | WritableMap coordinate = new WritableNativeMap();
431 | coordinate.putDouble("latitude", poiItem.getMapPoint().getMapPointGeoCoord().latitude);
432 | coordinate.putDouble("longitude", poiItem.getMapPoint().getMapPointGeoCoord().longitude);
433 | event.putMap("coordinate", coordinate);
434 | event.putString("action", "markerPress");
435 | event.putInt("id", poiItem.getTag());
436 |
437 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onMarkerPressEvent", event);
438 | }
439 |
440 | // Marker 위치를 이동한 경우
441 | @Override
442 | public void onDraggablePOIItemMoved(MapView mapView, MapPOIItem poiItem, MapPoint newMapPoint) {
443 | WritableMap event = new WritableNativeMap();
444 |
445 | WritableMap coordinate = new WritableNativeMap();
446 | coordinate.putDouble("latitude", newMapPoint.getMapPointGeoCoord().latitude);
447 | coordinate.putDouble("longitude", newMapPoint.getMapPointGeoCoord().longitude);
448 | event.putMap("coordinate", coordinate);
449 | event.putString("action", "markerMoved");
450 | event.putInt("id", poiItem.getTag());
451 |
452 | appContext.getJSModule(RCTEventEmitter.class).receiveEvent(rnMapView.getId(), "onMarkerMoved", event);
453 |
454 | }
455 | }
456 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/teamsf/daummap/DaumMapModule.java:
--------------------------------------------------------------------------------
1 | package com.teamsf.daummap;
2 |
3 | import android.support.annotation.Nullable;
4 | import android.util.Log;
5 | import android.app.Activity;
6 |
7 | import com.facebook.react.bridge.ReactApplicationContext;
8 | import com.facebook.react.bridge.ReactContextBaseJavaModule;
9 | import com.facebook.react.bridge.ReactMethod;
10 | import com.facebook.react.bridge.WritableMap;
11 | import com.facebook.react.modules.core.DeviceEventManagerModule;
12 | import com.facebook.react.uimanager.NativeViewHierarchyManager;
13 | import com.facebook.react.uimanager.UIBlock;
14 | import com.facebook.react.uimanager.UIManagerModule;
15 |
16 | import java.util.HashMap;
17 | import java.util.Map;
18 |
19 | public class DaumMapModule extends ReactContextBaseJavaModule {
20 | public static final String REACT_CLASS = "DaumMapModule";
21 | private static ReactApplicationContext reactContext = null;
22 |
23 | public DaumMapModule(ReactApplicationContext context) {
24 | super(context);
25 |
26 | this.reactContext = context;
27 | }
28 |
29 | @Override
30 | public String getName() {
31 | return REACT_CLASS;
32 | }
33 |
34 | @Override
35 | public Map getConstants() {
36 | final Map constants = new HashMap<>();
37 | // constants.put("EXAMPLE_CONSTANT", "example");
38 |
39 | return constants;
40 | }
41 |
42 | @ReactMethod
43 | public void clearMapCache (final int tag) {
44 | UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
45 | uiManager.addUIBlock(new UIBlock() {
46 | public void execute(NativeViewHierarchyManager nvhm) {
47 | RNMapView mapView = (RNMapView) nvhm.resolveView(tag);
48 |
49 | mapView.clearMapTilePersistentCache();
50 | }
51 | });
52 | }
53 |
54 | private static void emitDeviceEvent(String eventName, @Nullable WritableMap eventData) {
55 | reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, eventData);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/teamsf/daummap/DaumMapPackage.java:
--------------------------------------------------------------------------------
1 | package com.teamsf.daummap;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.JavaScriptModule;
5 | import com.facebook.react.bridge.NativeModule;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.uimanager.ViewManager;
8 |
9 | import java.util.Arrays;
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | public class DaumMapPackage implements ReactPackage {
14 | @Override
15 | public List createNativeModules(ReactApplicationContext reactContext) {
16 | return Arrays.asList(
17 | new DaumMapModule(reactContext)
18 | );
19 | }
20 |
21 | public List createViewManagers(ReactApplicationContext reactContext) {
22 | return Arrays.asList(
23 | new DaumMapManager(reactContext)
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/teamsf/daummap/RNMapView.java:
--------------------------------------------------------------------------------
1 | package com.teamsf.daummap;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.util.Log;
6 | import android.content.pm.ApplicationInfo;
7 | import android.content.pm.PackageManager;
8 | import android.content.pm.PackageManager.NameNotFoundException;
9 | import com.facebook.react.uimanager.ThemedReactContext;
10 | import com.facebook.react.uimanager.annotations.ReactProp;
11 | import com.facebook.react.bridge.ReactApplicationContext;
12 | import net.daum.mf.map.api.MapView;
13 |
14 | public class RNMapView extends MapView {
15 | private ThemedReactContext mContext;
16 | private MapView mMapView;
17 | private static final String TAG = "DaumMap";
18 |
19 | public RNMapView(ThemedReactContext themedReactContext, ReactApplicationContext appContext) {
20 | super(themedReactContext.getCurrentActivity(), null);
21 | mContext = themedReactContext;
22 |
23 | this.setMapTilePersistentCacheEnabled(true);
24 | String apiKey = null;
25 | try {
26 | ApplicationInfo ai = appContext.getPackageManager().getApplicationInfo(appContext.getApplicationContext().getPackageName(), PackageManager.GET_META_DATA);
27 | Bundle bundle = ai.metaData;
28 | if (bundle != null) {
29 | apiKey = bundle.getString("com.kakao.sdk.AppKey");
30 | this.setDaumMapApiKey(apiKey);
31 | }
32 | } catch (NameNotFoundException e) {
33 | Log.e(TAG, e.getMessage());
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/arm64-v8a/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/src/main/jniLibs/arm64-v8a/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi-v7a/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/src/main/jniLibs/armeabi-v7a/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/app/src/main/jniLibs/armeabi/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/app/src/main/jniLibs/armeabi/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/arm64-v8a/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/arm64-v8a/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/armeabi-v7a/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/armeabi-v7a/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/armeabi/libDaumMapEngineApi.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/armeabi/libDaumMapEngineApi.so
--------------------------------------------------------------------------------
/android/libDaumMapAndroid.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/android/libDaumMapAndroid.jar
--------------------------------------------------------------------------------
/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export interface Region {
4 | latitude: number;
5 | longitude: number;
6 | }
7 |
8 | export interface InitialRegion extends Region {
9 | zoomLevel: number;
10 | }
11 |
12 | export interface PolyLines {
13 | tag: number;
14 | color: string;
15 | points: Region[];
16 | }
17 |
18 | export interface Circles extends Region {
19 | lineColor: string;
20 | fillColor: string;
21 | lineWidth: number;
22 | radius: number;
23 | }
24 |
25 | export interface Marker extends Region {
26 | title: string;
27 | pinColor: string;
28 | markerImage: any;
29 | pinColorSelect: string;
30 | markerImageSelect: string;
31 | draggable: boolean;
32 | }
33 |
34 | export type MapType = 'Standard' | 'Satellite' | 'Hybrid';
35 |
36 | export interface MapViewProps {
37 | /**
38 | * 지도 초기 화면 좌표 및 확대/축소 레벨
39 | */
40 | initialRegion?: InitialRegion;
41 |
42 | /**
43 | * 지도 View Style
44 | */
45 | style?: any;
46 |
47 | /**
48 | * 지도 종류 (기본 지도 - Standard, 위성 지도 - Satellite, 하이브리드 지도 - Hybrid)
49 | */
50 | mapType?: MapType;
51 |
52 | /**
53 | * 지도 위에 추가되는 마커 정보
54 | */
55 | marker?: Marker[];
56 |
57 | /**
58 | * 지도 중심점 좌표, 지도 이동시 사용
59 | */
60 |
61 | region?: Region;
62 |
63 | /**
64 | * 정해진 좌표로 선을 그림
65 | */
66 |
67 | polyLines?: PolyLines;
68 |
69 | /**
70 | * 지정한 좌표에 원을 그림
71 | */
72 | circles?: Circles;
73 |
74 | /**
75 | * 현위치 트래킹 모드 (지도화면 중심을 단말의 현재 위치로 이동)
76 | */
77 | isTracking?: boolean;
78 |
79 | /**
80 | * 나침반 모드 (단말의 방향에 따라 지도화면이 회전), 트래킹 모드를 활성화 시켜야 사용 가능
81 | */
82 | isTracking?: boolean;
83 |
84 | /**
85 | * 현 위치를 표시하는 마커 표시 여부, 트래킹 모드 활성화시 true
86 | */
87 | isCurrentMarker?: boolean;
88 |
89 | /**
90 | * (Android) 위치 권한이 없을 경우 표시될 View
91 | */
92 | permissionDeniedView?: React.ReactElement;
93 |
94 | /**
95 | * (Android) 위치 권한 요청시 Alert창 제목
96 | */
97 | permissionAndroidTitle: string;
98 |
99 | /**
100 | * (Android) 위치 권한 요청시 Alert창 본문
101 | */
102 | permissionAndroidMessage: string;
103 |
104 | /**
105 | * 지도 이동시 변경되는 좌표값 반환
106 | */
107 | onRegionChange: (region: Region) => void;
108 |
109 | /**
110 | * 마커 핀을 선택한 경우
111 | * TODO: onMarkerSelect parameter type 수정
112 | */
113 | onMarkerSelect: any;
114 |
115 | /**
116 | * 마커 위 말풍선을 선택한 경우
117 | * TODO: onMarkerPress parameter type 수정
118 | */
119 | onMarkerPress: any;
120 |
121 | /**
122 | * 마커를 이동시킨 경우
123 | * TODO: onMarkerPress parameter type 수정
124 | */
125 | onMarkerMoved: any;
126 |
127 | /**
128 | * 트래킹 모드 사용중 좌표가 변경된 경우
129 | */
130 | onUpdateCurrentLocation: (region: Region) => void;
131 |
132 | /**
133 | * 나침반 모드 사용시 방향 각도 값이 변경된 경우
134 | */
135 | onUpdateCurrentHeading: (degree: any) => void;
136 | }
137 |
138 | export default class DaumMapView extends React.Component {}
139 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React, { Component } from 'react';
3 | import {
4 | requireNativeComponent,
5 | findNodeHandle,
6 | NativeModules,
7 | Platform,
8 | PermissionsAndroid,
9 | View,
10 | } from 'react-native';
11 |
12 | let REST_API_KEY = "";
13 | const DaumMapManager= Platform.OS === 'ios' ? NativeModules.DaumMapManager : NativeModules.DaumMapModule;
14 | const DaumMap = requireNativeComponent('DaumMap', DaumMapView, {
15 | nativeOnly: {
16 | onMarkerSelect : true,
17 | onMarkerPress : true,
18 | onRegionChange : true
19 | }
20 | })
21 |
22 | export default class DaumMapView extends Component {
23 | constructor(props) {
24 | super(props);
25 |
26 | this.state = {
27 | permissionGranted: false,
28 |
29 | };
30 | }
31 |
32 | async componentDidMount () {
33 | if (Platform.OS === "android") {
34 | try {
35 | const granted = await PermissionsAndroid.request(
36 | PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
37 | {
38 | 'title' : this.props.PermissionsAndroidTitle,
39 | 'message' : this.props.PermissionsAndroidMessage
40 | }
41 | )
42 | if (granted === PermissionsAndroid.RESULTS.GRANTED) {
43 | this.setState({ permissionGranted: true, });
44 | } else {
45 | this.setState({ permissionGranted: false, });
46 | }
47 | } catch (err) {
48 | console.warn(err)
49 | }
50 | } else {
51 | this.setState({ permissionGranted: true, });
52 | }
53 | }
54 |
55 | render () {
56 | if (this.state.permissionGranted) {
57 | return (
58 | { this.map = ref; }}
62 | onMarkerSelect={this._onMarkerSelect}
63 | onMarkerPress={this._onMarkerPress}
64 | onMarkerMoved={this._onMarkerMoved}
65 | onRegionChange={this._onRegionChange}
66 | onUpdateCurrentLocation={this._onUpdateCurrentLocation}
67 | onUpdateCurrentHeading={this._onUpdateCurrentHeading} />
68 | );
69 | } else {
70 | return (
71 |
72 | {this.props.permissionDeniedView}
73 |
74 | );
75 | }
76 | }
77 |
78 | _onMarkerSelect = (event) => {
79 | if (this.props.onMarkerSelect != undefined) {
80 | this.props.onMarkerSelect(event.nativeEvent);
81 | }
82 | }
83 |
84 | _onMarkerPress = (event) => {
85 | if (this.props.onMarkerPress != undefined) {
86 | this.props.onMarkerPress(event.nativeEvent);
87 | }
88 | }
89 |
90 | _onMarkerMoved = (event) => {
91 | if (this.props.onMarkerMoved != undefined) {
92 | this.props.onMarkerMoved(event.nativeEvent);
93 | }
94 | }
95 |
96 | _onRegionChange = (event) => {
97 | if (this.props.onRegionChange != undefined) {
98 | this.props.onRegionChange(event.nativeEvent);
99 | }
100 | }
101 |
102 | _onUpdateCurrentLocation = (event) => {
103 | if (this.props.onUpdateCurrentLocation != undefined) {
104 | this.props.onUpdateCurrentLocation(event.nativeEvent);
105 | }
106 | }
107 |
108 | _onUpdateCurrentHeading = (event) => {
109 | if (this.props.onUpdateCurrentHeading != undefined) {
110 | this.props.onUpdateCurrentHeading(event.nativeEvent);
111 | }
112 | }
113 |
114 | /************************************************************************************************
115 | * Daum Map Function
116 | ************************************************************************************************/
117 | clearMapCache() {
118 | DaumMapManager.clearMapCache(findNodeHandle(this.map));
119 | }
120 |
121 | /************************************************************************************************
122 | * Daum Local API
123 | ************************************************************************************************/
124 | // REST API Key
125 | static setRestApiKey (apiKey) {
126 | REST_API_KEY = apiKey;
127 | }
128 |
129 | // 주소 검색
130 | // https://developers.kakao.com/docs/restapi/local#주소-검색
131 | static serachAddress (query, page=1, size=10) {
132 | if (REST_API_KEY == "") {
133 | return new Promise(function(resolve, reject) {
134 | reject({ "message": "Daum Rest API Key가 필요합니다." });
135 | });
136 | }
137 | if (query == undefined || query == "") {
138 | return new Promise(function(resolve, reject) {
139 | reject({ "message": "검색할 주소를 입력 해 주세요." });
140 | });
141 | }
142 |
143 | let option = makeRequestHeader();
144 | let url = makeRequestURL(
145 | "search/address.json",
146 | {
147 | query : query,
148 | page : page,
149 | size : size > 30 ? 30 : size
150 | }
151 | );
152 |
153 | return requestDaumAPI(url, option);
154 | }
155 |
156 | // 좌표 → 행정구역정보 변환
157 | // https://developers.kakao.com/docs/restapi/local#좌표-행정구역정보-변환
158 | static getCoordToRegionArea (latitude, longitude, input_coord="WGS84", output_coord="WGS84", lang="ko") {
159 | if (REST_API_KEY == "") {
160 | return new Promise(function(resolve, reject) {
161 | reject({ "message": "Daum Rest API Key가 필요합니다." });
162 | });
163 | }
164 | if (latitude == undefined || latitude == "") {
165 | return new Promise(function(resolve, reject) {
166 | reject({ "message": "위도 값을 입력 해 주세요." });
167 | });
168 | }
169 | if (longitude == undefined || longitude == "") {
170 | return new Promise(function(resolve, reject) {
171 | reject({ "message": "경도 값을 입력 해 주세요." });
172 | });
173 | }
174 |
175 | let option = makeRequestHeader();
176 | let url = makeRequestURL(
177 | "geo/coord2regioncode.json",
178 | {
179 | x : longitude,
180 | y : latitude,
181 | input_coord : input_coord,
182 | output_coord: output_coord,
183 | lang : lang
184 | }
185 | );
186 |
187 | return requestDaumAPI(url, option);
188 | }
189 |
190 | // 좌표 → 주소 변환
191 | // https://developers.kakao.com/docs/restapi/local#좌표-주소-변환
192 | static getCoordToAddress (latitude, longitude, input_coord="WGS84") {
193 | if (REST_API_KEY == "") {
194 | return new Promise(function(resolve, reject) {
195 | reject({ "message": "Daum Rest API Key가 필요합니다." });
196 | });
197 | }
198 | if (latitude == undefined || latitude == "") {
199 | return new Promise(function(resolve, reject) {
200 | reject({ "message": "위도 값을 입력 해 주세요." });
201 | });
202 | }
203 | if (longitude == undefined || longitude == "") {
204 | return new Promise(function(resolve, reject) {
205 | reject({ "message": "경도 값을 입력 해 주세요." });
206 | });
207 | }
208 |
209 | let option = makeRequestHeader();
210 | let url = makeRequestURL(
211 | "geo/coord2address.json",
212 | {
213 | x : longitude,
214 | y : latitude,
215 | input_coord : input_coord
216 | }
217 | );
218 |
219 | return requestDaumAPI(url, option);
220 | }
221 |
222 | // 좌표계 변환
223 | // https://developers.kakao.com/docs/restapi/local#좌표계-변환
224 | static transCoord (latitude, longitude, input_coord="WGS84", output_coord="WGS84") {
225 | if (REST_API_KEY == "") {
226 | return new Promise(function(resolve, reject) {
227 | reject({ "message": "Daum Rest API Key가 필요합니다." });
228 | });
229 | }
230 | if (latitude == undefined || latitude == "") {
231 | return new Promise(function(resolve, reject) {
232 | reject({ "message": "위도 값을 입력 해 주세요." });
233 | });
234 | }
235 | if (longitude == undefined || longitude == "") {
236 | return new Promise(function(resolve, reject) {
237 | reject({ "message": "경도 값을 입력 해 주세요." });
238 | });
239 | }
240 |
241 | let option = makeRequestHeader();
242 | let url = makeRequestURL(
243 | "geo/transcoord.json",
244 | {
245 | x : longitude,
246 | y : latitude,
247 | input_coord : input_coord,
248 | output_coord: output_coord
249 | }
250 | );
251 |
252 | return requestDaumAPI(url, option);
253 | }
254 |
255 | // 키워드로 장소 검색
256 | // https://developers.kakao.com/docs/restapi/local#키워드로-장소-검색
257 | static searchKeyword (query, category="", latitude=undefined, longitude=undefined, radius=500, page=1, size=15, sort="accuracy") {
258 | if (REST_API_KEY == "") {
259 | return new Promise(function(resolve, reject) {
260 | reject({ "message": "Daum Rest API Key가 필요합니다." });
261 | });
262 | }
263 | if (query == undefined || query == "") {
264 | return new Promise(function(resolve, reject) {
265 | reject({ "message": "검색어를 입력 해 주세요." });
266 | });
267 | }
268 | if (sort != "accuracy" && sort != "distance") {
269 | sort = "accuracy";
270 | }
271 |
272 | let params = {
273 | query : query,
274 | page : page > 45 ? 45 : page,
275 | size : size > 15 ? 15 : size,
276 | sort : sort
277 | };
278 |
279 | if (category != undefined && category != "") {
280 | // 카테고리 그룹 코드. 결과를 카테고리로 필터링을 원하는 경우 사용
281 | params.category_group_code = category;
282 | }
283 | if (latitude != undefined) {
284 | // 중심 좌표의 Y값 혹은 latitude. 특정 지역을 중심으로 검색하려고 할 경우 radius와 함께 사용 가능
285 | params.y = latitude;
286 | }
287 | if (longitude != undefined) {
288 | // 중심 좌표의 X값 혹은 longitude. 특정 지역을 중심으로 검색하려고 할 경우 radius와 함께 사용 가능
289 | params.x = longitude;
290 | }
291 | if (radius != undefined) {
292 | // 중심 좌표부터의 반경거리. 특정 지역을 중심으로 검색하려고 할 경우 중심좌표로 쓰일 x,y와 함께 사용. 단위 meter
293 | if (radius >= 0 && radius <= 20000) {
294 | params.radius = radius;
295 | }
296 | } else {
297 | return new Promise(function(resolve, reject) {
298 | reject({ "message": "반경 거리는 20km 이내로 해 주세요." });
299 | });
300 | }
301 |
302 | let option = makeRequestHeader();
303 | let url = makeRequestURL("search/keyword.json", params);
304 |
305 | return requestDaumAPI(url, option);
306 | }
307 |
308 | // 카테고리로 장소 검색
309 | // https://developers.kakao.com/docs/restapi/local#카테고리로-장소-검색
310 | static searchCategory (category, latitude=undefined, longitude=undefined, radius=500, page=1, size=15, sort="accuracy") {
311 | if (REST_API_KEY == "") {
312 | return new Promise(function(resolve, reject) {
313 | reject({ "message": "Daum Rest API Key가 필요합니다." });
314 | });
315 | }
316 | if (category == undefined || category == "") {
317 | return new Promise(function(resolve, reject) {
318 | reject({ "message": "카테고리를 입력 해 주세요." });
319 | });
320 | }
321 | if (latitude == undefined || longitude == undefined){
322 | return new Promise(function(resolve, reject) {
323 | reject({ "message": "위경도를 입력 해 주세요." });
324 | });
325 | }
326 |
327 | let params = {
328 | category_group_code : category,
329 | page : page > 45 ? 45 : page,
330 | size : size > 15 ? 15 : size,
331 | sort : sort
332 | };
333 |
334 | if (latitude != undefined) {
335 | // 중심 좌표의 Y값 혹은 latitude. 특정 지역을 중심으로 검색하려고 할 경우 radius와 함께 사용 가능
336 | params.y = latitude;
337 | }
338 | if (longitude != undefined) {
339 | // 중심 좌표의 X값 혹은 longitude. 특정 지역을 중심으로 검색하려고 할 경우 radius와 함께 사용 가능
340 | params.x = longitude;
341 | }
342 | if (radius != undefined) {
343 | // 중심 좌표부터의 반경거리. 특정 지역을 중심으로 검색하려고 할 경우 중심좌표로 쓰일 x,y와 함께 사용. 단위 meter
344 | if (radius >= 0 && radius <= 20000) {
345 | params.radius = radius;
346 | }
347 | } else {
348 | return new Promise(function(resolve, reject) {
349 | reject({ "message": "반경 거리는 20km 이내로 해 주세요." });
350 | });
351 | }
352 |
353 | let option = makeRequestHeader();
354 | let url = makeRequestURL("search/category.json", params);
355 |
356 | return requestDaumAPI(url, option);
357 | }
358 | }
359 |
360 | function makeRequestHeader () {
361 | let option = {
362 | method: "GET",
363 | headers: {
364 | 'Accept': 'application/json',
365 | 'Authorization': 'KakaoAK ' + REST_API_KEY
366 | }
367 | };
368 |
369 | return option;
370 | }
371 |
372 | function makeRequestURL (url, params) {
373 | if (params != undefined && typeof(params) === 'object') {
374 | let paramUrl = '';
375 | for (let key in params) {
376 | let concatStr = (paramUrl.length == 0) ? '?' : '&';
377 | paramUrl += concatStr + key + "=" + params[key];
378 | }
379 |
380 | url += paramUrl;
381 | }
382 |
383 | return url;
384 | }
385 |
386 | function requestDaumAPI (url, option) {
387 | return new Promise(function(success, failed) {
388 | var errorFlag = false;
389 |
390 | fetch("https://dapi.kakao.com/v2/local/" + url, option)
391 | .then((response) => {
392 | if (response.status == 200) {
393 | return response.json();
394 | } else {
395 | failed({ "message": "Server request error" });
396 | }
397 | })
398 | .then((responseJson) => {
399 | if (!errorFlag) success(responseJson);
400 | })
401 | .catch((error) => {
402 | errorFlag = true;
403 | failed(error);
404 | });
405 | });
406 | }
407 |
408 | DaumMapView.propTypes = {
409 | onMarkerSelect : PropTypes.func,
410 | onMarkerPress : PropTypes.func,
411 | onRegionChange : PropTypes.func,
412 | onUpdateCurrentLocation : PropTypes.func,
413 | onUpdateCurrentHeading : PropTypes.func,
414 | }
415 |
416 | DaumMapView.defaultProps = {
417 | style : {},
418 | isTracking : false,
419 | isCompass : false,
420 | isCurrentMarker : true,
421 |
422 | permissionDeniedView : null,
423 | PermissionsAndroidTitle : "권한 요청",
424 | PermissionsAndroidMessage: "지도 표시를 위해 권한을 허용 해 주세요.",
425 | }
426 |
--------------------------------------------------------------------------------
/ios/DaumMap.framework/DaumMap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/DaumMap
--------------------------------------------------------------------------------
/ios/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.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.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.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.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.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.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.framework/Headers/MTMapView.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @brief Daum Map View Class
3 | * @file MTMapView.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 | #import
12 | #import
13 | #import
14 | #import
15 | #import
16 |
17 |
18 | @class MTMapViewInternal;
19 | @class MTMapCameraUpdate;
20 |
21 | @protocol MTMapViewDelegate;
22 |
23 | /**
24 | * 지도 종류 enumeration
25 | * @see MTMapView.baseMapType property
26 | */
27 | typedef NS_ENUM(NSInteger, MTMapType) {
28 | MTMapTypeStandard, /**< 기본 지도 */
29 | MTMapTypeSatellite, /**< 위성 지도 */
30 | MTMapTypeHybrid /**< 하이브리드 지도 */
31 | };
32 |
33 | /**
34 | * 현위치 트랙킹 타입 enumeration
35 | * @see MTMapView.currentLocationTrackingMode property
36 | */
37 | typedef NS_ENUM(NSInteger, MTMapCurrentLocationTrackingMode) {
38 | MTMapCurrentLocationTrackingOff, /**< 현위치 트랙킹 모드 및 나침반 모드 Off */
39 | MTMapCurrentLocationTrackingOnWithoutHeading, /**< 현위치 트랙킹 모드 On, 단말의 위치에 따라 지도 중심이 이동한다. 나침반 모드는 꺼진 상태 */
40 | MTMapCurrentLocationTrackingOnWithHeading, /**< 현위치 트랙킹 모드 On + 나침반 모드 On, 단말의 위치에 따라 지도 중심이 이동하며 단말의 방향에 따라 지도가 회전한다.(나침반 모드 On) */
41 | MTMapCurrentLocationTrackingOnWithoutHeadingWithoutMapMoving,
42 | MTMapCurrentLocationTrackingOnWithHeadingWithoutMapMoving,
43 | };
44 |
45 | /**
46 | * Zoom Level 데이터 타입 (integer)
47 | */
48 | typedef int MTMapZoomLevel;
49 |
50 | /**
51 | * @brief Daum 지도 화면을 보여주는 View Class.
52 | * MTMapView를 생성하여 Daum 지도 화면을 보여주는 View를 사용할 수 있다.
53 | * 지도 종류 지정, 지도 화면 이동/확대/축소,
54 | * 현위치 트래킹 및 나침반 모드, POI Item(MTMapPOIItem) 관리, Polyline(MTMapPolyline) 관리 등의 기능이 제공된다.
55 | * MTMapViewDelegate protocol을 구현하는 delegate객체를 지정하여
56 | * 지도에서 발생하는 다양한 이벤트들을 통보받을 수 있다.
57 | * 동시에 두개 이상의 MTMapView 객체를 생성하여 사용하는 것은 허용되지 않는다.
58 | * @see MTMapPoint, MTMapPOIItem, MTMapPolyline, MTMapViewDelegate
59 | */
60 | @interface MTMapView : UIView {
61 | @private
62 | MTMapViewInternal* _internalImpl;
63 | }
64 |
65 | /**
66 | * Daum Map Open API Key 발급 페이지에서 발급 받은 API Key를 설정한다.
67 | * Open API Key 는 App. Bundle Id 당 하나씩 발급 된다.
68 | * Open API Key는 지도화면이 화면에 보여지기 전에 반드시 설정되어야 한다.
69 | * 설정된 Open API Key가 정상적으로 등록되지 않은 Key 이거나
70 | * 트래픽 제한에 걸린 경우에는 다음 지도 화면 사용이 제한될 수 있다.
71 | */
72 | @property (nonatomic, retain) NSString *daumMapApiKey __deprecated_msg("Info.plist의 KAKAO_APP_KEY의 값을 읽어 오도록 수정되었습니다. daumMapApiKey는 더이상 작동 하지 않습니다.");
73 |
74 | /**
75 | * 지도 객체에서 발생하는 이벤트를 처리할 delegate 객체를 설정한다.
76 | * delegate 객체는 Open API Key 인증 결과 이벤트, 지도 이동/확대/축소,
77 | * 지도 화면 터치(Single Tap / Double Tap / Long Press) 이벤트,
78 | * 현위치 트래킹 이벤트, POI(Point Of Interest) 관련 이벤트를 통보받을 수 있다.
79 | */
80 | @property (nonatomic, assign) id delegate;
81 |
82 | /**
83 | * 지도 종류(기본 지도, 위성 지도, 하이브리드 지도)를 지정하거나 현재 보여주고 있는 지도 종류를 확인할 수 있다.
84 | */
85 | @property (nonatomic) MTMapType baseMapType;
86 |
87 | /**
88 | * 고해상도 지도 타일 사용 여부를 설정한다.
89 | * Retina Display인 경우 기본값은 YES, 아닌경우 기본값은 NO
90 | */
91 | @property (nonatomic) BOOL useHDMapTile;
92 |
93 | /**
94 | * 지도 타일 이미지 Persistent Cache 기능 활성화 여부를 조회한다.
95 | * @return Persistent Cache 기능 활성화 여부
96 | */
97 | + (BOOL)isMapTilePersistentCacheEnabled;
98 |
99 | /**
100 | * 지도 타일 이미지 Persistent Cache 기능은
101 | * 네트워크를 통해 다운로드한 지도 이미지 데이터를
102 | * 단말의 영구(persistent) 캐쉬 영역에 저장하는 기능이다.
103 | * 같은 영역의 지도를 다시 로드할때 캐쉬에 저장된 지도 타일들은
104 | * 네트워크를 통해 다운로드 받지 않고 단말의 캐쉬에서 바로 로드하여
105 | * 네트워크 사용량을 줄이고 지도 로딩 시간을 단축할 수 있다.
106 | * 사용되지 않는 지도 타일 이미지 캐쉬 데이터는 MapView 동작 중에 자동으로
107 | * 삭제되어 캐쉬 용량의 크기가 너무 커지지 않도록 조절된다.
108 | * Application의 Cache 영역 사용량이 부담이 되면 Cache 기능을 비활성화 하는 것이 좋다.
109 | * MTMapView가 동작하는 중에는 Cache 기능 활성화 설정 변경이 적용되지 않으며
110 | * MTMapView를 사용하기 전에 Cache 활성화 여부를 설정해야 한다.
111 | * @param enableCache Persistent Cache 기능 활성화 여부
112 | */
113 | + (void)setMapTilePersistentCacheEnabled:(BOOL)enableCache;
114 |
115 | /**
116 | * Application의 Document Directory의 임시 디렉토리에
117 | * 저장된 지도 타일 캐쉬 데이터를 모두 삭제한다.
118 | * MTMapView가 동작 중인 상태에서도 사용가능하다.
119 | */
120 | + (void)clearMapTilePersistentCache;
121 |
122 | /**
123 | * 현위치를 표시하는 아이콘(마커)를 화면에 표시할지 여부를 설정한다.
124 | * currentLocationTrackingMode property를 이용하여 현위치 트래킹 기능을 On 시키면 자동으로 현위치 마커가 보여지게 된다.
125 | * 현위치 트래킹 기능을 Off한 후에 현위치 아이콘을 지도 화면에서 제거할 때 사용할 수 있다.
126 | */
127 | @property (nonatomic) BOOL showCurrentLocationMarker;
128 |
129 | /**
130 | * 화면상에 보이는 현위치 마커의 UI를 업데이트 한다.
131 | * @param locationMarkerItem 현위치 마커 정보. nil일 경우, Default 현위치 마커로 노출된다.
132 | */
133 | - (void)updateCurrentLocationMarker:(MTMapLocationMarkerItem *)locationMarkerItem;
134 |
135 | /**
136 | * 현위치 트래킹 모드 및 나침반 모드를 설정한다.
137 | * - 현위치 트래킹 모드 : 지도화면 중심을 단말의 현재 위치로 이동시켜줌
138 | * - 나침반 모드 : 단말의 방향에 따라 지도화면이 회전됨
139 | * 현위치 트래킹 모드만 On시키거나 현위치 트래킹 모드, 나침반 모드 둘다 On 시킬 수 있다.
140 | * 현위치 트래킹/나침반 모드를 활성화 시키면 현위치 정보가 설정된 MTMapViewDelegate 객체에 전달된다.
141 | * @see MTMapCurrentLocationTrackingMode
142 | * @see MTMapViewDelegate
143 | */
144 | @property (nonatomic) MTMapCurrentLocationTrackingMode currentLocationTrackingMode;
145 |
146 | /**
147 | * 현재 지도 화면의 중심점을 확인할 수 있다.
148 | */
149 | @property (nonatomic, readonly) MTMapPoint* mapCenterPoint;
150 |
151 | /**
152 | * 현재 지도 화면의 좌하단, 우상단 영역을 확인할 수 있다.
153 | */
154 | @property (nonatomic, readonly) MTMapBoundsRect* mapBounds;
155 |
156 |
157 | /**
158 | * 현재 지도 화면의 확대/축소 레벨을 확인할 수 있다.
159 | */
160 | @property (nonatomic, readonly) MTMapZoomLevel zoomLevel;
161 |
162 | /**
163 | * 현재 지도화면의 회전 각도(360 degree)를 확인할 수 있다.
164 | */
165 | @property (nonatomic, readonly) MTMapRotationAngle mapRotationAngle;
166 |
167 | //@property (nonatomic) BOOL zoomEnabled;
168 | //@property (nonatomic) BOOL panEnabled;
169 |
170 | /**
171 | * 지도 화면의 중심점을 설정한다.
172 | * @param mapPoint 지도화면 중심점을 나타내는 MTMapPoint 객체
173 | * @param animated 지도화면 중심점 이동시 애니매이션 효과를 적용할지 여부
174 | */
175 | - (void)setMapCenterPoint:(MTMapPoint*)mapPoint animated:(BOOL)animated;
176 |
177 | /**
178 | * 지도 화면의 중심점과 확대/축소 레벨을 설정한다.
179 | * @param mapPoint 지도화면 중심점을 나타내는 MTMapPoint 객체
180 | * @param zoomLevel 지도화면 확대 축소 레벨 값 (-2~12, 값이 클수록 더 넓은 영역이 화면이 보임)
181 | * @param animated 지도화면 중심점 이동 및 확대/축소 레벨 변경시 애니매이션 효과를 적용할지 여부
182 | */
183 | - (void)setMapCenterPoint:(MTMapPoint*)mapPoint zoomLevel:(MTMapZoomLevel)zoomLevel animated:(BOOL)animated;
184 |
185 | /**
186 | * 지도 화면의 확대/축소 레벨을 설정한다.
187 | * @param zoomLevel 지도화면 확대 축소 레벨 값 (-2~12, 값이 클수록 더 넓은 영역이 화면이 보임)
188 | * @param animated 지도화면의 확대/축소 레벨 변경시 애니매이션 효과를 적용할지 여부
189 | */
190 | - (void)setZoomLevel:(MTMapZoomLevel)zoomLevel animated:(BOOL)animated;
191 |
192 | /**
193 | * 지도 화면을 한단계 확대한다. (더 좁은 영역이 크게 보임)
194 | * 확대/축소 레벨 값이 1 감소됨
195 | * @param animated 지도화면의 확대 시 애니매이션 효과를 적용할지 여부
196 | */
197 | - (void)zoomInAnimated:(BOOL)animated;
198 |
199 | /**
200 | * 지도 화면을 한단계 축소한다. (더 넓은 영역이 화면에 나타남)
201 | * 확대/축소 레벨 값이 1 증가됨
202 | * @param animated 지도화면의 축소 시 애니매이션 효과를 적용할지 여부
203 | */
204 | - (void)zoomOutAnimated:(BOOL)animated;
205 |
206 | /**
207 | * 지도 화면의 회전 각도를 설정한다.
208 | * @param angle 회전 각도 (0~360도)
209 | * @param animated 회전 각도 변경시 애니매이션 효과를 적용할지 여부
210 | */
211 | - (void)setMapRotationAngle:(MTMapRotationAngle)angle animated:(BOOL)animated;
212 |
213 | /**
214 | * 지정한 지도 좌표들이 모두 화면에 나타나도록 지도화면 중심과 확대/축소 레벨을 자동조절 한다.
215 | * @param mapPoints 화면에 모두 보여주고자 하는 지도 좌표 리스트 (Array of MTMapPoint)
216 | */
217 | - (void)fitMapViewAreaToShowMapPoints:(NSArray*)mapPoints;
218 |
219 | /**
220 | * 지도 화면 이동 혹은 확대/축소 시킨다.
221 | * @param cameraUpdate 지도 화면 이동을 위한 중심점, 확대/축소 레벨 등을 지정한 MTMapCameraUpdate 객체
222 | */
223 | - (void)animateWithCameraUpdate:(MTMapCameraUpdate *)cameraUpdate;
224 |
225 | /**
226 | * 지도 화면에 나타나는 지도 타일들을 지도 타일 서버에서 다시 받아와서 갱신한다.
227 | */
228 | - (void)refreshMapTiles;
229 |
230 | /**
231 | * MTMapView를 포함하고 있는 UIViewController 객체의 didReceiveMemoryWarning 메소드 구현에서 호출해 주어야 한다.
232 | * iOS에서 Memory Warning 발생시 메모리에 저장하고 있는
233 | * 지도 타일 이미지 캐쉬 데이터 들을 삭제하여 메모리를 확보할 수 있다.
234 | */
235 | - (void)didReceiveMemoryWarning;
236 |
237 | //- (CGPoint)viewPointFromMapPoint:(MTMapPoint*)mapPoint;
238 | //- (MTMapPoint*)mapPointFromViewPoint:(CGPoint)viewPoint;
239 |
240 | /////////////////////////////////////////////////////////////////////////////////////////////////////////
241 | // MTMapPOIItem
242 |
243 | /**
244 | * 지도화면에 보여주고 있는 POI(Point Of Interest) 아이템 리스트를 조회할 수 있다.
245 | */
246 | @property (nonatomic, readonly) NSArray* poiItems;
247 |
248 | /**
249 | * 지도화면에 POI(Point Of Interest) Item 아이콘(마커)를 추가한다.
250 | * @param poiItem 추가할 POI Item 객체
251 | */
252 | - (void)addPOIItem:(MTMapPOIItem*)poiItem;
253 |
254 | /**
255 | * 지도화면에 POI(Point Of Interest) Item 아이콘(마커) 리스트를 추가한다.
256 | * @param poiItems 추가할 POI Item 객체 리스트 (array of MTMapPOIItem(s))
257 | */
258 | - (void)addPOIItems:(NSArray *)poiItems;
259 |
260 | /**
261 | * 특정 POI(Point Of Interest) Item 을 선택한다.
262 | * 선택된 POI Item은 Callout Balloon(말풍선)이 아이콘(마커)위에 나타난다.
263 | * @param poiItem 선택할 POI Item 객체
264 | * @param animated POI Item 선택시 말풍선이 나타날 때 애니매이션 효과가 적용될 지 여부
265 | */
266 | - (void)selectPOIItem:(MTMapPOIItem*)poiItem animated:(BOOL)animated;
267 |
268 | /**
269 | * 특정 POI(Point Of Interest) Item 을 선택 해제한다.
270 | * 선택 해제된 POI Item은 Callout Balloon(말풍선)이 POI 아이콘(마커)위에서 사라진다.
271 | * @param poiItem 선택 해제할 POI Item 객체
272 | */
273 | - (void)deselectPOIItem:(MTMapPOIItem*)poiItem;
274 |
275 | /**
276 | * 지도화면에 추가된 POI(Point Of Interest) Item 들 중에서 tag값이 일치하는 POI Item을 찾는다.
277 | * @param tag 찾고자 하는 POI Item의 tag 값
278 | * @return tag가 일치하는 POI Item 객체, 일치하는 POI Item이 없는 경우 nil이 리턴된다.
279 | */
280 | - (MTMapPOIItem*)findPOIItemByTag:(NSInteger)tag;
281 |
282 | /**
283 | * 지도화면에 추가된 POI(Point Of Interest) Item 들 중에서 이름이 일치하는 POI Item 객체(리스트)를 찾는다.
284 | * @param name 찾고자 하는 POI Item의 이름 문자열
285 | * @return 이름 문자열이 일치하는 POI Item 객체(리스트), 일치하는 POI Item이 없는 경우 nil이 리턴된다.
286 | */
287 | - (NSArray*)findPOIItemByName:(NSString*)name;
288 |
289 | /**
290 | * 특정 POI(Point Of Interest) Item을 지도화면에서 제거한다.
291 | * @param poiItem 제거하고자 하는 POI Item 객체
292 | */
293 | - (void)removePOIItem:(MTMapPOIItem*)poiItem;
294 |
295 | /**
296 | * POI(Point Of Interest) Item 리스트를 지도화면에서 제거한다.
297 | * @param poiItems 제거하고자 하는 POI Item 객체 리스트
298 | */
299 | - (void)removePOIItems:(NSArray *)poiItems; // array of MTMapPOIItem(s)
300 |
301 | /**
302 | * 지도 화면에 추가된 모든 POI(Point Of Interest) Item들을 제거한다.
303 | */
304 | - (void)removeAllPOIItems;
305 |
306 | /**
307 | * 지도 화면에 추가된 모든 POI(Point Of Interest) Item들이
308 | * 화면에 나타나도록 지도 화면 중심과 확대/축소 레벨을 자동으로 조정한다.
309 | */
310 | - (void)fitMapViewAreaToShowAllPOIItems;
311 |
312 | /////////////////////////////////////////////////////////////////////////////////////////////////////////
313 | // MTMapPolyline
314 |
315 | /**
316 | * 지도화면에 보여주고 있는 Polyline 리스트를 조회할 수 있다.
317 | */
318 | @property (nonatomic, readonly) NSArray* polylines;
319 |
320 | /**
321 | * 지도화면에 Polyline을 추가한다.
322 | * @param polyline 추가할 Polyline 객체
323 | */
324 | - (void)addPolyline:(MTMapPolyline*)polyline;
325 |
326 | /**
327 | * 지도화면에 추가된 Polyline들 중에서 tag값이 일치하는 Polyline을 찾는다.
328 | * @param tag 찾고자 하는 Polyline의 tag 값
329 | * @return tag값이 일치하는 Polyline 객체, 일치하는 Polyline이 없는 경우 nil이 리턴된다.
330 | */
331 | - (MTMapPolyline*)findPolylineByTag:(NSInteger)tag;
332 |
333 | /**
334 | * 특정 Polyline을 지도화면에서 제거한다.
335 | * @param polyline 제거하고자 하는 Polyline 객체
336 | */
337 | - (void)removePolyline:(MTMapPolyline*)polyline;
338 |
339 | /**
340 | * 지도 화면에 추가된 모든 Polyline을 제거한다.
341 | */
342 | - (void)removeAllPolylines;
343 |
344 | /**
345 | * 특정 Polyline의 모든 점들이 화면에 전부 나타나도록
346 | * 지도 화면 중심과 확대/축소 레벨을 자동으로 조정한다.
347 | * @param polyline 화면에 보여주고자 하는 polyline
348 | */
349 | - (void)fitMapViewAreaToShowPolyline:(MTMapPolyline*)polyline;
350 |
351 | /**
352 | * 지도 화면에 추가된 모든 Polyline 들이
353 | * 화면에 나타나도록 지도 화면 중심과 확대/축소 레벨을 자동으로 조정한다.
354 | */
355 | - (void)fitMapViewAreaToShowAllPolylines;
356 |
357 | /////////////////////////////////////////////////////////////////////////////////////////////////////////
358 | // MTMapCircle
359 |
360 | /**
361 | * 지도화면에 보여주고 있는 CircleOverlay 리스트를 조회할 수 있다.
362 | */
363 | @property (nonatomic, readonly) NSArray* circles;
364 |
365 | /**
366 | * 지도화면에 Circle을 추가한다.
367 | * @param circle 추가할 CircleOverlay 객체
368 | */
369 | - (void)addCircle:(MTMapCircle*)circle;
370 |
371 | /**
372 | * 지도화면에 추가된 Circle들 중에서 tag값이 일치하는 Circle를 찾는다.
373 | * @param tag 찾고자 하는 Circle의 tag 값
374 | * @return tag값이 일치하는 Circle 객체, 일치하는 Circle이 없는 경우 nil이 리턴된다.
375 | */
376 | - (MTMapCircle*)findCircleByTag:(NSInteger)tag;
377 |
378 | /**
379 | * 특정 Circle을 지도화면에서 제거한다.
380 | * @param circle 제거하고자 하는 CircleOverlay 객체
381 | */
382 | - (void)removeCircle:(MTMapCircle*)circle;
383 |
384 | /**
385 | * 지도 화면에 추가된 모든 Circle를 제거한다.
386 | */
387 | - (void)removeAllCircles;
388 |
389 | /**
390 | * 특정 Circle이 화면에 전부 나타나도록
391 | * 지도 화면 중심과 확대/축소 레벨을 자동으로 조정한다.
392 | * @param circle 화면에 보여주고자 하는 Circle
393 | */
394 | - (void)fitMapViewAreaToShowCircle:(MTMapCircle*)circle;
395 |
396 | /**
397 | * 지도 화면에 추가된 모든 Circle들이
398 | * 화면에 나타나도록 지도 화면 중심과 확대/축소 레벨을 자동으로 조정한다.
399 | */
400 | - (void)fitMapViewAreaToShowAllCircleOverlays;
401 |
402 | @end
403 |
404 | /**
405 | * 지도 객체에서 발생하는 이벤트를 처리할 delegate interface protocol.
406 | * MTMapViewDelegate protocol을 구현한 객체를 생성하여 MTMapView 객체의 delegate property에 설정해야한다.
407 | * delegate 객체는 Open API Key 인증 결과 이벤트, 지도 이동/확대/축소,
408 | * 지도 화면 터치(Single Tap / Double Tap / Long Press) 이벤트,
409 | * 현위치 트래킹 이벤트, POI(Point Of Interest) 관련 이벤트를 통보받을 수 있다.
410 | * @see MTMapView
411 | */
412 | @protocol MTMapViewDelegate
413 | @optional
414 |
415 | // Open API Key Authentication delegate methods
416 |
417 | /**
418 | * [Open API Key Authentication] MTMapView 객체의 setDaumMapApiKey 메소드로 설정한 Open API Key값을
419 | * Daum Open API Key 인증 서버에 인증한 결과를 통보받을 수 있다.
420 | * Open API Key 는 App. Bundle Id 당 하나씩 Daum Open API Key 발급 페이지를 통해서 발급 된다.
421 | * @param mapView MTMapView 객체
422 | * @param resultCode 인증 결과 코드, 200 : 인증성공, 200이 아닌경우에는 인증 실패
423 | * @param resultMessage 인증 결과 메세지, 인증 성공 및 실패에 대한 구체적인 메세지를 제공함
424 | */
425 | - (void)mapView:(MTMapView*)mapView openAPIKeyAuthenticationResultCode:(int)resultCode resultMessage:(NSString*)resultMessage;
426 |
427 |
428 | // Map View Event delegate methods
429 |
430 | /**
431 | * [Map View Event] 지도 중심 좌표가 이동한 경우 호출된다.
432 | * @param mapView MTMapView 객체
433 | * @param mapCenterPoint 새로 이동한 지도 중심 좌표
434 | */
435 | - (void)mapView:(MTMapView*)mapView centerPointMovedTo:(MTMapPoint*)mapCenterPoint;
436 |
437 | /**
438 | * [Map View Event] 지도 화면의 이동이 끝난 뒤 호출된다.
439 | * @param mapView MTMapView 객체
440 | * @param mapCenterPoint 새로 이동한 지도 중심 좌표
441 | */
442 | - (void)mapView:(MTMapView*)mapView finishedMapMoveAnimation:(MTMapPoint*)mapCenterPoint;
443 |
444 | /**
445 | * [Map View Event] 지도 확대/축소 레벨이 변경된 경우 호출된다.
446 | * @param mapView MTMapView 객체
447 | * @param zoomLevel 변경된 지도 확대/축소 레벨
448 | */
449 | - (void)mapView:(MTMapView*)mapView zoomLevelChangedTo:(MTMapZoomLevel)zoomLevel;
450 |
451 | /**
452 | * [Map View Event] 사용자가 지도 위를 터치한 경우 호출된다.
453 | * @param mapView MTMapView 객체
454 | * @param mapPoint 사용자가 터치한 지도 좌표
455 | */
456 | - (void)mapView:(MTMapView*)mapView singleTapOnMapPoint:(MTMapPoint*)mapPoint;
457 |
458 | /**
459 | * [Map View Event] 사용자가 지도 위 한 지점을 더블 터치한 경우 호출된다.
460 | * @param mapView MTMapView 객체
461 | * @param mapPoint 사용자가 터치한 지도 좌표
462 | */
463 | - (void)mapView:(MTMapView*)mapView doubleTapOnMapPoint:(MTMapPoint*)mapPoint;
464 |
465 | /**
466 | * [Map View Event] 사용자가 지도 위 한 지점을 터치하여 드래그를 시작할 경우 호출된다.
467 | * @param mapView MTMapView 객체
468 | * @param mapPoint 사용자의 드래그가 시작한 지도 좌표
469 | */
470 | - (void)mapView:(MTMapView*)mapView dragStartedOnMapPoint:(MTMapPoint*)mapPoint;
471 |
472 | /**
473 | * [Map View Event] 사용자가 지도 위 한 지점을 터치하여 드래그를 끝낼 경우 호출된다.
474 | * @param mapView MTMapView 객체
475 | * @param mapPoint 사용자의 드래그가 끝난 지도 좌표
476 | */
477 | - (void)mapView:(MTMapView*)mapView dragEndedOnMapPoint:(MTMapPoint*)mapPoint;
478 |
479 | /**
480 | * [Map View Event] 사용자가 지도 위 한 지점을 길게 누른 경우(long press) 호출된다.
481 | * @param mapView MTMapView 객체
482 | * @param mapPoint 사용자가 터치한 지도 좌표
483 | */
484 | - (void)mapView:(MTMapView*)mapView longPressOnMapPoint:(MTMapPoint*)mapPoint;
485 |
486 |
487 | // User Location Tracking delegate methods
488 |
489 | /**
490 | * [User Location Tracking] 단말의 현위치 좌표값을 통보받을 수 있다.
491 | * MTMapView 클래스의 currentLocationTrackingMode property를 통해서
492 | * 사용자 현위치 트래킹 기능이 켜진 경우(MTMapCurrentLocationTrackingOnWithoutHeading, MTMapCurrentLocationTrackingOnWithHeading)
493 | * 단말의 위치에 해당하는 지도 좌표와 위치 정확도가 주기적으로 delegate 객체에 통보된다.
494 | * @param mapView MTMapView 객체
495 | * @param location 사용자 단말의 현재 위치 좌표
496 | * @param accuracy 현위치 좌표의 오차 반경(정확도) (meter)
497 | */
498 | - (void)mapView:(MTMapView*)mapView updateCurrentLocation:(MTMapPoint*)location withAccuracy:(MTMapLocationAccuracy)accuracy;
499 |
500 | /**
501 | * [User Location Tracking] 현위치를 얻고자 할때 실패한 경우 통보받을 수 있다.
502 | * MTMapView 클래스의 currentLocationTrackingMode property를 통해서
503 | * 사용자 현위치 트래킹 기능이 켜고자 했을 경우(MTMapCurrentLocationTrackingOnWithoutHeading, MTMapCurrentLocationTrackingOnWithHeading)
504 | * 위치 사용 권한이나 기타 다른 이유로 인해 오류가 발생했을 때 발생한다.
505 | * @param mapView MTMapView 객체
506 | * @param error 오류가 발생한 정보를 담고 있는 객체
507 | */
508 | - (void)mapView:(MTMapView*)mapView failedUpdatingCurrentLocationWithError:(NSError *)error;
509 |
510 | /**
511 | * [User Location Tracking] 단말의 방향(Heading) 각도값을 통보받을 수 있다.
512 | * MTMapView 클래스의 currentLocationTrackingMode property를 통해서
513 | * 사용자 현위치 트래킹과 나침반 모드가 켜진 경우(MTMapCurrentLocationTrackingOnWithHeading)
514 | * 단말의 방향 각도값이 주기적으로 delegate 객체에 통보된다.
515 | * @param mapView MTMapView 객체
516 | * @param headingAngle 사용자 단말의 방향 각도 값(degree)
517 | */
518 | - (void)mapView:(MTMapView*)mapView updateDeviceHeading:(MTMapRotationAngle)headingAngle;
519 |
520 | // POI(Point Of Interest) Item delegate methods
521 |
522 | /**
523 | * [POI Item] 단말 사용자가 POI Item을 선택한 경우 호출된다.
524 | * 사용자가 MTMapView에 등록된 POI(Point Of Interest) Item 아이콘(마커)를 터치한 경우 호출된다.
525 | * MTMapViewDelegate protocol을 구현하는 delegate 객체의 구현의 리턴값(BOOL)에 따라
526 | * 해당 POI Item 선택 시, POI Item 마커 위에 말풍선(Callout Balloon)을 보여줄지 여부를 선택할 수 있다.
527 | * @param mapView MTMapView 객체
528 | * @param poiItem 선택된 POI Item 객체
529 | * @return POI Item 선택 시, 말풍선을 보여줄지 여부. YES:터치 시 말풍선이 나타남. NO:터치 시 말풍선이 나타나지 않음.
530 | * @see MTMapPOIItem
531 | */
532 | - (BOOL)mapView:(MTMapView*)mapView selectedPOIItem:(MTMapPOIItem*)poiItem;
533 |
534 | /**
535 | * [POI Item] 단말 사용자가 POI Item 아이콘(마커) 위에 나타난 말풍선(Callout Balloon)을 터치한 경우 호출된다.
536 | * @param mapView MTMapView 객체
537 | * @param poiItem 말풍선이 터치된 POI Item 객체
538 | * @see MTMapPOIItem
539 | */
540 | - (void)mapView:(MTMapView*)mapView touchedCalloutBalloonOfPOIItem:(MTMapPOIItem*)poiItem;
541 |
542 | /**
543 | * [POI Item] 단말 사용자가 POI Item 아이콘(마커) 위에 나타난 말풍선(Callout Balloon)의 왼쪽 영역을 터치한 경우 호출된다.
544 | * @param mapView MTMapView 객체
545 | * @param poiItem 말풍선이 터치된 POI Item 객체
546 | * @see MTMapPOIItem
547 | */
548 | - (void)mapView:(MTMapView*)mapView touchedCalloutBalloonLeftSideOfPOIItem:(MTMapPOIItem*)poiItem;
549 |
550 | /**
551 | * [POI Item] 단말 사용자가 POI Item 아이콘(마커) 위에 나타난 말풍선(Callout Balloon)의 오른쪽 영역을 터치한 경우 호출된다.
552 | * @param mapView MTMapView 객체
553 | * @param poiItem 말풍선이 터치된 POI Item 객체
554 | * @see MTMapPOIItem
555 | */
556 | - (void)mapView:(MTMapView*)mapView touchedCalloutBalloonRightSideOfPOIItem:(MTMapPOIItem*)poiItem;
557 |
558 | /**
559 | * [POI Item] 단말 사용자가 길게 누른후(long press) 끌어서(dragging) 위치 이동 가능한 POI Item의 위치를 이동시킨 경우 호출된다.
560 | * 이동가능한 POI Item을 Draggable POI Item이라 한다.
561 | * @param mapView MTMapView 객체
562 | * @param poiItem 새로운 위치로 이동된 Draggable POI Item 객체
563 | * @param newMapPoint 이동된 POI Item의 위치에 해당하는 지도 좌표
564 | * @see MTMapPOIItem
565 | */
566 | - (void)mapView:(MTMapView*)mapView draggablePOIItem:(MTMapPOIItem*)poiItem movedToNewMapPoint:(MTMapPoint*)newMapPoint;
567 | @end
--------------------------------------------------------------------------------
/ios/DaumMap.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/Info.plist
--------------------------------------------------------------------------------
/ios/DaumMap.framework/copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/copyright.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/daum_copyright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/daum_copyright.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/daum_th_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/daum_th_line.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/detail_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/detail_button.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/info_box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/info_box.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/info_box_tail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/info_box_tail.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin@3x.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin_custom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin_custom.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin_custom@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin_custom@3x.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin_red.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin_red@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin_red@3x.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin_shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin_shadow.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pin_shadow@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pin_shadow@3x.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pinup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pinup.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pinup@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pinup@3x.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pinup_custom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pinup_custom.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_pinup_custom@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_pinup_custom@3x.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_present.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_present.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_present_background_update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_present_background_update.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_present_direction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_present_direction.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/map_present_tracking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/map_present_tracking.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/noimage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/noimage.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/noimage256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/noimage256.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/point_sprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/point_sprite.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/shadow_balloon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/shadow_balloon.png
--------------------------------------------------------------------------------
/ios/DaumMap.framework/th_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asata/react-native-daummap/0b4c41914ed45d83c515a1dd541b0cbea73f54e1/ios/DaumMap.framework/th_line.png
--------------------------------------------------------------------------------
/ios/DaumMap.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | CB43FE8723E3E4F800844A4A /* DaumMap.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB43FE8623E3E4F800844A4A /* DaumMap.framework */; };
11 | CB51EB0A20B50D0900CEC4FC /* DaumMapManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CB51EB0720B50D0800CEC4FC /* DaumMapManager.m */; };
12 | CB51EB0B20B50D0900CEC4FC /* DaumMap.m in Sources */ = {isa = PBXBuildFile; fileRef = CB51EB0920B50D0900CEC4FC /* DaumMap.m */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | CBFBFCD920B50B8500C0C250 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/$(PRODUCT_NAME)";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | );
23 | runOnlyForDeploymentPostprocessing = 0;
24 | };
25 | /* End PBXCopyFilesBuildPhase section */
26 |
27 | /* Begin PBXFileReference section */
28 | CB43FE8623E3E4F800844A4A /* DaumMap.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = DaumMap.framework; sourceTree = ""; };
29 | CB51EB0620B50D0800CEC4FC /* DaumMapManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaumMapManager.h; sourceTree = ""; };
30 | CB51EB0720B50D0800CEC4FC /* DaumMapManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DaumMapManager.m; sourceTree = ""; };
31 | CB51EB0820B50D0800CEC4FC /* DaumMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DaumMap.h; sourceTree = ""; };
32 | CB51EB0920B50D0900CEC4FC /* DaumMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DaumMap.m; sourceTree = ""; };
33 | CBFBFCDB20B50B8500C0C250 /* libDaumMap.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDaumMap.a; sourceTree = BUILT_PRODUCTS_DIR; };
34 | /* End PBXFileReference section */
35 |
36 | /* Begin PBXFrameworksBuildPhase section */
37 | CBFBFCD820B50B8500C0C250 /* Frameworks */ = {
38 | isa = PBXFrameworksBuildPhase;
39 | buildActionMask = 2147483647;
40 | files = (
41 | CB43FE8723E3E4F800844A4A /* DaumMap.framework in Frameworks */,
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | CBFBFCD220B50B8500C0C250 = {
49 | isa = PBXGroup;
50 | children = (
51 | CB43FE8623E3E4F800844A4A /* DaumMap.framework */,
52 | CBFBFCDD20B50B8500C0C250 /* DaumMap */,
53 | CBFBFCDC20B50B8500C0C250 /* Products */,
54 | );
55 | sourceTree = "";
56 | };
57 | CBFBFCDC20B50B8500C0C250 /* Products */ = {
58 | isa = PBXGroup;
59 | children = (
60 | CBFBFCDB20B50B8500C0C250 /* libDaumMap.a */,
61 | );
62 | name = Products;
63 | sourceTree = "";
64 | };
65 | CBFBFCDD20B50B8500C0C250 /* DaumMap */ = {
66 | isa = PBXGroup;
67 | children = (
68 | CB51EB0820B50D0800CEC4FC /* DaumMap.h */,
69 | CB51EB0920B50D0900CEC4FC /* DaumMap.m */,
70 | CB51EB0620B50D0800CEC4FC /* DaumMapManager.h */,
71 | CB51EB0720B50D0800CEC4FC /* DaumMapManager.m */,
72 | );
73 | path = DaumMap;
74 | sourceTree = "";
75 | };
76 | /* End PBXGroup section */
77 |
78 | /* Begin PBXNativeTarget section */
79 | CBFBFCDA20B50B8500C0C250 /* DaumMap */ = {
80 | isa = PBXNativeTarget;
81 | buildConfigurationList = CBFBFCE420B50B8500C0C250 /* Build configuration list for PBXNativeTarget "DaumMap" */;
82 | buildPhases = (
83 | CBFBFCD720B50B8500C0C250 /* Sources */,
84 | CBFBFCD820B50B8500C0C250 /* Frameworks */,
85 | CBFBFCD920B50B8500C0C250 /* CopyFiles */,
86 | );
87 | buildRules = (
88 | );
89 | dependencies = (
90 | );
91 | name = DaumMap;
92 | productName = KakaoMap;
93 | productReference = CBFBFCDB20B50B8500C0C250 /* libDaumMap.a */;
94 | productType = "com.apple.product-type.library.static";
95 | };
96 | /* End PBXNativeTarget section */
97 |
98 | /* Begin PBXProject section */
99 | CBFBFCD320B50B8500C0C250 /* Project object */ = {
100 | isa = PBXProject;
101 | attributes = {
102 | LastUpgradeCheck = 0930;
103 | ORGANIZATIONNAME = "Jeonghun Kang";
104 | TargetAttributes = {
105 | CBFBFCDA20B50B8500C0C250 = {
106 | CreatedOnToolsVersion = 9.3;
107 | };
108 | };
109 | };
110 | buildConfigurationList = CBFBFCD620B50B8500C0C250 /* Build configuration list for PBXProject "DaumMap" */;
111 | compatibilityVersion = "Xcode 9.3";
112 | developmentRegion = en;
113 | hasScannedForEncodings = 0;
114 | knownRegions = (
115 | en,
116 | );
117 | mainGroup = CBFBFCD220B50B8500C0C250;
118 | productRefGroup = CBFBFCDC20B50B8500C0C250 /* Products */;
119 | projectDirPath = "";
120 | projectRoot = "";
121 | targets = (
122 | CBFBFCDA20B50B8500C0C250 /* DaumMap */,
123 | );
124 | };
125 | /* End PBXProject section */
126 |
127 | /* Begin PBXSourcesBuildPhase section */
128 | CBFBFCD720B50B8500C0C250 /* Sources */ = {
129 | isa = PBXSourcesBuildPhase;
130 | buildActionMask = 2147483647;
131 | files = (
132 | CB51EB0A20B50D0900CEC4FC /* DaumMapManager.m in Sources */,
133 | CB51EB0B20B50D0900CEC4FC /* DaumMap.m in Sources */,
134 | );
135 | runOnlyForDeploymentPostprocessing = 0;
136 | };
137 | /* End PBXSourcesBuildPhase section */
138 |
139 | /* Begin XCBuildConfiguration section */
140 | CBFBFCE220B50B8500C0C250 /* Debug */ = {
141 | isa = XCBuildConfiguration;
142 | buildSettings = {
143 | ALWAYS_SEARCH_USER_PATHS = NO;
144 | CLANG_ANALYZER_NONNULL = YES;
145 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
146 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
147 | CLANG_CXX_LIBRARY = "libc++";
148 | CLANG_ENABLE_MODULES = YES;
149 | CLANG_ENABLE_OBJC_ARC = YES;
150 | CLANG_ENABLE_OBJC_WEAK = YES;
151 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
152 | CLANG_WARN_BOOL_CONVERSION = YES;
153 | CLANG_WARN_COMMA = YES;
154 | CLANG_WARN_CONSTANT_CONVERSION = YES;
155 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
156 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
157 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
158 | CLANG_WARN_EMPTY_BODY = YES;
159 | CLANG_WARN_ENUM_CONVERSION = YES;
160 | CLANG_WARN_INFINITE_RECURSION = YES;
161 | CLANG_WARN_INT_CONVERSION = YES;
162 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
163 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
164 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
165 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
166 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
167 | CLANG_WARN_STRICT_PROTOTYPES = YES;
168 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
169 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
170 | CLANG_WARN_UNREACHABLE_CODE = YES;
171 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
172 | CODE_SIGN_IDENTITY = "iPhone Developer";
173 | COPY_PHASE_STRIP = NO;
174 | DEBUG_INFORMATION_FORMAT = dwarf;
175 | ENABLE_STRICT_OBJC_MSGSEND = YES;
176 | ENABLE_TESTABILITY = YES;
177 | GCC_C_LANGUAGE_STANDARD = gnu11;
178 | GCC_DYNAMIC_NO_PIC = NO;
179 | GCC_NO_COMMON_BLOCKS = YES;
180 | GCC_OPTIMIZATION_LEVEL = 0;
181 | GCC_PREPROCESSOR_DEFINITIONS = (
182 | "DEBUG=1",
183 | "$(inherited)",
184 | );
185 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
186 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
187 | GCC_WARN_UNDECLARED_SELECTOR = YES;
188 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
189 | GCC_WARN_UNUSED_FUNCTION = YES;
190 | GCC_WARN_UNUSED_VARIABLE = YES;
191 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
192 | MTL_ENABLE_DEBUG_INFO = YES;
193 | ONLY_ACTIVE_ARCH = YES;
194 | SDKROOT = iphoneos;
195 | };
196 | name = Debug;
197 | };
198 | CBFBFCE320B50B8500C0C250 /* Release */ = {
199 | isa = XCBuildConfiguration;
200 | buildSettings = {
201 | ALWAYS_SEARCH_USER_PATHS = NO;
202 | CLANG_ANALYZER_NONNULL = YES;
203 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
204 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
205 | CLANG_CXX_LIBRARY = "libc++";
206 | CLANG_ENABLE_MODULES = YES;
207 | CLANG_ENABLE_OBJC_ARC = YES;
208 | CLANG_ENABLE_OBJC_WEAK = YES;
209 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
210 | CLANG_WARN_BOOL_CONVERSION = YES;
211 | CLANG_WARN_COMMA = YES;
212 | CLANG_WARN_CONSTANT_CONVERSION = YES;
213 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
214 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
215 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
216 | CLANG_WARN_EMPTY_BODY = YES;
217 | CLANG_WARN_ENUM_CONVERSION = YES;
218 | CLANG_WARN_INFINITE_RECURSION = YES;
219 | CLANG_WARN_INT_CONVERSION = YES;
220 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
221 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
222 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
223 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
224 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
225 | CLANG_WARN_STRICT_PROTOTYPES = YES;
226 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
227 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
228 | CLANG_WARN_UNREACHABLE_CODE = YES;
229 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
230 | CODE_SIGN_IDENTITY = "iPhone Developer";
231 | COPY_PHASE_STRIP = NO;
232 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
233 | ENABLE_NS_ASSERTIONS = NO;
234 | ENABLE_STRICT_OBJC_MSGSEND = YES;
235 | GCC_C_LANGUAGE_STANDARD = gnu11;
236 | GCC_NO_COMMON_BLOCKS = YES;
237 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
238 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
239 | GCC_WARN_UNDECLARED_SELECTOR = YES;
240 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
241 | GCC_WARN_UNUSED_FUNCTION = YES;
242 | GCC_WARN_UNUSED_VARIABLE = YES;
243 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
244 | MTL_ENABLE_DEBUG_INFO = NO;
245 | SDKROOT = iphoneos;
246 | VALIDATE_PRODUCT = YES;
247 | };
248 | name = Release;
249 | };
250 | CBFBFCE520B50B8500C0C250 /* Debug */ = {
251 | isa = XCBuildConfiguration;
252 | buildSettings = {
253 | CLANG_ENABLE_OBJC_ARC = NO;
254 | CODE_SIGN_STYLE = Automatic;
255 | ENABLE_BITCODE = NO;
256 | FRAMEWORK_SEARCH_PATHS = (
257 | "$(inherited)",
258 | "$(PROJECT_DIR)/../../../ios/**/**",
259 | "$(PROJECT_DIR)",
260 | );
261 | HEADER_SEARCH_PATHS = (
262 | "$(SRCROOT)/../../../ios/Pods/Headers/Public/**",
263 | "$(SRCROOT)/../../../ios/Pods/Headers/Public/React-Core/**",
264 | );
265 | OTHER_LDFLAGS = "-ObjC";
266 | PRODUCT_NAME = "$(TARGET_NAME)";
267 | SKIP_INSTALL = YES;
268 | TARGETED_DEVICE_FAMILY = "1,2";
269 | };
270 | name = Debug;
271 | };
272 | CBFBFCE620B50B8500C0C250 /* Release */ = {
273 | isa = XCBuildConfiguration;
274 | buildSettings = {
275 | CLANG_ENABLE_OBJC_ARC = NO;
276 | CODE_SIGN_STYLE = Automatic;
277 | ENABLE_BITCODE = NO;
278 | FRAMEWORK_SEARCH_PATHS = (
279 | "$(inherited)",
280 | "$(PROJECT_DIR)/../../../ios/**/**",
281 | "$(PROJECT_DIR)",
282 | );
283 | HEADER_SEARCH_PATHS = (
284 | "$(SRCROOT)/../../../ios/Pods/Headers/Public/**",
285 | "$(SRCROOT)/../../../ios/Pods/Headers/Public/React-Core/**",
286 | );
287 | OTHER_LDFLAGS = "-ObjC";
288 | PRODUCT_NAME = "$(TARGET_NAME)";
289 | SKIP_INSTALL = YES;
290 | TARGETED_DEVICE_FAMILY = "1,2";
291 | };
292 | name = Release;
293 | };
294 | /* End XCBuildConfiguration section */
295 |
296 | /* Begin XCConfigurationList section */
297 | CBFBFCD620B50B8500C0C250 /* Build configuration list for PBXProject "DaumMap" */ = {
298 | isa = XCConfigurationList;
299 | buildConfigurations = (
300 | CBFBFCE220B50B8500C0C250 /* Debug */,
301 | CBFBFCE320B50B8500C0C250 /* Release */,
302 | );
303 | defaultConfigurationIsVisible = 0;
304 | defaultConfigurationName = Release;
305 | };
306 | CBFBFCE420B50B8500C0C250 /* Build configuration list for PBXNativeTarget "DaumMap" */ = {
307 | isa = XCConfigurationList;
308 | buildConfigurations = (
309 | CBFBFCE520B50B8500C0C250 /* Debug */,
310 | CBFBFCE620B50B8500C0C250 /* Release */,
311 | );
312 | defaultConfigurationIsVisible = 0;
313 | defaultConfigurationName = Release;
314 | };
315 | /* End XCConfigurationList section */
316 | };
317 | rootObject = CBFBFCD320B50B8500C0C250 /* Project object */;
318 | }
319 |
--------------------------------------------------------------------------------
/ios/DaumMap/DaumMap.h:
--------------------------------------------------------------------------------
1 | // import UIKit so you can subclass off UIView
2 | #import
3 |
4 | // import RCTBridge
5 | #if __has_include()
6 | #import
7 | #import
8 | #import
9 | #elif __has_include("RCTBridge.h")
10 | #import "RCTBridge.h"
11 | #import "UIView+React.h"
12 | #import "RCTEventDispatcher.h"
13 | #else
14 | #import "React/RCTBridge.h" // Required when used as a Pod in a Swift project
15 | #import "React/UIView+React.h"
16 | #import "React/RCTEventDispatcher.h"
17 | #endif
18 |
19 | @class RCTEventDispatcher;
20 |
21 | @interface DaumMap : UIView
22 | // Define view properties here with @property
23 | @property (nonatomic, assign) NSMutableDictionary *initialRegion;
24 | @property (nonatomic, copy) RCTDirectEventBlock onMarkerSelect;
25 | @property (nonatomic, copy) RCTDirectEventBlock onMarkerPress;
26 | @property (nonatomic, copy) RCTDirectEventBlock onMarkerMoved;
27 | @property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
28 | @property (nonatomic, copy) RCTDirectEventBlock onUpdateCurrentLocation;
29 | @property (nonatomic, copy) RCTDirectEventBlock onUpdateCurrentHeading;
30 |
31 |
32 | @property (nonatomic, assign) float latdouble;
33 | @property (nonatomic, assign) float londouble;
34 | @property (nonatomic, assign) NSInteger zoomLevel;
35 | @property (nonatomic, assign) NSInteger tagIDX;
36 |
37 | @property (nonatomic, assign) BOOL isTracking;
38 | @property (nonatomic, assign) BOOL isCompass;
39 | @property (nonatomic, assign) BOOL isCurrentMarker;
40 |
41 | // Initializing with the event dispatcher allows us to communicate with JS
42 | - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/ios/DaumMap/DaumMap.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import "DaumMap.h"
3 | #import
4 | #import
5 | #import
6 |
7 | // import RCTEventDispatcher
8 | #if __has_include()
9 | #import
10 | #elif __has_include("RCTEventDispatcher.h")
11 | #import "RCTEventDispatcher.h"
12 | #else
13 | #import "React/RCTEventDispatcher.h" // Required when used as a Pod in a Swift project
14 | #endif
15 |
16 | @implementation DaumMap : UIView {
17 | RCTEventDispatcher *_eventDispatcher;
18 | MTMapView *_mapView;
19 | }
20 |
21 | - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher {
22 | if ((self = [super init])) {
23 | _eventDispatcher = eventDispatcher;
24 |
25 | _mapView = [[MTMapView alloc] initWithFrame:CGRectMake(self.bounds.origin.x,
26 | self.bounds.origin.y,
27 | self.bounds.size.width,
28 | self.bounds.size.height)];
29 | _mapView.delegate = self;
30 | _mapView.baseMapType = MTMapTypeHybrid;
31 |
32 | _latdouble = 36.143099;
33 | _londouble = 128.392905;
34 | _zoomLevel = 2;
35 | _tagIDX = 0;
36 |
37 | _isTracking = false;
38 | _isCompass = false;
39 | }
40 |
41 | return self;
42 | }
43 |
44 | - (void) layoutSubviews {
45 | [super layoutSubviews];
46 | _mapView.frame = self.bounds;
47 | [self addSubview:_mapView];
48 | }
49 |
50 | - (void) setInitialRegion:(NSDictionary *)region {
51 | if ([region valueForKey:@"latitude"] != [NSNull null]) {
52 | _latdouble = [[region valueForKey:@"latitude"] floatValue];
53 | }
54 | if ([region valueForKey:@"longitude"] != [NSNull null]) {
55 | _londouble = [[region valueForKey:@"longitude"] floatValue];
56 | }
57 | if ([region valueForKey:@"zoomLevel"] != [NSNull null]) {
58 | _zoomLevel = [[region valueForKey:@"zoomLevel"] intValue];
59 | }
60 | }
61 |
62 | - (void) setMarkers:(NSArray *)markers {
63 | NSArray *markerList = [NSArray arrayWithObjects: NULL];
64 |
65 | for (int i = 0; i < [markers count]; i++) {
66 | NSDictionary *dict = [markers objectAtIndex:i];
67 | NSString *itemName = [dict valueForKey:@"title"];
68 | NSString *pinColor = [[dict valueForKey:@"pinColor"] lowercaseString];
69 | NSString *selectPinColor = [[dict valueForKey:@"pinColorSelect"] lowercaseString];
70 | MTMapPOIItemMarkerType markerType = MTMapPOIItemMarkerTypeBluePin;
71 | if ([pinColor isEqualToString:@"red"]) {
72 | markerType = MTMapPOIItemMarkerTypeRedPin;
73 | } else if ([pinColor isEqualToString:@"yellow"]) {
74 | markerType = MTMapPOIItemMarkerTypeYellowPin;
75 | } else if ([pinColor isEqualToString:@"blue"]) {
76 | markerType = MTMapPOIItemMarkerTypeBluePin;
77 | } else if ([pinColor isEqualToString:@"image"]) {
78 | markerType = MTMapPOIItemMarkerTypeCustomImage;
79 | }
80 |
81 | MTMapPOIItemMarkerSelectedType sMarkerType = MTMapPOIItemMarkerSelectedTypeRedPin;
82 | if ([selectPinColor isEqualToString:@"red"]) {
83 | sMarkerType = MTMapPOIItemMarkerSelectedTypeRedPin;
84 | } else if ([selectPinColor isEqualToString:@"yellow"]) {
85 | sMarkerType = MTMapPOIItemMarkerSelectedTypeYellowPin;
86 | } else if ([selectPinColor isEqualToString:@"blue"]) {
87 | sMarkerType = MTMapPOIItemMarkerSelectedTypeBluePin;
88 | } else if ([pinColor isEqualToString:@"image"]) {
89 | sMarkerType = MTMapPOIItemMarkerSelectedTypeCustomImage;
90 | } else if ([selectPinColor isEqualToString:@"none"]) {
91 | sMarkerType = MTMapPOIItemMarkerSelectedTypeNone;
92 | }
93 |
94 | MTMapPOIItem* markerItem = [MTMapPOIItem poiItem];
95 | if (itemName != NULL) markerItem.itemName = itemName;
96 | float latdouble = [[dict valueForKey:@"latitude"] floatValue];
97 | float londouble = [[dict valueForKey:@"longitude"] floatValue];
98 |
99 | markerItem.mapPoint = [MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake(latdouble, londouble)];
100 | markerItem.markerType = markerType;
101 | if (markerType == MTMapPOIItemMarkerTypeCustomImage) {
102 | markerItem.customImageName = [dict valueForKey:@"markerImage"];
103 | }
104 | markerItem.markerSelectedType = sMarkerType;
105 | if (sMarkerType == MTMapPOIItemMarkerSelectedTypeCustomImage) {
106 | markerItem.customSelectedImageName = [dict valueForKey:@"markerImageSelect"];
107 | }
108 | markerItem.showAnimationType = MTMapPOIItemShowAnimationTypeSpringFromGround; // Item이 화면에 추가될때 애니매이션
109 | bool draggable = [dict valueForKey:@"draggable"];
110 | markerItem.draggable = draggable;
111 | markerItem.tag = i;
112 | markerItem.showDisclosureButtonOnCalloutBalloon = NO;
113 |
114 | markerList = [markerList arrayByAddingObject: markerItem];
115 | }
116 |
117 | [_mapView addPOIItems:markerList];
118 | }
119 |
120 | - (void) setMapType:(NSString *)mapType {
121 | mapType = [mapType lowercaseString];
122 | if ([mapType isEqualToString:@"standard"]) {
123 | _mapView.baseMapType = MTMapTypeStandard;
124 | } else if ([mapType isEqualToString:@"satellite"]) {
125 | _mapView.baseMapType = MTMapTypeSatellite;
126 | } else if ([mapType isEqualToString:@"hybrid"]) {
127 | _mapView.baseMapType = MTMapTypeHybrid;
128 | } else {
129 | _mapView.baseMapType = MTMapTypeStandard;
130 | }
131 | }
132 |
133 | - (void) setRegion:(NSDictionary *)region {
134 | if ([region valueForKey:@"latitude"] != [NSNull null] && [region valueForKey:@"longitude"] != [NSNull null]) {
135 | float latdouble = [[region valueForKey:@"latitude"] floatValue];
136 | float londouble = [[region valueForKey:@"longitude"] floatValue];
137 |
138 | [_mapView setMapCenterPoint:[MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake(latdouble, londouble)] animated:YES];
139 | }
140 | }
141 |
142 | - (void) setIsCurrentMarker: (BOOL)isCurrentMarker {
143 | [_mapView setShowCurrentLocationMarker:isCurrentMarker];
144 | }
145 |
146 | - (void) setIsTracking:(BOOL)isTracking {
147 | _isTracking = isTracking;
148 | [self setMapTracking];
149 | }
150 |
151 | - (void) setIsCompass:(BOOL)isCompass {
152 | _isCompass = isCompass;
153 | [self setMapTracking];
154 | }
155 |
156 | - (void) setPolyLines:(NSDictionary *) polyLines {
157 | [_mapView removeAllPolylines];
158 |
159 | if ([polyLines valueForKey:@"points"] != [NSNull null]) {
160 | MTMapPolyline *polyline1 = [MTMapPolyline polyLine];
161 |
162 | NSString *polyLineColor = [[polyLines valueForKey:@"color"] lowercaseString];
163 | NSArray *polyLineArray = [polyLines valueForKey:@"points"];
164 | NSInteger tagIdx = 0;
165 | if ([polyLines valueForKey:@"tag"] != [NSNull null] && [polyLines valueForKey:@"tag"] > 0) {
166 | tagIdx = [[polyLines valueForKey:@"tag"] intValue];
167 | } else {
168 | tagIdx = _tagIDX++;
169 | }
170 | polyline1.tag= tagIdx;
171 |
172 | for (int i = 0; i < [polyLineArray count]; i++) {
173 | NSDictionary *dict = [polyLineArray objectAtIndex:i];
174 | float latdouble = [[dict valueForKey:@"latitude"] floatValue];
175 | float londouble = [[dict valueForKey:@"longitude"] floatValue];
176 | [polyline1 addPoint:[MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake(latdouble, londouble)]];
177 | }
178 |
179 | UIColor *color = [self getColor:polyLineColor];
180 |
181 | polyline1.polylineColor = color;
182 | [_mapView addPolyline:polyline1];
183 | }
184 | }
185 |
186 | - (void) setCircles: (NSArray *) circles {
187 | [_mapView removeAllCircles];
188 |
189 | for (int i = 0; i < [circles count]; i++) {
190 | NSDictionary *dict = [circles objectAtIndex:i];
191 | float latdouble = [[dict valueForKey:@"latitude"] floatValue];
192 | float londouble = [[dict valueForKey:@"longitude"] floatValue];
193 | NSString *lineColorStr = [[dict valueForKey:@"lineColor"] lowercaseString];
194 | NSString *fillColorStr = [[dict valueForKey:@"fillColor"] lowercaseString];
195 | NSInteger radius = 50;
196 | NSInteger lineWidth = 10;
197 | NSInteger tagIdx = 0;
198 |
199 | if ([dict valueForKey:@"lineWidth"] != [NSNull null] && [dict valueForKey:@"lineWidth"] > 0) {
200 | lineWidth = [[dict valueForKey:@"lineWidth"] intValue];
201 | }
202 | if ([dict valueForKey:@"radius"] != [NSNull null] && [dict valueForKey:@"radius"] > 0) {
203 | radius = [[dict valueForKey:@"radius"] intValue];
204 | }
205 | if ([dict valueForKey:@"tag"] != [NSNull null] && [dict valueForKey:@"tag"] > 0) {
206 | tagIdx = [[dict valueForKey:@"tag"] intValue];
207 | } else {
208 | tagIdx = _tagIDX++;
209 | }
210 |
211 | UIColor *lineColor = [self getColor:lineColorStr];
212 | UIColor *fillColor = [self getColor:fillColorStr];
213 |
214 | MTMapCircle *circle1 = [MTMapCircle circle];
215 | circle1.circleCenterPoint = [MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake(latdouble, londouble)];
216 | circle1.circleLineColor = lineColor;
217 | circle1.circleFillColor = fillColor;
218 | circle1.circleLineWidth = lineWidth;
219 | circle1.circleRadius = radius;
220 | circle1.tag = tagIdx;
221 |
222 | [_mapView addCircle:circle1];
223 | }
224 | }
225 |
226 | - (UIColor *) getColor: (NSString *) colorStr {
227 | if ([colorStr isEqualToString:@"red"]) {
228 | return [UIColor redColor];
229 | } else if ([colorStr isEqualToString:@"blue"]) {
230 | return [UIColor blueColor];
231 | } else if ([colorStr isEqualToString:@"yellow"]) {
232 | return [UIColor yellowColor];
233 | } else if ([colorStr isEqualToString:@"black"]) {
234 | return [UIColor blackColor];
235 | } else if ([colorStr isEqualToString:@"green"]) {
236 | return [UIColor greenColor];
237 | } else if ([colorStr isEqualToString:@"green"]) {
238 | return [UIColor greenColor];
239 | } else if ([colorStr isEqualToString:@"white"]) {
240 | return [UIColor whiteColor];
241 | } else {
242 | return [UIColor whiteColor];
243 | }
244 | }
245 |
246 | - (MTMapCurrentLocationTrackingMode) getTrackingMode {
247 | // 트래킹 X, 나침반 X, 지도이동 X : MTMapCurrentLocationTrackingOff
248 | // 트래킹 O, 나침반 X, 지도이동 O : MTMapCurrentLocationTrackingOnWithoutHeading
249 | // 트래킹 O, 나침반 O, 지도이동 O : MTMapCurrentLocationTrackingOnWithHeading
250 | // 트래킹 O, 나침반 X, 지도이동 X : MTMapCurrentLocationTrackingOnWithoutHeadingWithoutMapMoving
251 | // 트래킹 O, 나침반 O, 지도이동 X : MTMapCurrentLocationTrackingOnWithHeadingWithoutMapMoving
252 |
253 | return [_mapView currentLocationTrackingMode];
254 | }
255 |
256 | - (void) setMapTracking {
257 | MTMapCurrentLocationTrackingMode trackingModeValue = MTMapCurrentLocationTrackingOff;
258 | if (_isTracking && _isCompass) {
259 | trackingModeValue = MTMapCurrentLocationTrackingOnWithHeading;
260 | } else if (_isTracking && !_isCompass) {
261 | trackingModeValue = MTMapCurrentLocationTrackingOnWithoutHeading;
262 | } else {
263 | trackingModeValue = MTMapCurrentLocationTrackingOff;
264 | }
265 |
266 | [_mapView setCurrentLocationTrackingMode:trackingModeValue];
267 | }
268 |
269 | /****************************************************************/
270 | // 이벤트 처리 시작
271 | /****************************************************************/
272 | // APP KEY 인증 서버에 인증한 결과를 통보받을 수 있다.
273 | - (void)mapView:(MTMapView*)mapView openAPIKeyAuthenticationResultCode:(int)resultCode resultMessage:(NSString*)resultMessage {
274 | [_mapView setMapCenterPoint:[MTMapPoint mapPointWithGeoCoord:MTMapPointGeoMake(_latdouble, _londouble)] zoomLevel:(int)_zoomLevel animated:YES];
275 | }
276 |
277 | // 단말의 현위치 좌표값
278 | - (void)mapView:(MTMapView*)mapView updateCurrentLocation:(MTMapPoint*)location withAccuracy:(MTMapLocationAccuracy)accuracy {
279 | id event = @{
280 | @"action": @"updateCurrentLocation",
281 | @"accuracyInMeters": @(accuracy),
282 | @"coordinate": @{
283 | @"latitude": @([location mapPointGeo].latitude),
284 | @"longitude": @([location mapPointGeo].longitude)
285 | }
286 | };
287 | if (self.onUpdateCurrentLocation) self.onUpdateCurrentLocation(event);
288 | }
289 |
290 | - (void)mapView:(MTMapView*)mapView updateDeviceHeading:(MTMapRotationAngle)headingAngle {
291 | id event = @{
292 | @"action": @"currentHeading",
293 | @"headingAngle": @(headingAngle),
294 | };
295 | if (self.onUpdateCurrentHeading) self.onUpdateCurrentHeading(event);
296 | }
297 |
298 | // 단말 사용자가 POI Item을 선택한 경우
299 | - (BOOL)mapView:(MTMapView*)mapView selectedPOIItem:(MTMapPOIItem*)poiItem {
300 | id event = @{
301 | @"action": @"markerSelect",
302 | @"id": @(poiItem.tag),
303 | @"coordinate": @{
304 | @"latitude": @(poiItem.mapPoint.mapPointGeo.latitude),
305 | @"longitude": @(poiItem.mapPoint.mapPointGeo.longitude)
306 | }
307 | };
308 | if (self.onMarkerSelect) self.onMarkerSelect(event);
309 |
310 | return YES;
311 | }
312 |
313 | // 단말 사용자가 POI Item 아이콘(마커) 위에 나타난 말풍선(Callout Balloon)을 터치한 경우
314 | - (void)mapView:(MTMapView *)mapView touchedCalloutBalloonOfPOIItem:(MTMapPOIItem *)poiItem {
315 | id event = @{
316 | @"action": @"markerPress",
317 | @"id": @(poiItem.tag),
318 | @"coordinate": @{
319 | @"latitude": @(poiItem.mapPoint.mapPointGeo.latitude),
320 | @"longitude": @(poiItem.mapPoint.mapPointGeo.longitude)
321 | }
322 | };
323 | if (self.onMarkerPress) self.onMarkerPress(event);
324 | }
325 |
326 | // 단말 사용자가 길게 누른후(long press) 끌어서(dragging) 위치 이동 가능한 POI Item의 위치를 이동시킨 경우
327 | - (void)mapView:(MTMapView*)mapView draggablePOIItem:(MTMapPOIItem*)poiItem movedToNewMapPoint:(MTMapPoint*)newMapPoint {
328 | id event = @{
329 | @"action": @"markerMoved",
330 | @"id": @(poiItem.tag),
331 | @"coordinate": @{
332 | @"latitude": @(newMapPoint.mapPointGeo.latitude),
333 | @"longitude": @(newMapPoint.mapPointGeo.longitude)
334 | }
335 | };
336 | if (self.onMarkerMoved) self.onMarkerMoved(event);
337 | }
338 |
339 | // 지도 중심 좌표가 이동한 경우
340 | - (void)mapView:(MTMapView*)mapView centerPointMovedTo:(MTMapPoint*)mapCenterPoint {
341 | id event = @{
342 | @"action": @"regionChange",
343 | @"coordinate": @{
344 | @"latitude": @(mapCenterPoint.mapPointGeo.latitude),
345 | @"longitude": @(mapCenterPoint.mapPointGeo.longitude)
346 | }
347 | };
348 | if (self.onRegionChange) self.onRegionChange(event);
349 | }
350 | @end
351 |
--------------------------------------------------------------------------------
/ios/DaumMap/DaumMapManager.h:
--------------------------------------------------------------------------------
1 | // import RCTViewManager
2 | #if __has_include()
3 | #import
4 | #elif __has_include("RCTViewManager.h")
5 | #import "RCTViewManager.h"
6 | #else
7 | #import "React/RCTViewManager.h" // Required when used as a Pod in a Swift project
8 | #endif
9 |
10 | #import
11 |
12 | @interface DaumMapManager : RCTViewManager
13 | @property(nonatomic,strong)DaumMap *map;
14 | @end
15 |
--------------------------------------------------------------------------------
/ios/DaumMap/DaumMapManager.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import "DaumMap.h"
3 | #import "DaumMapManager.h"
4 |
5 | @implementation DaumMapManager
6 |
7 | @synthesize bridge = _bridge;
8 |
9 | // Export a native module
10 | // https://facebook.github.io/react-native/docs/native-modules-ios.html
11 | RCT_EXPORT_MODULE();
12 | // Return the native view that represents your React component
13 | - (UIView *) view {
14 | _map = [[DaumMap alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
15 | return _map;
16 | }
17 |
18 | RCT_EXPORT_VIEW_PROPERTY(initialRegion, NSDictionary)
19 | RCT_EXPORT_VIEW_PROPERTY(mapType, NSString)
20 | RCT_EXPORT_VIEW_PROPERTY(markers, NSArray)
21 | RCT_EXPORT_VIEW_PROPERTY(isTracking, BOOL)
22 | RCT_EXPORT_VIEW_PROPERTY(isCompass, BOOL)
23 | RCT_EXPORT_VIEW_PROPERTY(isCurrentMarker, BOOL)
24 | RCT_EXPORT_VIEW_PROPERTY(region, NSDictionary)
25 | RCT_EXPORT_VIEW_PROPERTY(polyLines, NSDictionary)
26 | RCT_EXPORT_VIEW_PROPERTY(circles, NSArray)
27 | RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
28 | RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
29 | RCT_EXPORT_VIEW_PROPERTY(onMarkerMoved, RCTDirectEventBlock)
30 | RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
31 | RCT_EXPORT_VIEW_PROPERTY(onUpdateCurrentLocation, RCTDirectEventBlock)
32 | RCT_EXPORT_VIEW_PROPERTY(onUpdateCurrentHeading, RCTDirectEventBlock)
33 |
34 | // 임시 디렉토리에 저장된 지도 타일 캐쉬 데이터를 모두 삭제
35 | RCT_EXPORT_METHOD(clearMapCache:(nonnull NSNumber *)reactTag) {
36 | [MTMapView clearMapTilePersistentCache];
37 | }
38 | @end
39 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-daummap",
3 | "version": "0.2.9",
4 | "description": "react-native use daum map",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/asata/react-native-daummap.git"
12 | },
13 | "keywords": [
14 | "map",
15 | "daum",
16 | "kakao",
17 | "react-naive",
18 | "daum map"
19 | ],
20 | "author": "JeongHun Kang ",
21 | "license": "MIT",
22 | "bugs": {
23 | "url": "https://github.com/asata/react-native-daummap/issues"
24 | },
25 | "homepage": "https://github.com/asata/react-native-daummap#readme"
26 | }
27 |
--------------------------------------------------------------------------------
/react-native.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | dependency: {
3 | platforms: {
4 | ios: {
5 | sharedLibraries: [
6 | "SystemConfiguration",
7 | "CoreLocation",
8 | "OpenGLES",
9 | "QuartzCore",
10 | "libc++",
11 | "libxml2",
12 | "libsqlite3"
13 | ]
14 | },
15 | android: {},
16 | }
17 | },
18 | };
--------------------------------------------------------------------------------