Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AN] feat: 네이버 맵을 화면에 띄우는 기능 구현 #23

Merged
merged 5 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea
.idea
.DS_Store
/build
/captures
Expand Down
3 changes: 0 additions & 3 deletions android/.idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion android/.idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions android/.idea/compiler.xml

This file was deleted.

21 changes: 0 additions & 21 deletions android/.idea/gradle.xml

This file was deleted.

10 changes: 0 additions & 10 deletions android/.idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions android/.idea/vcs.xml

This file was deleted.

4 changes: 4 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ dependencies {

// domain
implementation project(":domain")

// 네이버 지도 SDK
implementation("com.naver.maps:map-sdk:3.12.0")
api 'com.google.android.gms:play-services-location:15.0.1'
}
5 changes: 4 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
android:supportsRtl="true"
android:theme="@style/Theme.Naaga"
tools:targetApi="33">
<meta-data
android:name="com.naver.maps.map.CLIENT_ID"
android:value="hl7nqvg6bj" />
<activity
android:name=".presentation.MainActivity"
android:name=".presentation.onadventure.OnAdventureActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.now.naaga.presentation.onadventure

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.naver.maps.geometry.LatLng
import com.naver.maps.map.CameraPosition
import com.naver.maps.map.MapFragment
import com.naver.maps.map.NaverMap
import com.naver.maps.map.OnMapReadyCallback
import com.now.naaga.R

class OnAdventureActivity : AppCompatActivity(), OnMapReadyCallback {
private lateinit var mapView: MapFragment
private lateinit var naverMap: NaverMap

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_on_adventure)

setMapView()
}

private fun setMapView() {
val fragmentManager = supportFragmentManager
val mapFragment = fragmentManager.findFragmentById(R.id.fcv_main_map) as MapFragment
mapFragment.getMapAsync(this)
mapView = mapFragment
}

override fun onMapReady(naverMap: NaverMap) {
this.naverMap = naverMap
setCameraPosition()
}

private fun setCameraPosition() {
val cameraPosition = CameraPosition(
TEMP_CAMERA_POSITION,
ZOOM_LEVEL,
)
naverMap.cameraPosition = cameraPosition
}

companion object {
private val TEMP_CAMERA_POSITION = LatLng(37.515304, 127.103078)
private const val ZOOM_LEVEL = 16.0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.MainActivity">
tools:context=".presentation.onadventure.OnAdventureActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fcv_main_map"
android:name="com.naver.maps.map.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
3 changes: 2 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.enableJetifier=true
3 changes: 3 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url 'https://naver.jfrog.io/artifactory/maven/'
}
}
}
rootProject.name = "Naaga"
Expand Down