Using Milsymbols by Spatial Illusions in Servoy
Posted: Mon Jan 29, 2018 12:18 am
Måns Beckman of Spatial Illusions has created Milsymbol, a small library in pure javascript that creates military unit symbols according to MIL-STD-2525 (US) and STANAG APP-6 (NATO) publications. The project is OpenSource and it can be freely used according to the MIT License. Being a war game enthusiast, I would like to use it in a Servoy solution but I don't know which would be the best way to do this. The library milsymbol.js doesn't require any dependency, and therefore it is quite simple to use it in a browser to create an SVG or canvas.
The long number is the so called SDIC or Symbol ID Code that uniquely identifies a symbol. My questions are: which would be the best way to load the library and have it always available in my solution and how would you trigger the js function to draw the symbol? Thanks for any suggestion.
- Code: Select all
<html>
<head>
<title>test</title>
<meta name="generator" content="BBEdit 12.0" />
<meta charset="UTF-8" />
<script src="milsymbol.js"></script>
</head>
<body>
<script>
document.write(new ms.Symbol('10031000001211050051', { size: 100}).asSVG());
</script>
</body>
</html>
The long number is the so called SDIC or Symbol ID Code that uniquely identifies a symbol. My questions are: which would be the best way to load the library and have it always available in my solution and how would you trigger the js function to draw the symbol? Thanks for any suggestion.