0
我設法實現Google Maps Api,並通過函數從Wordpress數據庫加載標記。但我無法弄清楚如何將自定義圖標添加到標記引腳。問題在於Wordpress不允許直接訪問模板文件。Google Maps API標記,Wordpress和jQuery
我的形象在主題加載/ THEMENAME/IMG/BGI
腳本是這樣的:
var myLatlng = new google.maps.LatLng(data[i].latitude,data[i].longitude);
marker = new google.maps.Marker({
position: myLatlng,
//icon: data[i].image,
map: map,
title: data[i].title
});
您沒有閱讀過Google Maps API文檔嗎? – trickyzter
我已閱讀過多次。沒有關於wordpress或php加載標記圖標的規範。或者我可能還沒有找到它...... –
爲什麼Google Maps API v3文檔會提到關於wordpress或PHP的任何內容?它確實告訴你如何實現[自定義標記圖標](https://developers.google.com/maps/documentation/javascript/overlays#SimpleIcons)。 – geocodezip