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