masajid390/BeautifyMarker

can t click on a rectangle or square with an icon inside

Closed this issue · 3 comments

Hi i m trying to create an icon with a square around it.

Here is my code:

'icon': L.BeautifyIcon.icon({ icon: 'tint', iconShape: 'rectangle', textColor: "#005E7C" })

But when i try to click on it i get the following error:

TypeError: Cannot read property 'x' of undefined
(i'm using angular/typescript and leaflet)

Thanks

I figured it out by leaving the default iconShape (circle) and adding a css property to "iconStyle":
'icon': L.BeautifyIcon.icon({ icon: 'tint', iconShape: 'circle', borderWidth:2, backgroundColor:'transparent', iconStyle : 'border-radius:0!important' })

Are you still facing the same issue?

Well with the solution i provide above (iconStyle : 'border-radius:0!important'), there is no issue.