-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- #61
- Loading branch information
Showing
9 changed files
with
70 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Map, MapTypeControl, ZoomControl } from "react-kakao-maps-sdk" | ||
import useKakaoLoader from "./useKakaoLoader" | ||
|
||
export default function AddMapControl() { | ||
useKakaoLoader() | ||
|
||
const MapControls = () => ( | ||
<> | ||
<MapTypeControl position={kakao.maps.ControlPosition.TOPRIGHT} /> | ||
<ZoomControl position={kakao.maps.ControlPosition.RIGHT} /> | ||
</> | ||
) // 렌더링 시점에 kakao 객체 존재 하지 않는 오류 우회 하기 위한 Wrapping 처리 | ||
|
||
return ( | ||
<> | ||
<Map // 지도를 표시할 Container | ||
id="map" | ||
center={{ | ||
// 지도의 중심좌표 | ||
lat: 33.450701, | ||
lng: 126.570667, | ||
}} | ||
style={{ | ||
width: "100%", | ||
height: "350px", | ||
}} | ||
level={3} // 지도의 확대 레벨 | ||
> | ||
<MapControls /> | ||
</Map> | ||
</> | ||
) | ||
} |
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
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,16 @@ | ||
import React from "react" | ||
import SiteMetadata from "@theme-original/SiteMetadata" | ||
import { getSandpackCssText } from "@codesandbox/sandpack-react" | ||
|
||
export default function SiteMetadataWrapper(props) { | ||
return ( | ||
<> | ||
<style | ||
dangerouslySetInnerHTML={{ __html: getSandpackCssText() }} | ||
id="sandpack" | ||
key="sandpack-css" | ||
/> | ||
<SiteMetadata {...props} /> | ||
</> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/react-kakao-maps-sdk/__test__/addMapControl.spec.ts
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,12 @@ | ||
import { test, expect } from "@playwright/test" | ||
|
||
const getUrl = (id: string, isUpdateSanpShots: boolean = false) => | ||
isUpdateSanpShots | ||
? `http://127.0.0.1:5252/samples/${id}.html` | ||
: `/samples/${id}` | ||
|
||
test("ScreenShot 렌더링 결과 비교", async ({ page }, testInfo) => { | ||
const url = getUrl("addMapControl", testInfo.config.updateSnapshots === "all") | ||
await page.goto(url, { waitUntil: "networkidle" }) | ||
await expect(page).toHaveScreenshot() | ||
}) |
Binary file added
BIN
+187 KB
...est__/addMapControl.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+214 KB
...test__/addMapControl.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+179 KB
..._test__/addMapControl.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.