노강호

window.kakao가 불러와지지 않음

...@@ -3046,6 +3046,14 @@ ...@@ -3046,6 +3046,14 @@
3046 "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.2.1.tgz", 3046 "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.2.1.tgz",
3047 "integrity": "sha512-evY7DN8qSIbsW2H/TWQ1bX3sXN1d4MNb5Vb4n7BzPuCwRHdkZ1H2eNLuSh73EoQqkGKUtju2G2HCcjCfhvZIAA==" 3047 "integrity": "sha512-evY7DN8qSIbsW2H/TWQ1bX3sXN1d4MNb5Vb4n7BzPuCwRHdkZ1H2eNLuSh73EoQqkGKUtju2G2HCcjCfhvZIAA=="
3048 }, 3048 },
3049 + "axios": {
3050 + "version": "0.21.1",
3051 + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
3052 + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
3053 + "requires": {
3054 + "follow-redirects": "^1.10.0"
3055 + }
3056 + },
3049 "axobject-query": { 3057 "axobject-query": {
3050 "version": "2.2.0", 3058 "version": "2.2.0",
3051 "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", 3059 "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz",
...@@ -7090,6 +7098,19 @@ ...@@ -7090,6 +7098,19 @@
7090 "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", 7098 "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz",
7091 "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" 7099 "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ=="
7092 }, 7100 },
7101 + "history": {
7102 + "version": "4.10.1",
7103 + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
7104 + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
7105 + "requires": {
7106 + "@babel/runtime": "^7.1.2",
7107 + "loose-envify": "^1.2.0",
7108 + "resolve-pathname": "^3.0.0",
7109 + "tiny-invariant": "^1.0.2",
7110 + "tiny-warning": "^1.0.0",
7111 + "value-equal": "^1.0.1"
7112 + }
7113 + },
7093 "hmac-drbg": { 7114 "hmac-drbg": {
7094 "version": "1.0.1", 7115 "version": "1.0.1",
7095 "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", 7116 "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
...@@ -7100,6 +7121,14 @@ ...@@ -7100,6 +7121,14 @@
7100 "minimalistic-crypto-utils": "^1.0.1" 7121 "minimalistic-crypto-utils": "^1.0.1"
7101 } 7122 }
7102 }, 7123 },
7124 + "hoist-non-react-statics": {
7125 + "version": "3.3.2",
7126 + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
7127 + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==",
7128 + "requires": {
7129 + "react-is": "^16.7.0"
7130 + }
7131 + },
7103 "hoopy": { 7132 "hoopy": {
7104 "version": "0.1.4", 7133 "version": "0.1.4",
7105 "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", 7134 "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz",
...@@ -9947,6 +9976,15 @@ ...@@ -9947,6 +9976,15 @@
9947 "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", 9976 "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
9948 "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" 9977 "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="
9949 }, 9978 },
9979 + "mini-create-react-context": {
9980 + "version": "0.4.1",
9981 + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz",
9982 + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==",
9983 + "requires": {
9984 + "@babel/runtime": "^7.12.1",
9985 + "tiny-warning": "^1.0.3"
9986 + }
9987 + },
9950 "mini-css-extract-plugin": { 9988 "mini-css-extract-plugin": {
9951 "version": "0.11.3", 9989 "version": "0.11.3",
9952 "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz", 9990 "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz",
...@@ -12431,6 +12469,52 @@ ...@@ -12431,6 +12469,52 @@
12431 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz", 12469 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz",
12432 "integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==" 12470 "integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg=="
12433 }, 12471 },
12472 + "react-router": {
12473 + "version": "5.2.0",
12474 + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
12475 + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==",
12476 + "requires": {
12477 + "@babel/runtime": "^7.1.2",
12478 + "history": "^4.9.0",
12479 + "hoist-non-react-statics": "^3.1.0",
12480 + "loose-envify": "^1.3.1",
12481 + "mini-create-react-context": "^0.4.0",
12482 + "path-to-regexp": "^1.7.0",
12483 + "prop-types": "^15.6.2",
12484 + "react-is": "^16.6.0",
12485 + "tiny-invariant": "^1.0.2",
12486 + "tiny-warning": "^1.0.0"
12487 + },
12488 + "dependencies": {
12489 + "isarray": {
12490 + "version": "0.0.1",
12491 + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
12492 + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
12493 + },
12494 + "path-to-regexp": {
12495 + "version": "1.8.0",
12496 + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
12497 + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
12498 + "requires": {
12499 + "isarray": "0.0.1"
12500 + }
12501 + }
12502 + }
12503 + },
12504 + "react-router-dom": {
12505 + "version": "5.2.0",
12506 + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz",
12507 + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==",
12508 + "requires": {
12509 + "@babel/runtime": "^7.1.2",
12510 + "history": "^4.9.0",
12511 + "loose-envify": "^1.3.1",
12512 + "prop-types": "^15.6.2",
12513 + "react-router": "5.2.0",
12514 + "tiny-invariant": "^1.0.2",
12515 + "tiny-warning": "^1.0.0"
12516 + }
12517 + },
12434 "react-scripts": { 12518 "react-scripts": {
12435 "version": "4.0.3", 12519 "version": "4.0.3",
12436 "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz", 12520 "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz",
...@@ -12795,6 +12879,11 @@ ...@@ -12795,6 +12879,11 @@
12795 "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 12879 "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
12796 "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" 12880 "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
12797 }, 12881 },
12882 + "resolve-pathname": {
12883 + "version": "3.0.0",
12884 + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
12885 + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
12886 + },
12798 "resolve-url": { 12887 "resolve-url": {
12799 "version": "0.2.1", 12888 "version": "0.2.1",
12800 "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", 12889 "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
...@@ -14429,6 +14518,16 @@ ...@@ -14429,6 +14518,16 @@
14429 "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", 14518 "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
14430 "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" 14519 "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q="
14431 }, 14520 },
14521 + "tiny-invariant": {
14522 + "version": "1.1.0",
14523 + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",
14524 + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw=="
14525 + },
14526 + "tiny-warning": {
14527 + "version": "1.0.3",
14528 + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
14529 + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
14530 + },
14432 "tmpl": { 14531 "tmpl": {
14433 "version": "1.0.4", 14532 "version": "1.0.4",
14434 "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", 14533 "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz",
...@@ -14889,6 +14988,11 @@ ...@@ -14889,6 +14988,11 @@
14889 "spdx-expression-parse": "^3.0.0" 14988 "spdx-expression-parse": "^3.0.0"
14890 } 14989 }
14891 }, 14990 },
14991 + "value-equal": {
14992 + "version": "1.0.1",
14993 + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
14994 + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
14995 + },
14892 "vary": { 14996 "vary": {
14893 "version": "1.1.2", 14997 "version": "1.1.2",
14894 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 14998 "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
......
...@@ -6,16 +6,17 @@ ...@@ -6,16 +6,17 @@
6 "@testing-library/jest-dom": "^5.12.0", 6 "@testing-library/jest-dom": "^5.12.0",
7 "@testing-library/react": "^11.2.7", 7 "@testing-library/react": "^11.2.7",
8 "@testing-library/user-event": "^12.8.3", 8 "@testing-library/user-event": "^12.8.3",
9 + "axios": "^0.21.1",
10 + "express": "^4.17.1",
9 "react": "^17.0.2", 11 "react": "^17.0.2",
10 "react-dom": "^17.0.2", 12 "react-dom": "^17.0.2",
13 + "react-router-dom": "^5.2.0",
11 "react-scripts": "4.0.3", 14 "react-scripts": "4.0.3",
12 "web-vitals": "^1.1.2" 15 "web-vitals": "^1.1.2"
13 }, 16 },
14 "scripts": { 17 "scripts": {
15 "start": "react-scripts start", 18 "start": "react-scripts start",
16 - "build": "react-scripts build", 19 + "build": "react-scripts build"
17 - "test": "react-scripts test",
18 - "eject": "react-scripts eject"
19 }, 20 },
20 "eslintConfig": { 21 "eslintConfig": {
21 "extends": [ 22 "extends": [
...@@ -36,3 +37,4 @@ ...@@ -36,3 +37,4 @@
36 ] 37 ]
37 } 38 }
38 } 39 }
40 +
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 -<html lang="en"> 2 +<html lang="ko">
3 <head> 3 <head>
4 + <script
5 + type="text/javascript"
6 + src="//dapi.kakao.com/v2/maps/sdk.js?appkey=059ebad3d5ccd28178357c542b8c80d1&libraries=services"
7 + ></script>
4 <meta charset="utf-8" /> 8 <meta charset="utf-8" />
5 <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> 9 <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6 <meta name="viewport" content="width=device-width, initial-scale=1" /> 10 <meta name="viewport" content="width=device-width, initial-scale=1" />
...@@ -24,7 +28,7 @@ ...@@ -24,7 +28,7 @@
24 work correctly both with client-side routing and a non-root public URL. 28 work correctly both with client-side routing and a non-root public URL.
25 Learn how to configure a non-root public URL by running `npm run build`. 29 Learn how to configure a non-root public URL by running `npm run build`.
26 --> 30 -->
27 - <title>React App</title> 31 + <title>Momokji</title>
28 </head> 32 </head>
29 <body> 33 <body>
30 <noscript>You need to enable JavaScript to run this app.</noscript> 34 <noscript>You need to enable JavaScript to run this app.</noscript>
......
1 -import logo from './logo.svg'; 1 +import React, { Component } from "react";
2 -import './App.css'; 2 +import { BrowserRouter, HashRouter, Route } from "react-router-dom";
3 +import "./App.css";
4 +import Home from "./routes/Home";
3 5
4 function App() { 6 function App() {
5 return ( 7 return (
6 - <div className="App"> 8 + <BrowserRouter>
7 - <header className="App-header"> 9 + <Route path="/" exact={true} component={Home} />
8 - <img src={logo} className="App-logo" alt="logo" /> 10 + </BrowserRouter>
9 - <p>
10 - Edit <code>src/App.js</code> and save to reload.
11 - </p>
12 - <a
13 - className="App-link"
14 - href="https://reactjs.org"
15 - target="_blank"
16 - rel="noopener noreferrer"
17 - >
18 - Learn React
19 - </a>
20 - </header>
21 - </div>
22 ); 11 );
23 } 12 }
24 -
25 export default App; 13 export default App;
......
1 -import { render, screen } from '@testing-library/react';
2 -import App from './App';
3 -
4 -test('renders learn react link', () => {
5 - render(<App />);
6 - const linkElement = screen.getByText(/learn react/i);
7 - expect(linkElement).toBeInTheDocument();
8 -});
1 +.map_wrap,
2 +.map_wrap * {
3 + margin: 0;
4 + padding: 0;
5 + font-family: "Malgun Gothic", dotum, "돋움", sans-serif;
6 + font-size: 12px;
7 +}
8 +.map_wrap a,
9 +.map_wrap a:hover,
10 +.map_wrap a:active {
11 + color: #000;
12 + text-decoration: none;
13 +}
14 +.map_wrap {
15 + position: relative;
16 + width: 100%;
17 + height: 500px;
18 +}
19 +#menu_wrap {
20 + position: absolute;
21 + top: 0;
22 + left: 0;
23 + bottom: 0;
24 + width: 250px;
25 + margin: 10px 0 30px 10px;
26 + padding: 5px;
27 + overflow-y: auto;
28 + background: rgba(255, 255, 255, 0.7);
29 + z-index: 1;
30 + font-size: 12px;
31 + border-radius: 10px;
32 +}
33 +.bg_white {
34 + background: #fff;
35 +}
36 +#menu_wrap hr {
37 + display: block;
38 + height: 1px;
39 + border: 0;
40 + border-top: 2px solid #5f5f5f;
41 + margin: 3px 0;
42 +}
43 +#menu_wrap .option {
44 + text-align: center;
45 +}
46 +#menu_wrap .option p {
47 + margin: 10px 0;
48 +}
49 +#menu_wrap .option button {
50 + margin-left: 5px;
51 +}
52 +#placesList li {
53 + list-style: none;
54 +}
55 +#placesList .item {
56 + position: relative;
57 + border-bottom: 1px solid #888;
58 + overflow: hidden;
59 + cursor: pointer;
60 + min-height: 65px;
61 +}
62 +#placesList .item span {
63 + display: block;
64 + margin-top: 4px;
65 +}
66 +#placesList .item h5,
67 +#placesList .item .info {
68 + text-overflow: ellipsis;
69 + overflow: hidden;
70 + white-space: nowrap;
71 +}
72 +#placesList .item .info {
73 + padding: 10px 0 10px 55px;
74 +}
75 +#placesList .info .gray {
76 + color: #8a8a8a;
77 +}
78 +#placesList .info .jibun {
79 + padding-left: 26px;
80 + background: url(https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/places_jibun.png)
81 + no-repeat;
82 +}
83 +#placesList .info .tel {
84 + color: #009900;
85 +}
86 +#placesList .item .markerbg {
87 + float: left;
88 + position: absolute;
89 + width: 36px;
90 + height: 37px;
91 + margin: 10px 0 0 10px;
92 + background: url(https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/marker_number_blue.png)
93 + no-repeat;
94 +}
95 +#placesList .item .marker_1 {
96 + background-position: 0 -10px;
97 +}
98 +#placesList .item .marker_2 {
99 + background-position: 0 -56px;
100 +}
101 +#placesList .item .marker_3 {
102 + background-position: 0 -102px;
103 +}
104 +#placesList .item .marker_4 {
105 + background-position: 0 -148px;
106 +}
107 +#placesList .item .marker_5 {
108 + background-position: 0 -194px;
109 +}
110 +#placesList .item .marker_6 {
111 + background-position: 0 -240px;
112 +}
113 +#placesList .item .marker_7 {
114 + background-position: 0 -286px;
115 +}
116 +#placesList .item .marker_8 {
117 + background-position: 0 -332px;
118 +}
119 +#placesList .item .marker_9 {
120 + background-position: 0 -378px;
121 +}
122 +#placesList .item .marker_10 {
123 + background-position: 0 -423px;
124 +}
125 +#placesList .item .marker_11 {
126 + background-position: 0 -470px;
127 +}
128 +#placesList .item .marker_12 {
129 + background-position: 0 -516px;
130 +}
131 +#placesList .item .marker_13 {
132 + background-position: 0 -562px;
133 +}
134 +#placesList .item .marker_14 {
135 + background-position: 0 -608px;
136 +}
137 +#placesList .item .marker_15 {
138 + background-position: 0 -654px;
139 +}
140 +#pagination {
141 + margin: 10px auto;
142 + text-align: center;
143 +}
144 +#pagination a {
145 + display: inline-block;
146 + margin-right: 10px;
147 +}
148 +#pagination .on {
149 + font-weight: bold;
150 + cursor: default;
151 + color: #777;
152 +}
1 +/*global kakao*/
2 +import React, { useEffect } from "react";
3 +
4 +const Map = () => {
5 + useEffect(() => {
6 + var mapContainer = document.getElementById("map");
7 + var mapOption = {
8 + center: new kakao.maps.LatLng(37.365264512305174, 127.10676860117488),
9 + level: 3,
10 + };
11 +
12 + var map = new kakao.maps.Map(mapContainer, mapOption);
13 + var markerPosition = new kakao.maps.LatLng(
14 + 37.365264512305174,
15 + 127.10676860117488
16 + );
17 + var marker = new kakao.maps.Marker({
18 + position: markerPosition,
19 + });
20 + marker.setMap(map);
21 + }, []);
22 +
23 + return (
24 + <div
25 + id="map"
26 + style="width: 100%; height: 100%; position: relative; overflow: hidden"
27 + ></div>
28 + );
29 +};
30 +
31 +export default Map;
1 +import React, { useState } from "react";
2 +import MapContainer from "./Sections/MapContainer";
3 +
4 +function LandingPage() {
5 + const [InputText, setInputText] = useState("");
6 + const [Place, setPlace] = useState("");
7 +
8 + const onChange = (e) => {
9 + setInputText(e.target.value);
10 + };
11 +
12 + const handleSubmit = (e) => {
13 + e.preventDefault();
14 + setPlace(InputText);
15 + setInputText("");
16 + };
17 +
18 + return (
19 + <>
20 + <form className="inputForm" onSubmit={handleSubmit}>
21 + <input
22 + placeholder="검색어를 입력하세요"
23 + onChange={onChange}
24 + value={InputText}
25 + />
26 + <button type="submit">검색</button>
27 + </form>
28 + <MapContainer searchPlace={Place} />
29 + </>
30 + );
31 +}
32 +
33 +export default LandingPage;
1 +import React, { useEffect } from "react";
2 +
3 +const { kakao } = window;
4 +console.log(kakao);
5 +console.log(window);
6 +
7 +const MapContainer = ({ searchPlace }) => {
8 + useEffect(() => {
9 + var infowindow = new kakao.maps.InfoWindow({ zIndex: 1 });
10 + const container = document.getElementById("myMap");
11 + const options = {
12 + center: new kakao.maps.LatLng(33.450701, 126.570667),
13 + level: 3,
14 + };
15 + const map = new kakao.maps.Map(container, options);
16 +
17 + const ps = new kakao.maps.services.Places();
18 +
19 + ps.keywordSearch(searchPlace, placesSearchCB);
20 +
21 + function placesSearchCB(data, status, pagination) {
22 + if (status === kakao.maps.services.Status.OK) {
23 + let bounds = new kakao.maps.LatLngBounds();
24 +
25 + for (let i = 0; i < data.length; i++) {
26 + displayMarker(data[i]);
27 + bounds.extend(new kakao.maps.LatLng(data[i].y, data[i].x));
28 + }
29 +
30 + map.setBounds(bounds);
31 + }
32 + }
33 +
34 + function displayMarker(place) {
35 + let marker = new kakao.maps.Marker({
36 + map: map,
37 + position: new kakao.maps.LatLng(place.y, place.x),
38 + });
39 +
40 + // 마커에 클릭이벤트를 등록합니다
41 + kakao.maps.event.addListener(marker, "click", function () {
42 + // 마커를 클릭하면 장소명이 인포윈도우에 표출됩니다
43 + infowindow.setContent(
44 + '<div style="padding:5px;font-size:12px;">' +
45 + place.place_name +
46 + "</div>"
47 + );
48 + infowindow.open(map, marker);
49 + });
50 + }
51 + }, [searchPlace]);
52 +
53 + return (
54 + <div
55 + id="myMap"
56 + style={{
57 + width: "500px",
58 + height: "500px",
59 + }}
60 + ></div>
61 + );
62 +};
63 +
64 +export default MapContainer;
1 -body {
2 - margin: 0;
3 - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 - sans-serif;
6 - -webkit-font-smoothing: antialiased;
7 - -moz-osx-font-smoothing: grayscale;
8 -}
9 -
10 -code {
11 - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 - monospace;
13 -}
1 import React from 'react'; 1 import React from 'react';
2 import ReactDOM from 'react-dom'; 2 import ReactDOM from 'react-dom';
3 -import './index.css';
4 import App from './App'; 3 import App from './App';
5 -import reportWebVitals from './reportWebVitals';
6 4
7 ReactDOM.render( 5 ReactDOM.render(
8 <React.StrictMode> 6 <React.StrictMode>
...@@ -10,8 +8,3 @@ ReactDOM.render( ...@@ -10,8 +8,3 @@ ReactDOM.render(
10 </React.StrictMode>, 8 </React.StrictMode>,
11 document.getElementById('root') 9 document.getElementById('root')
12 ); 10 );
13 -
14 -// If you want to start measuring performance in your app, pass a function
15 -// to log results (for example: reportWebVitals(console.log))
16 -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 -reportWebVitals();
......
1 -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
...\ No newline at end of file ...\ No newline at end of file
1 -const reportWebVitals = onPerfEntry => {
2 - if (onPerfEntry && onPerfEntry instanceof Function) {
3 - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 - getCLS(onPerfEntry);
5 - getFID(onPerfEntry);
6 - getFCP(onPerfEntry);
7 - getLCP(onPerfEntry);
8 - getTTFB(onPerfEntry);
9 - });
10 - }
11 -};
12 -
13 -export default reportWebVitals;
1 +import React, { useEffect } from "react";
2 +import MapContainer from "../components/views/Landing/Sections/MapContainer";
3 +
4 +const Home = () => {
5 + return (
6 + <div>
7 + <MapContainer />
8 + </div>
9 + );
10 +};
11 +
12 +export default Home;
1 -// jest-dom adds custom jest matchers for asserting on DOM nodes.
2 -// allows you to do things like:
3 -// expect(element).toHaveTextContent(/react/i)
4 -// learn more: https://github.com/testing-library/jest-dom
5 -import '@testing-library/jest-dom';