我正在尝试在我的传单地图上放置带有图像的图标,但是我收到以下错误消息:
var OfferIcon = L.Icon.extend({
options: {
iconSize: [38, 95],
shadowSize: [50, 64],
iconAnchor: [22, 94],
shadowAnchor: [4, 62],
popupAnchor: [-3, -76]
}
});
var iconName = json["offer_" + id + "_iconname"];
// this is returning the correct file name
var offerIcon = new OfferIcon(
{
iconUrl: iconName,
name : name,
id: id,
value: value
});
L.marker([latitude, longitude], {icon: offerIcon}).addTo(markers).bindPopup(name);
}
我不明白为什么说我没有设置网址。以下是我设置代码的方法:
{{1}}