zeakd / react-naver-maps

React Navermaps API integration for modern development.
https://zeakd.github.io/react-naver-maps/
118 stars 23 forks source link

infoWindow 사용 관련 문의드립니다. #30

Closed khchoi0301 closed 1 year ago

khchoi0301 commented 4 years ago

라이브러리에서 infoWindow 사용이 가능할까요? https://navermaps.github.io/maps.js.ncp/docs/tutorial-1-infowindow-simple.example.html

hwimin-kim commented 4 years ago
const infoWindowContent = [
            '<div class="iw_inner">',
            '   <h3>서울특별시청</h3>',
            '   <p>서울특별시 중구 태평로1가 31 | 서울특별시 중구 세종대로 110 서울특별시청<br />',
            '       <img src="' + '/img/example/hi-seoul.jpg" width="55" height="55" alt="서울시청" class="thumb" /><br />',
            '       02-120 | 공공,사회기관 &gt; 특별,광역시청<br />',
            '       <a href="http://www.seoul.go.kr" target="_blank">www.seoul.go.kr/</a>',
            '   </p>',
            '</div>'
        ].join('');
  const infoWindow = new window.N.InfoWindow({
            position: new window.N.LatLng(lat, lng),
            content: infoWindowContent,
            /*maxWidth: 140,
            backgroundColor: "#eee",
            borderColor: "#2db400",
            borderWidth: 5,
            anchorSize: new window.N.Size(30, 30),
            anchorSkew: true,
            anchorColor: "#eee",

            pixelOffset: new window.N.Point(20, -20)*/
        });
  if (infoWindow.getMap()) {
      infoWindow.close();
    } else {
      infoWindow.open(this.props.getMap());
    }
  }

삭제하는건 잘안되내요

zeakd commented 4 years ago

@khchoi0301 @hwimin-kim 안녕하세요 InfoWindow의 경우 Overlay이긴 합니다만 api 자체가 React의 성격에 반하여, React 방향대로 사용할 수 있는 방법을 찾고 있습니다. 슬프게도 아직은 react-naver-maps에서 사용할 수 있는 API는 없으며, 직접 navermaps 객체를 참고하여 사용하셔야합니다. 정리가 되는대로 배포하도록 하겠습니다.

zeakd commented 4 years ago

앗 닫을 생각이 아니었는데 실수로 닫아버렸네요. :pray: 다시오픈합니다

khchoi0301 commented 4 years ago

@zeakd 직접 navermaps 객체를 참고하는건 어떻게 해야할까요??? react-naver-maps 랑 같이 쓸 수 있는 건가요?? 리액트에 적용된 sample code를 구할 수 있을까요??

SmithHyun commented 3 years ago

진행 상황이 궁금합니다. 여전히 오픈 상태인것 같아서요. 리액트에서 인포윈도우 사용하고 싶습니다.

zeakd commented 3 years ago

@SmithHyun 전반적인 재설계가 이루어질 예정입니다. 이번 재설계에 반영하도록 하겠습니다.

zeakd commented 1 year ago

0.1.0 에서 추가예정이며 #65 에서 팔로우업 부탁드립니다.