我设法实现了 Google Maps Api,并通过函数从 Wordpress 数据库中加载了标记。但我不知道如何将自定义图标添加到标记别针。问题是 Wordpress 不允许直接访问模板文件。
我的图片加载到了主题/主题名/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
});