位奇怪的一個 - 我對我工作的一個網站上創建一個谷歌地圖區域聯繫人頁面。所有的工作都很好瞧,等我回去改變今天頁面上的更多東西,圖標已經完全消失。地圖仍然生成並顯示正常 - 只有圖標丟失。我的img路徑仍然正確,沒有其他改變。我似乎隱約記得這在原始構建過程中發生,但它可能已經修復了它自己。有沒有人遇到類似的事情?谷歌地圖API添加自定義圖標
我對地圖JS就在這裏 - 當我故意更改爲不存在或不有效VAR地圖上不會產生,所以我; M不能完全肯定它是與此代碼錯誤。
任何幫助,將大規模讚賞。謝謝,
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(51.865151,-2.234739);
var settings = {
zoom: 16,
center: latlng,
mapTypeControl: true,
scrollwheel: false,
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 companyLogo = new google.maps.MarkerImage('img/gmap-icon.png',
new google.maps.Size(100,50),
new google.maps.Point(0,0),
new google.maps.Point(50,50)
);
var companyPos = new google.maps.LatLng(51.865151,-2.234739);
var companyMarker = new google.maps.Marker({
position: companyPos,
map: map,
icon: companyLogo,
title:"10 Yetis HQ"
});
}
</script>