Google지도에 마커를 추가했습니다. editable: true
을 설정하여 Rectangle을 크기를 조정할 수있는 것처럼 Google지도에 배치 한 후 마커 이미지의 크기를 조정할 수있는 방법이 있습니까?Google지도에서 동적으로 마커 이미지 크기 조정
마커 이미지의 크기를 설정하는 데는 scaledSize
및 size
속성이 있지만 크기가 다른 것으로 알고 있습니다. 마커 크기를 조정할 수있는 방법은 무엇입니까?
다음은 사용중인 샘플 코드입니다. 지도 설명서 섹션에서 가져 왔습니다.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 4,
center: myLatlng
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
마커는 편집 할 수 없습니다. 크기를 변경할 수는 있지만이를 수행하기 위해 마커 아이콘을 수정하는 코드를 작성해야합니다. 귀하의 문제를 보여주는 [최소, 완료, 검증되고 읽을 수있는 예] (http://stackoverflow.com/help/mcve)를 제공해주십시오. – geocodezip