Closed r3mi closed 5 years ago
Error handling should be improved here. I got an idea for what fallback I should use.
I checked the master branch and the second now returns:
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="8" height="8" viewBox="96 96 8 8"></svg>
and the third one returns the same, so at some time I did fix this.
I did however add new code to the validation control to make sure they report that they arn't valid symbols.
SUG*IUR---H-
This one is also returning invalid asSVG and asDOM
Was able to get a png using .asCanvas().asDataURL()
Please try this out using the master branch code. You can find a fairly new build here if you don't want to build it yourself: http://spatialillusions.com/milsymbol-dev/dist/milsymbol.js As far as I can tell, everything works as it should and the SVG output is valid and isValid reports true.
Invalid SIDC sometime produce SVGs with incorrect syntax. Exemple on battleDimension :
Result
Notice the invalid tags in the second and third exemples :
undefinedstroke-width
orundefinedfill-opacity
without a starting element<
.Using milsymbol 1.3.3 Thanks for this great project !