1
Google의 사용자 지정 컨트롤 용 이미지를 만들려고합니다. CSS에서 배경 그림을 지정할 때 끊어 지거나 그렇지 않으면 작동합니다.DIV에 대한 배경 그림을 추가하는 방법, Google지도 사용자 지정 컨트롤
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var myLocationControlDiv = document.createElement('DIV');
var controlUI = document.createElement('DIV');
//controlUI.style.borderWidth = '20px';
//controlUI.style.backgroundColor = 'black';
//controlUI.style.borderStyle = 'solid';
//controlUI.style.cursor = 'pointer';
//controlUI.style.backgroundImage = "url(/img/icons/pin.png)";
controlUI.title = 'Click to set the map to Home';
myLocationControlDiv.appendChild(controlUI);
map.controls[google.maps.ControlPosition.TOP_LEFT].push(controlUI);
또한 여기에서 볼 수 있습니다 http://jsfiddle.net/k3Jjw/