1

是否可以在我的传单地图上使用自定义图标?我试图做类似的事情:

   function onLocationFound(e) {
        var radius = e.accuracy / 2;

        var customIcon = L.icon({
          iconUrl: 'images/marker_icon_2x.png',
          shadowUrl: 'images/marker_shadow.png'
        });    
        L.marker(e.latlng).addTo(map)
            .bindPopup("You are within " + radius + " meters from this point").openPopup();

        L.circle(e.latlng, radius).addTo(map);
    }

但我没有工作,有人知道最好的方法吗?图标以错误的大小出现并且在另一个位置

4

0 回答 0