spatialillusions / milsymbol

Military Symbols in JavaScript
www.spatialillusions.com/milsymbol
MIT License
531 stars 132 forks source link

toDataUrl is not correctly creating images #280

Closed shadowedice closed 1 year ago

shadowedice commented 1 year ago

In commit ebd26b2, unescape was removed because it is deprecated. This now causes the SVG images to have an encoded URI which does not produce an image that can be used. I think there are two potential fixes:

  1. Remove the encodeURIComponent. This would revert it to how it was previously.
  2. Replace the unescape with decodeURIComponent.
spatialillusions commented 1 year ago

Thanks for finding this. I found a fix online that I tested and it looks like it solves the problem. At least I got it working in the application I'm working on at the moment.

shadowedice commented 1 year ago

Thanks for the quick fix. Looks to be working on my end as well.