$(function(){var map =newrouto.maps.Map("map",{center:{lat:37.507009,lng:127.0586339},// 지도 초기 위치zoom:18,// 지도 로딩 시 최초 표시 레벨});var polyline =null;$("#create-polyline").click(function(){
polyline =newrouto.maps.Polyline({path:[{"lng":127.04816255600583,"lat":37.51890637226832},{"lng":127.07215223343503,"lat":37.51730654989123},{"lng":127.07391176254882,"lat":37.50610683290664}]});
polyline.setMap(map);
map.fitBounds(polyline.getBounds(),{top:170,right:50,bottom:30,left:150,});});$("#delete-polyline").click(function(){
polyline.setMap(null);
polyline =null;});});
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"/><title>폴리라인 생성 삭제하기</title><style>html,
body{margin: 0;padding: 0;width: 100%;height: 100%;}.map{width: 100%;height: 400px;position: relative;}</style></head><body><h2>폴리라인 생성 삭제하기</h2><hr/><p>
지도위에 폴리라인 도형을 생성 삭제 할 수 있습니다.
</p><divclass="map-container"><divclass="map-tool-bar"><buttonid="create-polyline"class="cs-btn3">폴리라인 생성하기</button><buttonid="delete-polyline"class="cs-btn3">폴리라인 삭제하기</button></div><divid="map"class="map"></div></div></body><scriptsrc="https://code.jquery.com/jquery-3.6.0.min.js"></script><scriptsrc="https://api.routo.com/v2/maps/map?key=12290cd4-7094-43e8-a936-8819196d0332&callback=initMap"></script><script>$(function(){var map =newrouto.maps.Map("map",{center:{lat:37.507009,lng:127.0586339},// 지도 초기 위치zoom:18,// 지도 로딩 시 최초 표시 레벨});var polyline =null;$("#create-polyline").click(function(){
polyline =newrouto.maps.Polyline({path:[{"lng":127.04816255600583,"lat":37.51890637226832},{"lng":127.07215223343503,"lat":37.51730654989123},{"lng":127.07391176254882,"lat":37.50610683290664}]});
polyline.setMap(map);
map.fitBounds(polyline.getBounds(),{top:170,right:50,bottom:30,left:150,});});$("#delete-polyline").click(function(){
polyline.setMap(null);
polyline =null;});});</script></html>