2013-09-16 3 views
0

마커에서 이미지를 사용할 때 Google지도에서 이미지를 가져 오는 중 있지만 infowindow에 대해 동일한 이미지를 사용할 때 URL 만 표시됩니다.infowindow setContent에 정적 리소스를 사용하는 방법?

코드 :

var content = '<div class="map-content"><h3>' + "Account Name: " + "{!acc.Name} " + 
    '</h3>' + '<b>' +"Location: " + "{!acc.BillingCity}" + '</b>' + '</br>' +   
    "Direction : " + '<a href="http://maps.google.com/?daddr=' + "{!acc.BillingCity}" + 
    '" target="_blank">Get Directions</a>' + "{!$Resource.Image_GoogleMap}" +'</div>'; 

        google.maps.event.addListener(marker, 'mouseover', function() { 
         infowindow.open(map, this); 
         infowindow.setContent(content); 
        }); 

사용하는 방법 "{$ Resource.Image_GoogleMap!}"구글 맵 정보창에서 이미지를 표시합니다. 어느 누구도 나를 도울 수 있습니까?

+0

''{! $ Resource.Image_GoogleMap}''이 무엇입니까? –

+0

Joni가 빠른 답장을 보내 주셔서 감사합니다. 예,이 URL은 이미지이며 현재는 infowindow에서 잘 작동하고 이미지를 보여줍니다. – DINESH

답변

0

{!$Resource.Image_GoogleMap} 경우 이미지의 URL, 당신은 사용 정보창에 표시 할 normal HTM L합니다 :

<img src="{!$Resource.Image_GoogleMap}" alt="image description"> 

(제대로 "를 일치하도록주의 '와)

var content = '<div class="map-content"><h3>' + "Account Name: " + "{!acc.Name} " + 
'</h3>' + '<b>' +"Location: " + "{!acc.BillingCity}" + '</b>' + '</br>' +   
"Direction : " + '<a href="http://maps.google.com/?daddr=' + "{!acc.BillingCity}" + 
'" target="_blank">Get Directions</a>' + '<img src="{!$Resource.Image_GoogleMap}" alt="image description">' +'</div>'; 
관련 문제