0

マーカーで画像を使用するとGoogleマップで画像を取得していますが、情報ウィンドウに同じ画像を使用している場合、URLのみが表示されます。

コード:

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}」を使用して、Google マップの情報ウィンドウに画像を表示する方法。誰でも私を助けることができますか?

4

1 に答える 1

0

{!$Resource.Image_GoogleMap}が画像の URL で、それを InfoWindow に表示したい場合は、通常の 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>';
于 2013-09-16T15:08:40.917 に答える