Skip to content

Commit

Permalink
feat(docs): update docs
Browse files Browse the repository at this point in the history
Circle / Ellipse / Rectangle
  • Loading branch information
Dongkyuuuu committed Sep 27, 2021
1 parent 68c1fa2 commit e8c0bd7
Show file tree
Hide file tree
Showing 14 changed files with 640 additions and 5 deletions.
12 changes: 12 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ const config = {
text: "InfoWindow",
link: "/guide/Infowindow",
},
{
text: "Circle",
link: "/guide/Circle",
},
{
text: "Ellipse",
link: "/guide/Ellipse",
},
{
text: "Rectangle",
link: "/guide/Rectangle",
},
],
},
{
Expand Down
6 changes: 6 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import theme from "vitepress/dist/client/theme-default";
import NaverMaps from "../../example/Map.vue";
import NaverMarker from "../../example/Marker.vue";
import NaverInfoWindow from "../../example/InfoWindow.vue";
import NaverCircle from "../../example/Circle.vue";
import NaverEllipse from "../../example/Ellipse.vue";
import NaverRectangle from "../../example/Rectangle.vue";

export default {
...theme,
enhanceApp({ app, router, siteData }) {
app.component("naver-maps", NaverMaps);
app.component("naver-marker", NaverMarker);
app.component("naver-info-window", NaverInfoWindow);
app.component("naver-circle", NaverCircle);
app.component("naver-ellipse", NaverEllipse);
app.component("naver-rectangle", NaverRectangle);
},
};
149 changes: 149 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ app

## NaverMaps

지도 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš© λ˜λŠ” Props μž…λ‹ˆλ‹€.

### width

- **선택**
Expand Down Expand Up @@ -132,6 +134,8 @@ app

## NaverMarker

마컀 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš© λ˜λŠ” Props μž…λ‹ˆλ‹€.

### latitude

- **ν•„μˆ˜**
Expand Down Expand Up @@ -164,6 +168,8 @@ htmlIcon을 μ‚¬μš©ν•˜λŠ” 경우, 초기 `size`와 `anchor`λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€. `

## NaverInfoWindow

정보창 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš© λ˜λŠ” Props μž…λ‹ˆλ‹€.

### marker

- **ν•„μˆ˜**
Expand All @@ -189,3 +195,146 @@ htmlIcon을 μ‚¬μš©ν•˜λŠ” 경우, 초기 `size`와 `anchor`λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€. `
- **상세:**

정보창에 λŒ€ν•œ μ˜΅μ…˜μ„ μ„€μ •ν•©λ‹ˆλ‹€.

### @onLoad

- **선택**
- **λ°˜ν™˜νƒ€μž…:** `naver.maps.Infowindow`
- **상세:**

## NaverCircle

원 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©λ˜λŠ” Props μž…λ‹ˆλ‹€.

### latitude

- **ν•„μˆ˜**
- **νƒ€μž…:** `Number`
- **상세:**

원 μ»΄ν¬λ„ŒνŠΈμ˜ μœ„λ„λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

### longitude

- **ν•„μˆ˜**
- **νƒ€μž…:** `Number`
- **상세:**

원 μ»΄ν¬λ„ŒνŠΈμ˜ 경도λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

### radius

- **선택**
- **νƒ€μž…:** `Number`
- **상세:**

μ»΄ν¬λ„ŒνŠΈμ˜ μœ„λ„,경도 κΈ°μ€€ μ›μ˜ λ°˜κ²½μž…λ‹ˆλ‹€. λ‹¨μœ„λŠ” λ―Έν„°(m)둜 μ‚¬μš© λ©λ‹ˆλ‹€.

### options

- **선택**
- **νƒ€μž…:** `naver.maps.CircleOptions`
- **κΈ°λ³Έκ°’:** `{}`
- **상세:**

원 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ 좔가적인 μ˜΅μ…˜μ„ μž…λ ₯ν•©λ‹ˆλ‹€.

### @onLoad

- **선택**
- **λ°˜ν™˜νƒ€μž…:** `naver.maps.Circle`
- **상세:**

## NaverEllipse

타원 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©λ˜λŠ” Props μž…λ‹ˆλ‹€.

### bounds

- **ν•„μˆ˜**
- **νƒ€μž…:** `naver.maps.Bounds` | `naver.maps.BoundsLiteral`
- **상세:**

λ„ν˜•μ˜ μ’Œν‘œ 경계λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€.

```js
// naver.maps.Bounds νƒ€μž…
const bounds = new window.naver.maps.LatLngBounds(
new window.naver.maps.LatLng(37.565, 126.9761217732253), // sw
new window.naver.maps.LatLng(37.568, 126.980655026774) // ne
);
```

```js
// naver.maps.BoundsLiteral νƒ€μž…
const bounds = {
south: 37.566616443521745,
north: 38.566616443521745,
west: 126.97837068565364,
east: 127.97837068565364,
};
```

μœ„μ™€ 같은 예제둜 boundsλ₯Ό 지정할 수 μžˆμŠ΅λ‹ˆλ‹€.

### options

- **선택**
- **νƒ€μž…:** `naver.maps.EllipseOptions`
- **κΈ°λ³Έκ°’:** `{}`
- **상세:**

타원 μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ 좔가적인 μ˜΅μ…˜μ„ μž…λ ₯ν•©λ‹ˆλ‹€.

### @onLoad

- **선택**
- **λ°˜ν™˜νƒ€μž…:** `naver.maps.Ellipse`
- **상세:**

## NaverRectangle

μ‚¬κ°ν˜• μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©λ˜λŠ” Props μž…λ‹ˆλ‹€.

### bounds

- **ν•„μˆ˜**
- **νƒ€μž…:** `naver.maps.Bounds` | `naver.maps.BoundsLiteral`
- **상세:**

λ„ν˜•μ˜ μ’Œν‘œ 경계λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€.

```js
// naver.maps.Bounds νƒ€μž…
const bounds = new window.naver.maps.LatLngBounds(
new window.naver.maps.LatLng(37.565, 126.9761217732253), // sw
new window.naver.maps.LatLng(37.568, 126.980655026774) // ne
);
```

```js
// naver.maps.BoundsLiteral νƒ€μž…
const bounds = {
south: 37.566616443521745,
north: 38.566616443521745,
west: 126.97837068565364,
east: 127.97837068565364,
};
```

μœ„μ™€ 같은 예제둜 boundsλ₯Ό 지정할 수 μžˆμŠ΅λ‹ˆλ‹€.

### options

- **선택**
- **νƒ€μž…:** `naver.maps.RectangleOptions`
- **κΈ°λ³Έκ°’:** `{}`
- **상세:**

μ‚¬κ°ν˜• μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ 좔가적인 μ˜΅μ…˜μ„ μž…λ ₯ν•©λ‹ˆλ‹€.

### @onLoad

- **선택**
- **λ°˜ν™˜νƒ€μž…:** `naver.maps.Rectangle`
- **상세:**
58 changes: 58 additions & 0 deletions docs/example/Circle.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<naver-maps
width="100%"
height="400px"
:mapOptions="mapOptions"
:initLayers="initLayers"
@onLoad="onLoadMap($event)"
>
<naver-circle
:latitude="37.56663888630603"
:longitude="126.97838310403904"
:radius="350"
@onLoad="onLoadCircle($event)"
/>
</naver-maps>
</template>

<script>
import { ref } from "vue";
import { NaverMaps, NaverCircle } from "../../dist/vue3-naver-maps";
export default {
components: { NaverMaps, NaverCircle },
setup: () => {
const map = ref();
const circle = ref();
const mapOptions = {
latitude: 37.56663888630603, // 지도 쀑앙 μœ„λ„
longitude: 126.97838310403904, // 지도 쀑앙 경도
zoom: 16,
zoomControl: false,
zoomControlOptions: { position: "TOP_RIGHT" },
};
const initLayers = [
"BACKGROUND",
"BACKGROUND_DETAIL",
"POI_KOREAN",
"TRANSIT",
"ENGLISH",
];
const onLoadMap = (mapObject) => {
map.value = mapObject;
};
const onLoadCircle = (circleObject) => {
circle.value = circleObject;
};
return {
map,
mapOptions,
initLayers,
onLoadMap,
onLoadCircle,
};
},
};
</script>
60 changes: 60 additions & 0 deletions docs/example/Ellipse.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<naver-maps
width="100%"
height="400px"
:mapOptions="mapOptions"
:initLayers="initLayers"
@onLoad="onLoadMap($event)"
>
<naver-ellipse :bounds="ellipseBound" @onLoad="onLoadEllipse($event)" />
</naver-maps>
</template>

<script>
import { ref } from "vue";
import { NaverMaps, NaverEllipse } from "../../dist/vue3-naver-maps";
export default {
components: { NaverMaps, NaverEllipse },
setup: () => {
const map = ref();
const ellipse = ref();
const ellipseBound = ref({
south: 36,
north: 38,
west: 126,
east: 128,
});
const mapOptions = {
latitude: 37.56663888630603, // 지도 쀑앙 μœ„λ„
longitude: 126.97838310403904, // 지도 쀑앙 경도
zoom: 8,
zoomControl: false,
zoomControlOptions: { position: "TOP_RIGHT" },
};
const initLayers = [
"BACKGROUND",
"BACKGROUND_DETAIL",
"POI_KOREAN",
"TRANSIT",
"ENGLISH",
];
const onLoadMap = (mapObject) => {
map.value = mapObject;
};
const onLoadEllipse = (ellipseObject) => {
ellipse.value = ellipseObject;
};
return {
map,
mapOptions,
initLayers,
onLoadMap,
onLoadEllipse,
ellipseBound,
};
},
};
</script>
2 changes: 1 addition & 1 deletion docs/example/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { NaverMaps } from "../../dist/vue3-naver-maps";
export default {
components: { NaverMaps },
setup: () => {
const map = ref(null);
const map = ref();
const mapOptions = {
latitude: 37.56663888630603, // 지도 쀑앙 μœ„λ„
longitude: 126.97838310403904, // 지도 쀑앙 경도
Expand Down
Loading

0 comments on commit e8c0bd7

Please sign in to comment.