0
我正在建立一個谷歌地圖的聯繫頁面。點擊時,我創建了一個pin和shadow以及一個信息框。在信息框內,我想使用哥白尼的自定義字體。我已經在頁面的標題中使用了js cufon替換腳本來替換這個特定的字體。現在我想知道是否可以在信息框中使用它,因爲那裏我已經有了用於地圖的js腳本了?如果是這樣,怎麼樣?cufon.replace裏面谷歌地圖contentString
至於現在,我的腳本如下所示:
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(31.4249122, 117.6179591);
var settings = {
zoom: 15,
center: latlng,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), settings);
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">Header placed here</h1>'+
'<div id="bodyContent">'+
'<p>Description of business placed Here</p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var companyLogo = new google.maps.MarkerImage('/imgs/mapMarker.png',
new google.maps.Size(100,50),
new google.maps.Point(0,0),
new google.maps.Point(50,50)
);
var companyShadow = new google.maps.MarkerImage('/imgs/mapShadow.png',
new google.maps.Size(130,50),
new google.maps.Point(0,0),
new google.maps.Point(65, 50)
);
var companyPos = new google.maps.LatLng(31.4249122, 117.6179591);
var companyMarker = new google.maps.Marker({
position: companyPos,
map: map,
icon: companyLogo,
shadow: companyShadow,
title:"Company Title"
});
google.maps.event.addListener(companyMarker, 'click', function() {
infowindow.open(map,companyMarker);
});
}
</script>
提前感謝!
天才!非常感謝。完美工作! – Adam 2012-02-07 22:58:54