2011-11-22 5 views
1

내지도에 타일을 추가했습니다. 내가 지금 원하는 것은 :지도 위에서 클릭하면 클릭 한 타일의 배경색을 변경하고 싶습니다. 어떻게해야합니까? 그것은 가능한가?Google지도에서 타일의 배경색을 변경하십시오.

내지도에 타일을 추가하기 위해 내가 사용한 코드는 (구글지도 API V3에서)입니다 :

<script> 

    function CoordMapType(tileSize) { 
    this.tileSize = tileSize; 
    } 

    CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) { 
    var div = ownerDocument.createElement('DIV'); 
    div.style.width = this.tileSize.width + 'px'; 
    div.style.height = this.tileSize.height + 'px'; 
    div.style.fontSize = '10'; 
    div.style.borderStyle = 'solid'; 
    div.style.borderWidth = '1px'; 
    div.style.borderColor = '#AAAAAA'; 
    return div; 
    }; 

    var map; 
    var chicago = new google.maps.LatLng(41.850033,-87.6500523); 

    function initialize() { 
    var mapOptions = { 
     zoom: 10, 
     center: chicago, 
     mapTypeId: google.maps.MapTypeId.ROADMAP 
    }; 
    map = new google.maps.Map(document.getElementById("map"), 
             mapOptions); 

    // Insert this overlay map type as the first overlay map type at 
    // position 0. Note that all overlay map types appear on top of 
    // their parent base map. 
    map.overlayMapTypes.insertAt(
     0, new CoordMapType(new google.maps.Size(256, 256))); 
    } 
</script> 

답변

관련 문제