From ed289cab377559be5b93afec0b308892b7039e75 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E152GOJ\\aaa" Date: Sat, 30 Mar 2024 17:10:57 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[add]=20Marker=20Icon=20=EB=A6=AC=EC=86=8C?= =?UTF-8?q?=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 2093475c6f97a2b4c69cd7de2d0beb7e7391ca24) --- .../src/main/res/drawable/ic_event.xml | 27 ++++++++++++ .../main/res/drawable/ic_event_selected.xml | 39 ++++++++++++++++++ .../src/main/res/drawable/ic_food.xml | 27 ++++++++++++ .../main/res/drawable/ic_food_selected.xml | 32 +++++++++++++++ .../src/main/res/drawable/ic_general.xml | 32 +++++++++++++++ .../main/res/drawable/ic_general_selected.xml | 29 +++++++++++++ .../src/main/res/drawable/ic_medical.xml | 17 ++++++++ .../main/res/drawable/ic_medical_selected.xml | 29 +++++++++++++ .../src/main/res/drawable/ic_pub.xml | 29 +++++++++++++ .../src/main/res/drawable/ic_pub_selected.xml | 41 +++++++++++++++++++ .../src/main/res/drawable/ic_restroom.xml | 19 +++++++++ .../res/drawable/ic_restroom_selected.xml | 31 ++++++++++++++ 12 files changed, 352 insertions(+) create mode 100644 core/designsystem/src/main/res/drawable/ic_event.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_event_selected.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_food.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_food_selected.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_general.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_general_selected.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_medical.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_medical_selected.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_pub.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_pub_selected.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_restroom.xml create mode 100644 core/designsystem/src/main/res/drawable/ic_restroom_selected.xml diff --git a/core/designsystem/src/main/res/drawable/ic_event.xml b/core/designsystem/src/main/res/drawable/ic_event.xml new file mode 100644 index 00000000..e20e22b8 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_event.xml @@ -0,0 +1,27 @@ + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_event_selected.xml b/core/designsystem/src/main/res/drawable/ic_event_selected.xml new file mode 100644 index 00000000..d50840f0 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_event_selected.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_food.xml b/core/designsystem/src/main/res/drawable/ic_food.xml new file mode 100644 index 00000000..35a772e4 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_food.xml @@ -0,0 +1,27 @@ + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_food_selected.xml b/core/designsystem/src/main/res/drawable/ic_food_selected.xml new file mode 100644 index 00000000..008f2bbd --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_food_selected.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_general.xml b/core/designsystem/src/main/res/drawable/ic_general.xml new file mode 100644 index 00000000..c374f832 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_general.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_general_selected.xml b/core/designsystem/src/main/res/drawable/ic_general_selected.xml new file mode 100644 index 00000000..a92f9136 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_general_selected.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_medical.xml b/core/designsystem/src/main/res/drawable/ic_medical.xml new file mode 100644 index 00000000..662a18b4 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_medical.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_medical_selected.xml b/core/designsystem/src/main/res/drawable/ic_medical_selected.xml new file mode 100644 index 00000000..fe7fd931 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_medical_selected.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_pub.xml b/core/designsystem/src/main/res/drawable/ic_pub.xml new file mode 100644 index 00000000..88879f52 --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_pub.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_pub_selected.xml b/core/designsystem/src/main/res/drawable/ic_pub_selected.xml new file mode 100644 index 00000000..6781f30e --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_pub_selected.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_restroom.xml b/core/designsystem/src/main/res/drawable/ic_restroom.xml new file mode 100644 index 00000000..bcb5695f --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_restroom.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/core/designsystem/src/main/res/drawable/ic_restroom_selected.xml b/core/designsystem/src/main/res/drawable/ic_restroom_selected.xml new file mode 100644 index 00000000..30d992eb --- /dev/null +++ b/core/designsystem/src/main/res/drawable/ic_restroom_selected.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + From 6a4892ffc2c745609ce109ea323cea229b9546b7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E152GOJ\\aaa" Date: Sat, 30 Mar 2024 18:43:42 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[setting]=20=EB=84=A4=EC=9D=B4=EB=B2=84=20?= =?UTF-8?q?=EC=A7=80=EB=8F=84=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 4 + feature/map/build.gradle.kts | 4 + .../unifest/android/feature/map/MapScreen.kt | 91 +++++++++++++------ gradle.properties | 3 +- gradle/libs.versions.toml | 10 ++ settings.gradle.kts | 1 + 6 files changed, 83 insertions(+), 30 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7027ef06..309edec9 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -36,6 +36,10 @@ android:name="com.google.android.geo.API_KEY" android:value="${GOOGLE_MAP_API_KEY}" /> + + diff --git a/feature/map/build.gradle.kts b/feature/map/build.gradle.kts index 43d2855b..8455c77f 100644 --- a/feature/map/build.gradle.kts +++ b/feature/map/build.gradle.kts @@ -17,5 +17,9 @@ dependencies { libs.play.service.maps, libs.play.service.location, libs.maps.compose, + libs.naver.map.sdk, + libs.naver.map.compose, + libs.naver.map.location, + libs.tedclustering.naver, ) } diff --git a/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt b/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt index d5151c6c..eb646278 100644 --- a/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt +++ b/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt @@ -13,14 +13,23 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.google.android.gms.maps.model.BitmapDescriptorFactory -import com.google.android.gms.maps.model.CameraPosition -import com.google.android.gms.maps.model.LatLng -import com.google.maps.android.compose.GoogleMap -import com.google.maps.android.compose.MapUiSettings -import com.google.maps.android.compose.Marker -import com.google.maps.android.compose.MarkerState -import com.google.maps.android.compose.rememberCameraPositionState +import com.naver.maps.geometry.LatLng +import com.naver.maps.map.CameraPosition +//import com.google.android.gms.maps.model.BitmapDescriptorFactory +//import com.google.android.gms.maps.model.CameraPosition +//import com.google.android.gms.maps.model.LatLng +//import com.google.maps.android.compose.GoogleMap +//import com.google.maps.android.compose.MapUiSettings +//import com.google.maps.android.compose.Marker +//import com.google.maps.android.compose.MarkerState +//import com.google.maps.android.compose.rememberCameraPositionState +import com.naver.maps.map.compose.ExperimentalNaverMapApi +import com.naver.maps.map.compose.Marker +import com.naver.maps.map.compose.MarkerState +import com.naver.maps.map.compose.NaverMap +import com.naver.maps.map.compose.rememberCameraPositionState +import com.naver.maps.map.overlay.Marker +import com.naver.maps.map.overlay.OverlayImage import com.unifest.android.core.designsystem.theme.UnifestTheme import com.unifest.android.core.ui.DevicePreview import com.unifest.android.feature.map.viewmodel.MapUiState @@ -39,14 +48,15 @@ internal fun MapRoute( ) } +@OptIn(ExperimentalNaverMapApi::class) @Composable internal fun MapScreen( padding: PaddingValues, uiState: MapUiState, ) { - val uiSettings = remember { - MapUiSettings(zoomControlsEnabled = false) - } +// val uiSettings = remember { +// MapUiSettings(zoomControlsEnabled = false) +// } Column( modifier = Modifier @@ -56,33 +66,56 @@ internal fun MapScreen( verticalArrangement = Arrangement.Center, ) { val cameraPositionState = rememberCameraPositionState { - position = CameraPosition.fromLatLngZoom(LatLng(37.540470588662664, 127.0765263757882), 16.5f) + position = CameraPosition(LatLng(37.540470588662664, 127.0765263757882), 14.0) } - GoogleMap( - modifier = Modifier.fillMaxSize(), - cameraPositionState = cameraPositionState, - properties = uiState.properties, - uiSettings = uiSettings, - onMapClick = {}, - ) { - uiState.boothSpots.forEach { spot -> + NaverMap(cameraPositionState = cameraPositionState) { + data class BoothSpot(val latitude: Double, val longitude: Double) + + val boothSpots = listOf( + BoothSpot(37.54053013863604, 127.07505652524804), + BoothSpot(37.54111712868565, 127.07839319326257), + BoothSpot(37.5414744247141, 127.07779237844323), + BoothSpot(37.54224856023523, 127.07605430700158), + BoothSpot(37.54003672313541, 127.07653710462426), + BoothSpot(37.53998567996623, 37.53998567996623), + BoothSpot(37.54152546686414, 127.07353303052759), + BoothSpot(37.54047909580466, 127.07398364164209), + ) + + // boothSpots 리스트에서 마커 생성 + boothSpots.forEach { spot -> Marker( - state = MarkerState( - position = LatLng(spot.lat, spot.lng), - ), - title = "Booth spot (${spot.lat}, ${spot.lng})", - snippet = "click", - onClick = { true }, - icon = BitmapDescriptorFactory.defaultMarker( - BitmapDescriptorFactory.HUE_GREEN, - ), + state = MarkerState(position = LatLng(spot.latitude, spot.longitude)), + icon = OverlayImage.fromResource(com.unifest.android.core.designsystem.R.drawable.ic_general) ) } } } } +// GoogleMap( +// modifier = Modifier.fillMaxSize(), +// cameraPositionState = cameraPositionState, +// properties = uiState.properties, +// uiSettings = uiSettings, +// onMapClick = {}, +// ) { +// uiState.boothSpots.forEach { spot -> +// Marker( +// state = MarkerState( +// position = LatLng(spot.lat, spot.lng), +// ), +// title = "Booth spot (${spot.lat}, ${spot.lng})", +// snippet = "click", +// onClick = { true }, +// icon = BitmapDescriptorFactory.defaultMarker( +// BitmapDescriptorFactory.HUE_GREEN, +// ), +// ) +// } +// } + @DevicePreview @Composable fun MapScreenPreview() { diff --git a/gradle.properties b/gradle.properties index 3c5031eb..aa5fda35 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file +android.nonTransitiveRClass=true +android.enableJetifier=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5e0b831c..9533c1a1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -50,6 +50,11 @@ balloon = "1.6.4" calendar-compose = "2.5.0" maps-compose = "4.3.3" +naver-map-sdk = "3.17.0" +naver-map-compose = "1.4.1" +naver-map-location = "21.0.1" +tedclustering-naver = "1.0.2" + [libraries] gradle-android = { group = "com.android.tools.build", name = "gradle", version.ref = "android-gradle-plugin" } @@ -108,6 +113,11 @@ ballon = { group = "com.github.skydoves", name = "balloon", version.ref = "ballo calendar-compose = { group = "com.kizitonwose.calendar", name = "compose", version.ref = "calendar-compose"} maps-compose = { group = "com.google.maps.android", name = "maps-compose", version.ref = "maps-compose" } +naver-map-sdk = { group = "com.naver.maps", name = "map-sdk", version.ref = "naver-map-sdk" } +naver-map-compose = { group = "io.github.fornewid", name = "naver-map-compose", version.ref = "naver-map-compose" } +naver-map-location = { group = "io.github.fornewid", name = "naver-map-location", version.ref = "naver-map-location" } +tedclustering-naver = { group = "io.github.ParkSangGwon", name = "tedclustering-naver", version.ref = "tedclustering-naver" } + [plugins] gradle-dependency-handler-extensions = { id = "land.sungbin.dependency.handler.extensions", version.ref = "gradle-dependency-handler-extensions" } diff --git a/settings.gradle.kts b/settings.gradle.kts index fb91cf92..c4fd4c70 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,6 +18,7 @@ dependencyResolutionManagement { google() mavenCentral() maven { url = uri("https://devrepo.kakao.com/nexus/content/groups/public/") } + maven("https://repository.map.naver.com/archive/maven") } } From b1806beda0df2ae0c6c79f9d10384e90f87ff04e Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Sun, 31 Mar 2024 21:22:07 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[chore]=20=EC=A3=BC=EC=84=9D=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=EB=90=9C=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0,?= =?UTF-8?q?=20import=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unifest/android/feature/map/MapScreen.kt | 63 +++---------------- 1 file changed, 7 insertions(+), 56 deletions(-) diff --git a/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt b/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt index eb646278..1b0d58db 100644 --- a/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt +++ b/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt @@ -7,33 +7,24 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.naver.maps.geometry.LatLng -import com.naver.maps.map.CameraPosition -//import com.google.android.gms.maps.model.BitmapDescriptorFactory -//import com.google.android.gms.maps.model.CameraPosition -//import com.google.android.gms.maps.model.LatLng -//import com.google.maps.android.compose.GoogleMap -//import com.google.maps.android.compose.MapUiSettings -//import com.google.maps.android.compose.Marker -//import com.google.maps.android.compose.MarkerState -//import com.google.maps.android.compose.rememberCameraPositionState import com.naver.maps.map.compose.ExperimentalNaverMapApi import com.naver.maps.map.compose.Marker -import com.naver.maps.map.compose.MarkerState import com.naver.maps.map.compose.NaverMap import com.naver.maps.map.compose.rememberCameraPositionState -import com.naver.maps.map.overlay.Marker import com.naver.maps.map.overlay.OverlayImage import com.unifest.android.core.designsystem.theme.UnifestTheme import com.unifest.android.core.ui.DevicePreview import com.unifest.android.feature.map.viewmodel.MapUiState import com.unifest.android.feature.map.viewmodel.MapViewModel +import com.naver.maps.map.CameraPosition +import com.naver.maps.map.compose.MarkerState +import com.naver.maps.geometry.LatLng +import com.unifest.android.core.designsystem.R @Composable internal fun MapRoute( @@ -54,10 +45,6 @@ internal fun MapScreen( padding: PaddingValues, uiState: MapUiState, ) { -// val uiSettings = remember { -// MapUiSettings(zoomControlsEnabled = false) -// } - Column( modifier = Modifier .fillMaxSize() @@ -70,52 +57,16 @@ internal fun MapScreen( } NaverMap(cameraPositionState = cameraPositionState) { - data class BoothSpot(val latitude: Double, val longitude: Double) - - val boothSpots = listOf( - BoothSpot(37.54053013863604, 127.07505652524804), - BoothSpot(37.54111712868565, 127.07839319326257), - BoothSpot(37.5414744247141, 127.07779237844323), - BoothSpot(37.54224856023523, 127.07605430700158), - BoothSpot(37.54003672313541, 127.07653710462426), - BoothSpot(37.53998567996623, 37.53998567996623), - BoothSpot(37.54152546686414, 127.07353303052759), - BoothSpot(37.54047909580466, 127.07398364164209), - ) - - // boothSpots 리스트에서 마커 생성 - boothSpots.forEach { spot -> + uiState.boothSpots.forEach { spot -> Marker( - state = MarkerState(position = LatLng(spot.latitude, spot.longitude)), - icon = OverlayImage.fromResource(com.unifest.android.core.designsystem.R.drawable.ic_general) + state = MarkerState(position = LatLng(spot.lat, spot.lng)), + icon = OverlayImage.fromResource(R.drawable.ic_general) ) } } } } -// GoogleMap( -// modifier = Modifier.fillMaxSize(), -// cameraPositionState = cameraPositionState, -// properties = uiState.properties, -// uiSettings = uiSettings, -// onMapClick = {}, -// ) { -// uiState.boothSpots.forEach { spot -> -// Marker( -// state = MarkerState( -// position = LatLng(spot.lat, spot.lng), -// ), -// title = "Booth spot (${spot.lat}, ${spot.lng})", -// snippet = "click", -// onClick = { true }, -// icon = BitmapDescriptorFactory.defaultMarker( -// BitmapDescriptorFactory.HUE_GREEN, -// ), -// ) -// } -// } - @DevicePreview @Composable fun MapScreenPreview() { From c12064ca0a091a72d16ce9b3969ce2511ba2e665 Mon Sep 17 00:00:00 2001 From: Jeong Sang Hoon Date: Thu, 4 Apr 2024 17:31:17 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[delete]=20Google=20Map=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20Manifest=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 309edec9..9947d669 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -31,11 +31,7 @@ android:value="androidx.startup" /> - - - + From babfbd3a09ddaa7f56d6acffe9bc8b6ec3b8b046 Mon Sep 17 00:00:00 2001 From: Jeong Sang Hoon Date: Thu, 4 Apr 2024 17:36:45 +0900 Subject: [PATCH 5/5] [chore] style check success --- app/src/main/AndroidManifest.xml | 2 +- .../main/kotlin/com/unifest/android/feature/map/MapScreen.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9947d669..80769c16 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -31,7 +31,7 @@ android:value="androidx.startup" /> - + diff --git a/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt b/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt index 1b0d58db..bf7e1da4 100644 --- a/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt +++ b/feature/map/src/main/kotlin/com/unifest/android/feature/map/MapScreen.kt @@ -60,7 +60,7 @@ internal fun MapScreen( uiState.boothSpots.forEach { spot -> Marker( state = MarkerState(position = LatLng(spot.lat, spot.lng)), - icon = OverlayImage.fromResource(R.drawable.ic_general) + icon = OverlayImage.fromResource(R.drawable.ic_general), ) } }