2017-06-21 25 views
1

我想使用自定义标记与Grafana世界地图插件使用Leaflet JS库。但即使我把自定义标记图像中的源目录我不断收到以下错误 -HTTP 404资源未找到 - 格拉法纳世界地图插件自定义标记

http://localhost:3000/datacenter.png 404 (Not Found) 

我的代码看起来是这样的 -

var dataCenterIcon = window.L.icon({ 
    iconUrl: 'datacenter.png', 
    iconSize:  [38, 95], // size of the icon 
    iconAnchor: [22, 94], // point of the icon which will correspond to marker's location 
    popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor 
}); 

window.L.marker([caponeDCLat, caponeDCLong], {icon: dataCenterIcon}).addTo(this.map); 

任何人都可以提供一些投入,以什么我可能在这里做错了。

回答