Using Milsymbols by Spatial Illusions in Servoy

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Using Milsymbols by Spatial Illusions in Servoy

Postby rioba1401913570 » 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.
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.
rioba1401913570
 
Posts: 19
Joined: Wed Jun 04, 2014 10:26 pm

Re: Using Milsymbols by Spatial Illusions in Servoy

Postby mboegem » Mon Jan 29, 2018 2:03 pm

What type of servoy-client do you need it for?
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1426
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Using Milsymbols by Spatial Illusions in Servoy

Postby rioba1401913570 » Mon Jan 29, 2018 2:40 pm

Either the smart or web. I don't have enough experience on NG to use it.

Thanks
rioba1401913570
 
Posts: 19
Joined: Wed Jun 04, 2014 10:26 pm

Re: Using Milsymbols by Spatial Illusions in Servoy

Postby rioba1401913570 » Wed Jan 31, 2018 12:42 pm

Probably my original question scope was too broad and generic. But the main question is probably simpler to reply: how can I access the MilSymbol library (milsymbol.js) from inside Servoy? Where should I put it?

Thanks for any help.
rioba1401913570
 
Posts: 19
Joined: Wed Jun 04, 2014 10:26 pm

Re: Using Milsymbols by Spatial Illusions in Servoy

Postby mboegem » Wed Jan 31, 2018 3:40 pm

I guess easiest is to put it in the application_server/server/webabbs/ROOT folder.
That way, you can access it through <servoyurl>:<port>/milsymbol.js

For webclient you can add it to your resources using the web client-utils plugin.
Now you only need to add the svg in some way to your forms.

For smart client it's probably a bit more complicated, as you need to be able to display an SVG file.
On servoy-forge you'll find a svg-bean (never used it myself though)
Not sure what the easies way is to retrieve the svg-data (maybe a simple html page where you can post the milsymbol ID to using http plugin and which will return the svg data)
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1426
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Using Milsymbols by Spatial Illusions in Servoy

Postby rioba1401913570 » Wed Jan 31, 2018 3:49 pm

Thank you very much Marc. I'll try it tonight.
rioba1401913570
 
Posts: 19
Joined: Wed Jun 04, 2014 10:26 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 3 guests