Skip to content

TMap navigation API

최철웅 edited this page Jun 14, 2023 · 1 revision

TMap navigation API

본 페이지에서는 TMap Navigation API를 어떻게 활용했는지에 대해 기술한다.


Pic AR에는 사용자가 포토존으로 원할하게 이동할 수 있게 안내 객체를 AR로 생성하여 제공한다.
이때 도보 경로 안내에 대한 정보(객체)는 T맵 API를 통해서 얻어온 뒤 이를 객체로 변한하여 활용한다.

image

위처럼 T맵 API를 통해 안내 지점 및 관련 정보를 얻을 수 있다.

이 정보들을 기반으로 앵커를 생성할 예정이다.
먼저 아래와 같이 Database에 저장한다.

image

이후 해당 정보들을 불러와서 앵커로 생성한다.

if(ds.exists()) {
                        List<Double> latitudes = (List<Double>) ds.get("latitudes");
                        List<Double> longitudes = (List<Double>) ds.get("longitudes");
                        for(int i=0; i<latitudes.size(); i++) {
                            createAnchor(earth, latitudes.get(i), longitudes.get(i), 56, 100);
                            storeAnchorParameters(latitudes.get(i), longitudes.get(i), 56, 100);
                        }
                        distinguisher = latitudes.size();
                        CONCURRENT_PREVENT_FLAG = true;
                        // 안내 객체 추가 완료,

                        likesCoordsRef.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
                            @Override
                            public void onComplete(@NonNull Task<QuerySnapshot> task) {
                                if(task.isSuccessful()) {
                                    for (QueryDocumentSnapshot results : task.getResult()) {
                                        createAnchor(earth, (Double)results.get("latitude"), (Double)results.get("longitude"),
                                                56, 100);
                                    }
                                }
                            }
                        }

Home

Introduction

APIs

Structure

Demo

Clone this wiki locally