WEB GL JS

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

지도 zoom 레벨 변경


routogl 지도의 Zoom 레벨을 변경하는 예제입니다.

const map = new routogl.Map({
  container: 'map', // container ID
  style: routogl.RoutoStyle.LIGHT,
  center: [127.0586339, 37.507009], // 초기 위치 [lng, lat]
  zoom: 17, // 초기 줌 레벨
});

// 지도 Zoom 레벨 변경
const plus = document.getElementById('plus');
plus.addEventListener('click', () => {
  map.setZoom(Math.floor(map.getZoom()) + 1);
});

const minus = document.getElementById('minus');
minus.addEventListener('click', () => {
  map.setZoom(Math.floor(map.getZoom()) - 1);
});