WEB GL JS

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

지도 종류 변경


routogl 지도의 종류를 변경하는 예제입니다.

지도 종류에는 "Light", "Dark", "Hybrid" 가 있습니다.

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

// 지도 종류 선택 이벤트
const selectMap = document.getElementById('selectMap');
selectMap.addEventListener('change', (e) => {
  const type = e.target.value;
  if(type === 'light') {
    map.setStyle(routogl.RoutoStyle.LIGHT);
  }
  else if(type === 'dark') {
    map.setStyle(routogl.RoutoStyle.DARK);
  }
  else if(type === 'hybrid') {
    map.setStyle(routogl.RoutoStyle.HYBRID);
  }
});