View on GitHub

Mil-sym-js

MIL-STD-2525 symbol rendering JavaScript library for modern web applications

Download this project as a .zip file Download this project as a tar.gz file

mil-sym-js

mil-sym-js is a JavaScript port of the java-based mil-std rendering libraries that have been used in US Army Mission Command software for years. In November 2013 Mission Command was given the approval to release and maintain these libraries as public open source.

JS Renderer Developer's Guide Wiki
Google Group Discussion Forum

MIL-STD-2525

The MIL-STD-2525 standard defines how to visualize military symbology. This project provides support for the entire MIL-STD-2525B Change II and MIL-STD-2525C specs.

Features

Samples

Multipoint Symbology
Multipoint Symbology via Web Worker
Singlepoint Symbology

Tech

mil-sym-js project uses a handful of open source projects to work properly:

Limitations

Rendering of Single Point Symbology to an HTML5 canvas requires the loading of external fonts via CSS. If this is not possible due to group policies or other reasons, it is recommended to use SVG as your Single Point Symbology rendering format. Single Point HTML5 Canvas Rendering Web Browser Compatibility Tables

Build

This project builds with Ant resulting in two JavaScript files.
One has all of the JS code combined into one file.
The other is a minified version of the first file. (i.e. sm-bc.js & sm-bc.min.js)

Open a command prompt to the root folder of the repository on your local machine and enter:

ant clean
ant concat sm-bc minify samples

"sm-bc" represents what you rendering capabilities you want.

s: singlepoint canvas support (jquery plugin for singlepoint rendering only available in singlepoint only builds)
sv: singlepoint svg support
sav: singlepoint canvas and svg support
m: multipoints (KML, GeoJSON, GeoSVG)
sm: singlepoint canvas and multipoints (multipoint GeoCanvas support requires both)
savm: (singlepoint canvas & svg format and all multipoint formats)

b: 2525B support
c: 2525C support
bc: both

allFlavors: every variation will be generated

running "ant concat sm-bc minify samples" would result in the following files being placed in the "dist" folder:

Project Structure

mil-sym-js has a namespace structure that resembles the java layout although differs where we needed to implement java functionality that wasn't available in JavaScript:

When using Ant to build, the output to the "dist" folder will include a few html files that show basic usage of the renderer.

License

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/