Skip to content

Commit

Permalink
fix: Change Map props name
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeSeoKim committed Aug 5, 2021
1 parent 7f022c9 commit 14ad725
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.0.8
- Map position prop 이름 center 로 롤백

### 0.0.7
- useRelayout 추가
- MapInfoWindow 추가
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-kakao-maps-sdk",
"version": "0.0.7",
"version": "0.0.8",
"author": {
"name": "JaeSeoKim",
"email": "[email protected]",
Expand Down
12 changes: 6 additions & 6 deletions src/lib/Kakaomap/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface MapProps {
/**
* 중심으로 설정할 위치 입니다.
*/
position: {
center: {
lat: number;
lng: number;
};
Expand Down Expand Up @@ -110,7 +110,7 @@ const Map: React.FC<MapProps> = ({
style,
containerElem,
children,
position,
center,
className,
loading = false,
options,
Expand All @@ -124,7 +124,7 @@ const Map: React.FC<MapProps> = ({

kakao.maps.load(() => {
// 초기 위치 객체 생성
const initalMapCenter = new kakao.maps.LatLng(position.lat, position.lng);
const initalMapCenter = new kakao.maps.LatLng(center.lat, center.lng);

// kakaoMap 객체 생성
const kakaoMap = new kakao.maps.Map(containerElem, {
Expand Down Expand Up @@ -161,7 +161,7 @@ const Map: React.FC<MapProps> = ({

kakao.maps.load(() => {
// 초기 위치 객체 생성
const initalMapCenter = new kakao.maps.LatLng(position.lat, position.lng);
const initalMapCenter = new kakao.maps.LatLng(center.lat, center.lng);

// kakaoMap 객체 생성
const kakaoMap = new kakao.maps.Map(container.current as HTMLDivElement, {
Expand All @@ -178,8 +178,8 @@ const Map: React.FC<MapProps> = ({
useEffect(() => {
if (!map) return;

map.setCenter(new kakao.maps.LatLng(position.lat, position.lng));
}, [map, position]);
map.setCenter(new kakao.maps.LatLng(center.lat, center.lng));
}, [map, center]);

useEffect(() => {
if (!map || containerElem) return;
Expand Down

0 comments on commit 14ad725

Please sign in to comment.