How to pass custom marker to polyline decorator

المشرف العام

Administrator
طاقم الإدارة
I am working with leaflet appliction, where user draw some shape.A polyline added to that shape using leaflet.polyline.decorators.I just want to know how to pass custom marker to L.Symbol.marker().

For example i am passing the custom marker but its not working.

Script

var myCustomMarker= L.icon({ iconUrl: 'assets/img/wallE.png', iconSize: [30, 30], // size of the icon iconAnchor: [5, 18], // point of the icon which will correspond to marker's location }); new L.Marker(e.latlng, { icon: wallIcon, draggable: false }).addTo(curr); polylineWall.addLatLng([e.latlng.lat,e.latlng.lng]).addTo(curr); // Add coordinate to the polyline var decorator = L.polylineDecorator(polylineWall, { patterns: [ { offset: 0, endOffset: 0, repeat: '10px', symbol: new L.Symbol.marker(myCustomMarker)} ] }).addTo(curr);Console Error

Uncaught Error: iconUrl not set in Icon options (see the docs).

If someone have knowledge about this problem please help.Thanks for your time.



أكثر...
 
أعلى