카카오맵 세로길이 고정 방법 문의드립니다.
본문
아래는 비타주리님의 카카오맵 자바스크립트 소스인데요.
피씨에서는 적당한 크기로 나오는데 모바일에서 세로길이가 너무 작아서요.
피씨나 모바일 모두 세로길이를 px로 고정할수 있은 방법이 있을까요?
제가 필요해서요! 그누초보라 아무리 해봐도 안되서 문의드려봅니다.
<script src="https://ssl.daumcdn.net/dmaps/map_js_init/roughmapLoader.js"></script>
<script>
function kakaoMap(...map) {
document.write("<div id='" + "daumRoughmapContainer" + map[0] + "' class='root_daum_roughmap root_daum_roughmap_landing' style='width:100%;box-sizing:border-box'></div>");
new daum.roughmap.Lander({
"timestamp" : map[0], "key" : map[1], "mapWidth" : "100%",
"mapHeight" : document.querySelector("#daumRoughmapContainer" + map[0]).offsetWidth * map[2] / 100 - 32
}).render();
}
</script>
<div style="width:100%"><script>kakaoMap("1669739269026", "2csge", 50);</script></div>
답변 2
잘은 모르겠으나...
style="width:100%"
위에껄 아래꺼로 px갑은 원하는데로 조정...
style="width:100%;height:400px;max-height:500px;"
"timestamp" : map[0], "key" : map[1], "mapWidth" : "100%",
"mapHeight" : document.querySelector("#daumRoughmapContainer" + map[0]).offsetWidth * map[2]
위 구간에서
"mapWidth" : "100%", => "mapWidth" : "100px",
"mapHeight" : document.querySelector("#daumRoughmapContainer" + map[0]).offsetWidth * map[2] => "mapHeight" : "100px"
이렇게 넣었을 때 바뀌지 않을까요?
!-->