-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
1,756 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
const config = { | ||
lang: "ko", | ||
title: "Vue3 Naver Maps", | ||
description: "NaverMap component for Vue3", | ||
locales: { | ||
"/": { | ||
lang: "ko", | ||
title: "Vue3 Naver Maps", | ||
description: "NaverMap component for Vue3", | ||
}, | ||
}, | ||
|
||
themeConfig: { | ||
repo: "DongKyuuuu/vue3-naver-maps", | ||
docsRepo: "DongKyuuuu/vue3-naver-maps", | ||
docsDir: "docs", | ||
docsBranch: "main", | ||
editLinks: true, | ||
editLinkText: | ||
"์ด ๋ฌธ์์ ๋ํ ์๊ฒฌ์ด ์์ผ์๊ฑฐ๋, ๋ฌธ์ ๋ฅผ ๋ฐ๊ฒฌํ์ จ์ผ๋ฉด ์ ๋ณดํด์ฃผ์ธ์!", | ||
locales: { | ||
// Korean | ||
"/": { | ||
label: "ํ๊ตญ์ด", | ||
selectText: "Languages", | ||
nav: [ | ||
{ | ||
text: "Guide", | ||
link: "/guide/", | ||
}, | ||
{ | ||
text: "API ๋ ํผ๋ฐ์ค", | ||
link: "/api/", | ||
}, | ||
{ | ||
text: "NaverMapsAPI", | ||
link: "https://navermaps.github.io/maps.js.ncp/", | ||
}, | ||
{ | ||
text: "Changelog", | ||
link: "https://github.com/DongKyuuuu/vue3-naver-maps/blob/main/CHANGELOG.md", | ||
}, | ||
], | ||
sidebar: [ | ||
{ | ||
text: "์๊ฐ", | ||
link: "/", | ||
}, | ||
{ | ||
text: "์ค์นํ๊ธฐ", | ||
link: "/installation", | ||
}, | ||
{ | ||
text: "์ปดํฌ๋ํธ ๊ฐ์ด๋", | ||
collapsable: false, | ||
children: [ | ||
{ | ||
text: "์์ํ๊ธฐ", | ||
link: "/guide/", | ||
}, | ||
{ | ||
text: "naver-map", | ||
link: "/guide/componentMap", | ||
}, | ||
{ | ||
text: "naver-marker", | ||
link: "/guide/componentMarker", | ||
}, | ||
], | ||
}, | ||
{ | ||
text: "ํ์ ์คํฌ๋ฆฝํธ", | ||
collapsable: false, | ||
children: [ | ||
// { | ||
// text: "ํ์ ์คํฌ๋ฆฝํธ ์ง์", | ||
// link: "/types/", | ||
// }, | ||
{ | ||
text: "ํ์ ์ ์", | ||
link: "/types/define", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
--- | ||
sidebar: auto | ||
--- | ||
|
||
# API ๋ ํผ๋ฐ์ค | ||
|
||
## ์ค์น์ต์ | ||
|
||
`main.js`์์ vue3-naver-maps๋ฅผ ์ค์น ํ ๋, ์ฌ์ฉํ ์ ์๋ ์ต์ ์ ๋๋ค. | ||
|
||
### clinetId | ||
|
||
- **ํ์** | ||
- **ํ์ :** `string` | ||
- **์์ธ:** | ||
|
||
๋ค์ด๋ฒ ์ง๋์์ ๋ฐ๊ธ๋ฐ์ ClinetId ๊ฐ์ ์ ๋ ฅํฉ๋๋ค. ๊ธฐ๋ฅ์ ์ด์ฉํ๊ธฐ ์ํด์ ํ์์ ์ผ๋ก ์ ๋ ฅ ๋์ด์ผ ํฉ๋๋ค. | ||
|
||
```javascript | ||
// main.js | ||
import { createApp } from "vue"; | ||
import naver from "vue3-naver-maps"; | ||
|
||
const app = createApp(App); | ||
|
||
app.use(naver, { clientId: "your clientId" }).mount("#app"); | ||
``` | ||
|
||
### category | ||
|
||
- **์ ํ** | ||
- **ํ์ :** `"ncp" | "gov" | "fin"` | ||
- **๊ธฐ๋ณธ๊ฐ:** `ncp` | ||
- **์์ธ:** | ||
|
||
์ฌ์ฉํ ํด๋ผ์ด์ธํธ ์ข ๋ฅ๋ฅผ ์ ๋ ฅํฉ๋๋ค. `ncp`๊ฐ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ค์ ๋์ด ์์ต๋๋ค. ๋ค๋ฅธ ํด๋ผ์ด์ธํธ ํ์ ์ ์ด์ฉํ๊ณ ์๋๊ฒฝ์ฐ ์ฌ์ฉํด์ฃผ์ธ์. | ||
|
||
`ncp`: ๋ค์ด๋ฒํด๋ผ์ฐ๋ ํ๋ซํผ<br/> | ||
`gov`: ๊ณต๊ณต๊ธฐ๊ด์ฉ<br/> | ||
`fin`: ๊ธ์ต๊ธฐ๊ด์ฉ | ||
|
||
```javascript | ||
// main.js | ||
import { createApp } from "vue"; | ||
import naver from "vue3-naver-maps"; | ||
|
||
const app = createApp(App); | ||
|
||
app.use(naver, { clientId: "your clientId", category: "gov" }).mount("#app"); | ||
``` | ||
|
||
### subModules | ||
|
||
- **์ ํ** | ||
- **ํ์ :** `string` | ||
- **์์ธ:** | ||
|
||
์ฌ์ฉํ ์๋ธ๋ชจ๋์ ์์ฑํฉ๋๋ค. ์ฌ๋ฌ๊ฐ์ ์๋ธ๋ชจ๋์ ์ด์ฉํ ๊ฒฝ์ฐ `์ฝค๋ง(,)`๋ฅผ ์ด์ฉํ์ฌ ์์ฑํด์ผ ํฉ๋๋ค. | ||
|
||
```javascript | ||
// main.js | ||
import { createApp } from "vue"; | ||
import naver from "vue3-naver-maps"; | ||
|
||
const app = createApp(App); | ||
|
||
app | ||
.use(naver, { clientId: "your clientId", subModules: "panorama,geocoder" }) | ||
.mount("#app"); | ||
``` | ||
|
||
## naver-map | ||
|
||
### width | ||
|
||
- **์ ํ** | ||
- **ํ์ :** `string` | ||
- **๊ธฐ๋ณธ๊ฐ:** `400px` | ||
- **์์ธ:** | ||
|
||
์์ฑ๋ ์ง๋์ ๋๋น๋ฅผ ์ ํฉ๋๋ค. `px` `em` `%` `vh` `vw` ๋ฑ css ๋จ์ ์ ๋ถ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค. | ||
|
||
### height | ||
|
||
- **์ ํ** | ||
- **ํ์ :** `string` | ||
- **๊ธฐ๋ณธ๊ฐ:** `400px` | ||
- **์์ธ:** | ||
|
||
์์ฑ๋ ์ง๋์ ๋์ด๋ฅผ ์ ํฉ๋๋ค. `px` `em` `%` `vh` `vw` ๋ฑ css ๋จ์ ์ ๋ถ ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค. | ||
|
||
### mapOptions | ||
|
||
- **์ ํ** | ||
- **ํ์ :** [`naverV3.mapOptions`](/types/define.html#mapoptions) | ||
- **์์ธ:** | ||
|
||
`naver.maps.mapOptions`ํ์ ์ ์์๋ฐ์ ์ฌ์ฉ ํฉ๋๋ค. ์ง๋ ์์ฑ ์ต์ ์ ์ง์ ํฉ๋๋ค. ์ต์ ์ ์ง์ ํ์ง ์๋ ๊ฒฝ์ฐ, ๋ค์ด๋ฒ์์ ์ ๊ณต ํ๋ ๊ธฐ๋ณธ ์ง๋ ์ต์ ์ ์ฌ์ฉํฉ๋๋ค. | ||
|
||
`latitude`, `longitude`๋ก ๋งต ๋ก๋ ์ ์ค์์ ์ค์ ํ ์ ์์ต๋๋ค. | ||
|
||
### initLayers | ||
|
||
- **์ ํ** | ||
- **ํ์ :** [`naverV3.initLayer[]`](/types/define.html#initlayer) | ||
- **๊ธฐ๋ณธ๊ฐ:** `[]` | ||
- **์์ธ:** | ||
|
||
๊ธฐ๋ณธ ๋ ์ด์ด๋ฅผ ์ค์ ํฉ๋๋ค. ๋๋ฌธ์ ๊ทธ๋๋ก ์ฌ์ฉํ์ฌ์ผ ํ๋ฉฐ, ์๋์ ์ง์ ๋ ์ต์ ๋ง ์ฌ์ฉํด์ผ ํฉ๋๋ค. | ||
|
||
- `BACKGROUND` | ||
- `BACKGROUND_DETAIL` | ||
- `BICYCLE` | ||
- `CADASTRAL` | ||
- `CTT` | ||
- `HIKING_TRAIL` | ||
- `PANORAMA` | ||
- `POI_KOREAN` | ||
- `TRANSIT` | ||
- `KOREAN` | ||
- `ENGLISH` | ||
- `CHINESE` | ||
- `JAPANESE` | ||
|
||
### @onLoad | ||
|
||
- **์ ํ** | ||
- **๋ฐํํ์ :** `naver.maps.Map` | ||
- **์์ธ:** | ||
|
||
์ปดํฌ๋ํธ์์ ์์ฑํ ์ง๋ ๊ฐ์ฒด๋ฅผ ๋ฐํ ํฉ๋๋ค. ๋ฐํ๋ฐ์ ๋ค์ด๋ฒ ๋งต ๊ฐ์ฒด๋ฅผ ํตํด ์ง๋๋ฅผ ์ค์ ํ ์ ์์ต๋๋ค. | ||
|
||
## naver-marker | ||
|
||
### latitude | ||
|
||
- **ํ์** | ||
- **ํ์ :** `number` | ||
- **์์ธ:** | ||
|
||
๋ง์ปค์ ์๋๋ฅผ ์ง์ ํฉ๋๋ค. | ||
|
||
### longitude | ||
|
||
- **ํ์** | ||
- **ํ์ :** `number` | ||
- **์์ธ:** | ||
|
||
๋ง์ปค์ ๊ฒฝ๋๋ฅผ ์ง์ ํฉ๋๋ค. | ||
|
||
### htmlIcon | ||
|
||
- **์ ํ** | ||
- **ํ์ :** [`naverV3.htmlIcon`](/types/define.html#htmlicon) | ||
- **์์ธ:** | ||
|
||
htmlIcon์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ, ์ด๊ธฐ `size`์ `anchor`๋ฅผ ์ง์ ํฉ๋๋ค. `@onLoad`๋ฅผ ํตํด ๋ง์ปค ๊ฐ์ฒด๋ฅผ ๋ฐํ ๋ฐ๊ณ `setIcon()`์ ์ฌ์ฉํ์ฌ๋ ๋ฌด๊ดํฉ๋๋ค. | ||
|
||
### @onLoad | ||
|
||
- **์ ํ** | ||
- **๋ฐํํ์ :** `naver.maps.Marker` | ||
- **์์ธ:** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# naver-map | ||
|
||
`naver-map` ์ปดํฌ๋ํธ๋ ์ง๋๋ฅผ ์์ฑํ๋ ์ปดํฌ๋ํธ ์ ๋๋ค. ํด๋น ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ๋ค๋ฅธ ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋์ํ์ง ์์ต๋๋ค. ๋ชจ๋ ์ปดํฌ๋ํธ ์ค ๊ฐ์ฅ ๋จผ์ ์ฌ์ฉํด์ฃผ์ ์ผ ํฉ๋๋ค. | ||
|
||
## ์์ | ||
|
||
```vue | ||
<template> | ||
<naver-map | ||
width="400px" | ||
height="400px" | ||
:mapOptions="mapOptions" | ||
:initLayers="initLayers" | ||
@onLoad="onLoadMap($event)" | ||
> | ||
</naver-map> | ||
</template> | ||
<script> | ||
import { ref } from "vue"; | ||
export default { | ||
setup: () => { | ||
const map = ref(null); | ||
const mapOptions = { | ||
latitude: 36, | ||
longitude: 126, | ||
zoom: 12, | ||
zoomControl: false, | ||
zoomControlOptions: { position: "TOP_RIGHT" }, | ||
mapTypeControl: false, | ||
}; | ||
const initLayers = [ | ||
"BACKGROUND", | ||
"BACKGROUND_DETAIL", | ||
"POI_KOREAN", | ||
"TRANSIT", | ||
"ENGLISH", | ||
]; | ||
const onLoadMap = (mapObject) => { | ||
map.value = mapObject; | ||
}; | ||
return { | ||
map, | ||
mapOptions, | ||
initLayers, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
``` | ||
|
||
## ์ค์ | ||
|
||
๋ชจ๋ Props๋ ํ์ ๊ฐ์ด ์๋๋๋ค. ํด๋น Props์ด ์๋ ๊ฒฝ์ฐ ๊ธฐ๋ณธ๊ฐ์ด ์ ์ฉ ๋ฉ๋๋ค. `@onLoad`๋ ๋ง์ฐฌ๊ฐ์ง๋ก naver ๊ฐ์ฒด๋ฅผ ์ค์ ํ ์ผ์ด ์์ผ๋ฉด ์ฌ์ฉํ์ง ์์๋ ์๊ด ์์ต๋๋ค. | ||
|
||
์์ธํ ์ค์ ์ต์ ์ [naver-map ์ต์ ](/api/#naver-map)์์ ํ์ธ ๊ฐ๋ฅํฉ๋๋ค. | ||
|
||
:::info ์๋ฆผ | ||
๊ธฐ๋ณธ ๊ฐ์ ๋ค์ด๋ฒ์์ ์ ๊ณตํ๋ ๊ธฐ๋ณธ ๊ฐ์ผ๋ก ์ค์ ๋ฉ๋๋ค. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# naver-marker | ||
|
||
`naver-marker` ๋ง์ปค๋ฅผ ์์ฑํ๋ ์ปดํฌ๋ํธ ์ ๋๋ค. `naver-map` ์์ฑ ์ดํ์ ์์ฑ๋ฉ๋๋ค. Vue.js์ `v-on` ์ด๋ฒคํธ๋ฅผ ๊ฐ์ด ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค. | ||
|
||
## ์์ | ||
|
||
```vue | ||
<template> | ||
<naver-map> | ||
<naver-marker | ||
:latitude="37" | ||
:longitude="126" | ||
@click="alertMarker()" | ||
@onLoad="onLoadMarker($event)" | ||
> | ||
<!-- Html Icon --> | ||
</naver-marker> | ||
</naver-map> | ||
</template> | ||
<script> | ||
import { ref } from "vue"; | ||
export default { | ||
setup: () => { | ||
const marker = ref(null); | ||
const onLoadMarker = (markerObject) => { | ||
marker.value = markerObject; | ||
}; | ||
const alertMarker = () => { | ||
console.log(marker.value); | ||
}; | ||
return { onLoadMarker, alertMarker }; | ||
}, | ||
}; | ||
</script> | ||
``` | ||
|
||
## ์ค์ | ||
|
||
`latitude`, `longitude`๋ ํ์์ ์ผ๋ก ์ ๋ ฅํด ์ฃผ์ ์ผ ํฉ๋๋ค. | ||
|
||
์ปดํฌ๋ํธ ๋ด๋ถ์ ์ฝ๋๋ฅผ ์์ฑํ๋ฉด `HtmlIcon`์ด ์ ์ฉ ๋ฉ๋๋ค. `HtmlIcon`์ฌ์ฉ ์ `anchor`์ `size`๋ฅผ ๋ณ๋๋ก ์ง์ ํด ์ฃผ์ ์ผ ๋ง์ปค์์น๋ฅผ ์ ํํ ์ ์ง ํ ์ ์์ต๋๋ค. | ||
|
||
์์ธํ ์ค์ ์ต์ ์ [naver-marker ์ต์ ](/api/#naver-marker)์์ ํ์ธ ๊ฐ๋ฅํฉ๋๋ค. | ||
|
||
:::info ์๋ฆผ | ||
HtmlIcon์ ์ฌ์ฉํ์ง ์์ผ๋ฉด ๋ค์ด๋ฒ ๊ธฐ๋ณธ ๋ง์ปค ์คํ์ผ์ด ์ ์ฉ ๋ฉ๋๋ค. | ||
::: |
Oops, something went wrong.