2011-03-18 7 views

답변

0

마커 속성을 사용자 지정하고이를 위해 맞춤 마커 및 그림자 이미지를 사용해야합니다. 하지만 이것은 Map API 2에서 이미 유감스럽게 생각합니다.

var normal_icon = new GIcon(); 
normal_icon.image = "images/google_marker_green.png"; 
normal_icon.shadow = "images/shadow-google_marker_green.png"; 
normal_icon.iconSize = new GSize(20.0, 34.0); 
normal_icon.shadowSize = new GSize(38.0, 34.0); 
normal_icon.iconAnchor = new GPoint(10.0, 17.0); 
normal_icon.infoWindowAnchor = new GPoint(10.0, 17.0); 

var hover_icon = new GIcon(); 
hover_icon.image = "images/google_marker_blue.png"; 
hover_icon.shadow = "images/shadow-google_marker_blue.png"; 
hover_icon.iconSize = new GSize(20.0, 34.0); 
hover_icon.shadowSize = new GSize(38.0, 34.0); 
hover_icon.iconAnchor = new GPoint(10.0, 17.0); 
hover_icon.infoWindowAnchor = new GPoint(10.0, 17.0); 

var lat="Your lat. point"; 
var long="Your long. point"; 

map = new google.maps.Map2(document.getElementById("map")); 
map.setCenter(new google.maps.LatLng(lat, long), 15); 
map.setUIToDefault(); 
var point = new GLatLng(lat,long); 
var marker = new GMarker(point,normal_icon); 
var message="Custom message"; 
GEvent.addListener(marker, "click", function() { 
    map.openInfoWindowHtml(point, message); 
}); 
map.addOverlay(marker); 

function bindInfoWindow(marker, map, infoWindow, html) { 
     google.maps.event.addListener(marker, 'mouseover', function() { 
     marker.setIcon(hover_icon); 
     }); 
     google.maps.event.addListener(marker, 'mouseout', function() { 
     marker.setIcon(normal_icon); 
     }); 
    } 

당신은

Haresh

+0

링크를 http://smmtn.com/sandbox/gmaps-marker-hover/

감사 감사에서 정확한 예를 찾을 수 없습니다 실행 ... 당신이 다른 링크를 제공 할 수 있습니까? – 151291

관련 문제