WEB JS

    웹 개발, 어플리케이션에서 활용될 수 있도록 Javascript로 제공되는 지도 플랫폼 입니다.

    원 생성 삭제하기


    지도위에 원 도형을 생성 삭제 할 수 있습니다.

    $(function () {
      var map = new routo.maps.Map("map", {
        center: { lat: 37.507009, lng: 127.0586339 }, // 지도 초기 위치
        zoom: 18, // 지도 로딩 시 최초 표시 레벨
      });
    
      var circle = null;
      $("#create-circle").click(function () {
        circle = new routo.maps.Circle({
          center: { lat: 37.507009, lng: 127.0406339 },
          radius: 200,
        });
        circle.setMap(map);
    
        map.fitBounds(circle.getBounds(), {
          top: 170,
          right: 50,
          bottom: 30,
          left: 150,
        })
      });
    
      $("#delete-circle").click(function () {
        circle.setMap(null);
        circle = null;
      });
    });