Skip to content

Commit

Permalink
feat(docs): create docs
Browse files Browse the repository at this point in the history
map docs
marker docs
  • Loading branch information
Dongkyuuuu committed Sep 4, 2021
1 parent 64836ae commit 59c3c76
Show file tree
Hide file tree
Showing 12 changed files with 1,756 additions and 20 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# vue3-naver-maps
# <center>vue3-naver-maps (WIP)</center>

๋ณธ ํ”„๋กœ์ ํŠธ๋Š” **๊ฐœ๋ฐœ ์ง„ํ–‰์ค‘์ธ(pre-release)** ํ”„๋กœ์ ํŠธ ์ž…๋‹ˆ๋‹ค.
<center>
๋ณธ ํ”„๋กœ์ ํŠธ๋Š” <b>๊ฐœ๋ฐœ ์ง„ํ–‰์ค‘์ธ(pre-release)</b> ํ”„๋กœ์ ํŠธ ์ž…๋‹ˆ๋‹ค.

์—…๋ฐ์ดํŠธ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ํ˜„ํ™ฉ์€ [Update Roadmap](https://github.com/DongKyuuuu/vue3-naver-maps/issues/3)์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

</center>

## Introduce

`vue3-naver-maps`๋Š” `NAVER ์ง€๋„ API v3` Vue3์—์„œ ๊ฐ„ํŽธํ•˜๊ฒŒ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ์ž‘์„ฑ ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ž…๋‹ˆ๋‹ค.
Expand Down
91 changes: 91 additions & 0 deletions docs/.vitepress/config.js
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;
163 changes: 163 additions & 0 deletions docs/api/index.md
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`
- **์ƒ์„ธ:**
63 changes: 63 additions & 0 deletions docs/guide/componentMap.md
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 ์•Œ๋ฆผ
๊ธฐ๋ณธ ๊ฐ’์€ ๋„ค์ด๋ฒ„์—์„œ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ ๊ฐ’์œผ๋กœ ์„ค์ • ๋ฉ๋‹ˆ๋‹ค.
:::
50 changes: 50 additions & 0 deletions docs/guide/componentMarker.md
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์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์œผ๋ฉด ๋„ค์ด๋ฒ„ ๊ธฐ๋ณธ ๋งˆ์ปค ์Šคํƒ€์ผ์ด ์ ์šฉ ๋ฉ๋‹ˆ๋‹ค.
:::
Loading

0 comments on commit 59c3c76

Please sign in to comment.