brunob / leaflet.fullscreen

Leaflet.Control.FullScreen for Leaflet
https://brunob.github.io/leaflet.fullscreen/
MIT License
380 stars 110 forks source link

Properties: separate the background image from its content property #146

Open Oxalin opened 2 weeks ago

Oxalin commented 2 weeks ago

Using Vue et Vite with the site to be hosted in WordPress, I'm having trouble with the dynamic resolution of the final background image (icon-fullscreen.svg). While I'm able to add some cue in .vue and .php files to tell Vite how it should resolve the template's path, I haven't figured out a solution for the .css/.scss file.

Vite resolves the background-image: url value as "/assets/icon-fullscreenRandomIDofItsLiking.svg", which points to https://domain/assets/icon-fullscreen_RandomIDofItsLiking_.svg, which is wrong.

My workaround for now is to insert a .fullscreen-icon in my main CSS file to override the background-image url. There may be another way to fix this that I don't know yet.

However, I would still like to suggest to add a new property to set the iconUrl independentrly from the "content" property. Firstly, it would allow to fix the reported problem within the .vue file. Secondly, il would allow to have both a background-image (customized or the default one) and a HTML content over it (whatever the user could want.