spatialillusions / milsymbol Goto Github PK
View Code? Open in Web Editor NEWMilitary Symbols in JavaScript
Home Page: www.spatialillusions.com/milsymbol
License: MIT License
Military Symbols in JavaScript
Home Page: www.spatialillusions.com/milsymbol
License: MIT License
Provide a section with a short description how to get started with this lib.
To be able to build more complex extentions to milsymbol there will be a change to the MS.buildingblock. This will be an API change, but I don't know of any users that has used the possiblity to extend the symbols so I will release it without creating a new major version.
The change will be minor and if you have built your own extentions it will be easy to migrate.
Please comment if this would be a major problem for you.
Got an idea that the API should have an setOptions method, this to add more functionality to chain methods together, and it will also make it possible to write cleaner more compact code.
sym.setOptions({fill:false}).getSymbol().XML
In some cases the issue of replacing some of the icons used for the symbols.
For example there are cases where a developer want to replace all icons showing crosses with half moons.
I will try to add code that makes it possible to patch the current version of milsymbol using code.
milsymbol dosen't draw tactical graphics and except a few point symbols that are referenced in other appendixes. If I would implement tactical graphics it would probably be done in another library, so that it will be easy to choose if you want to import it or not.
I have for quite some time been collecting ideas for how I would be able to create tactical graphics, and unfortunately my time might be too limited to implement the whole tactical graphics appendix, but I have some ideas that I might try out.
My idea is to start out with some, maybe five or ten, different graphics and see how it works out. If anyone has any input, wishes, questions, please post them here and I'll try to answer. (And if you need this done faster, you can always take me in as a consultant.)
The standards shows that the dash length should be different for suspect units and units with suspected position, at the moment this isn't implemented and the same dash length is used. I have contacted my symbol gurus to figure out how a unit that is both should be rendered and plan to update the code once this is solved.
Create and add a cesium example
Milsymbol is in version 0.4.4 a bit slow if you want to use thousands of symbols. I'm working on a rewrite of the code that will speed up things a lot! Got a working prototype, but need to fix a bunch of regressions before commit.
The canvas draws slow because fill and stroke is called a lot of times. I should try to optimize this in some way to make fewer calls and in that way try to make it faster.
To make it simple to update documentation it should be migrated to markdown. Might move to JSDoc or similar in the future, but markdown is a start.
Would it be possible to also offer a milsymbol.min.js as many other JavaScript libraries offer for saving space when distributing for production use? You can use UglifyJS or whatever method works easiest for your build. Please keep the milsymbol.js version for use during development however.
The MilSymbol library is currently one big file. It is easier to maintain if you split it into multiple files. You can always use a build tool like Gulp or Grunt to combine and compress all the files for deployment. This will probably also make it possible to create custom versions of MilSymbol. For example, if you don't need support for MILSTD 2525D, you don't need to include it in the project.
Hi there @spatialillusions , i try to use this library for a tiny project in Unity3D but i found that is full of bugs. A lot of ";" missing and a lot of erros on the syntax. I start correcting a few but there are a LOT. Here is the modify milsymbol.js. Unity3d (i'm using MonoDevelop 5.9.6) compiler is BOO, it say that the next errors are in the next lines:
(206,26): BCE0044: expecting (, found 'text'.
(206,35): UCE0001: ';' expected. Insert a semicolon at the end.
(226,26): BCE0044: expecting (, found 'textm1'.
(226,37): UCE0001: ';' expected. Insert a semicolon at the end.
(237,26): BCE0044: expecting (, found 'textm2'.
(237,37): UCE0001: ';' expected. Insert a semicolon at the end.
(269,177): BCE0043: Unexpected token: ,.
(269,178): UCE0001: ';' expected. Insert a semicolon at the end.
(269,179): BCE0043: Unexpected token: type.
(269,184): BCE0043: Unexpected token: path.
and the list goes on...
PS: i can't upload the complete milsymbol.js modify, if you are interested i send it to your email.
Would be good if colors were expressed as a CSS file which could then be modified if necessary.
This includes work to move all documentation to MarkDown and build scripts to merge several MarkDown documents and convert them into HTML.
It will be done in several steps where the first one is to create new documentation in MarkDown format for things that are missing documentation today. This work has started with updating documentation for the examples.
Looking inte the possibility to add an option to add white halos around symbols to make them more readable on top of a map.
Describe how the test files work and how other users can replicate the tests.
Could you please update the npm package? I created an angular module to implement your lib, but it needs this commit: 743be4a
Since asImage() isn't really an image, it's a data url, we should change this to toDataURL().
In accordance to the issue #21 here is some ideas about validation of the SIDC :
Thanks.
I have some ideas for how to make an outline on the icon and elements outside the icon, so please let me know if you are interested in this and I will add the functionality, but if it won't be use there is no idea to add the code.
To make it easier to maintain and update examples, they will be migrated to bl.ocks format:
https://bl.ocks.org/-/about
They will still be included with milsymbol, but this is a part of updating the documentation and making milsymbol easier to maintain.
If you want to contribute with your own examples of milsymbol usage, simply create a pull request, all examples are welcome.
Hi,
it seems that npm install of milsymbol fail (on windows) with this error :
194 error enoent ENOENT: no such file or directory, chmod '\node_modules\mil-symbol\MilSymbol.js'
Thanks.
Implement APP6D unit symbols
When a symbol is placed on a map there might be hard to read the symbol from the background. Using SVG filters it would be possible to add an outline to the symbols and texts.
I have a general idea or how this could be implemented, but for the moment it will only be possible in SVG and not in Canvas.
I don't know yet if I will make it part of the API or as an extension.
At the moment the uncompressed code is around 800k in size. The most of this is in the buldingblocks that makes up the symbols, so it might be hard to make it smaller, but I should at least make an effort to see if it is possible.
Anyone interested to be able to make the text information surrounding the symbol in another color then the default icon frame color? If so let me know, I have some ideas but I don't want to implement options that won't be used.
Firstly, this is a neat project. Thank you for sharing ๐
On the topic of sharing, I have come across a minor issue regarding the license to be enforced on your library...
The documentation and examples page says that the milsymbol.js library is BSD and links to MIT license text. The README in the GitHub repo says MIT and includes an MIT license file (at least it is titled as such, I have not reviewed the license text as a lawyer would ๐)
Some organizations are very particular about the wording in the license and might ignore this awesome library for no good reason.
Thanks again for sharing.
Working on implementing 2525C EMS, it is a lot of work and please let me know if you need this functionality and I will prioritise it.
So people know how they can/can't use this repo :]
Rendering error in
WAR.GRDTRK.EQT.GRDVEH.ARMD.C2V
S-G-EVAC--*****
C2V/ACV
There is a misscalculation in octagonAnchor and markerAnchor where the extra padding on the symbol isn't calculated into where the center is.
On line 1943 and 1944 extra padding is added, and it's not calculated into the computations in the following lines.
Either set the mulitplyer to 2, or change the following lines to add 0.5 strokewitdths.
I'm trying to keep my scala interface to milsymbol.js up to date.
To do this it would be of great help to have a change log
(e.g https://github.com/workingDog/ScalaMS/blob/master/CHANGES.md) to record what has changed in
what version.
Following the issue #21 it would be nice to be able to have a dictionary of possible choice to make a custom unit generator like the one included in the project.
Make an alternative orbat visualisation based on http://bl.ocks.org/mbostock/1093025
This can be very helpful when building a web application and you want a list of your orbat.
Hi,
Is there a way to tell if a symbol is valid ?
Thanks.
I noticed that the OpenLayers example at http://spatialillusions.github.io/MilSymbol/examples/openlayers3/index.html does not work in IE11. When I open the debug console the following error is shown multiple times:
XML5634: An attribute with the same name already exists on this element. Line: 1, Column 155
Any idea why it don't work?
Add support for the speed leader.
It should be able to set to a fixed pixel length independent of symbol size.
If speed leader is used the ordinary direction indicator should not be used.
It would be nice if I could just type bower install milsymbol
to download the library for use in a web project. See http://bower.io/docs/creating-packages/ for instructions if you want to use bower.
To reduce the maintenance the bower.json will be remove if there isn't any specific requests to keep it.
I'm currently brushing up on my javascript skills and I'm trying to build a simple web application using the latest "state of the art" tools like npm, Typescript and webpack/browserify. I also want to use milsymbol as part of the project, but I've run into some problems integrating it with webpack and browserify. The reason for this is that webpack interprets milsymbol as CommonJS module and expects it to export variables and functions. Something like this:
module.exports = MS;
The problem is that milsymbol does not automatically make MS
a global variable. This is usually a good thing, but when I use a tool like webpack, it puts milsymbol inside a function scope, so that the MS
is not available outside of this scope.
One workaround I found was to add something like this to milsymbol.js (code borrowed from Leaflet):
// Code from the Leaflet project:
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = MS;
} else if (typeof define === 'function' && define.amd) {
define(MS);
}
// make MS a global variable
if (typeof window !== 'undefined') {
window.MS = MS;
}
Another option may be to use browserify and browserify-shim and build a module friendly version of milsymbol.
Any thoughts on adding support for modern javascript module loaders?
This might be too much work, but I'm looking into canvas output. Please comment if you are interested in this or if I will be wasting my time.
Finish implementation of 2525D unit symbols
Milsymbol has grown quite a lot since the first version and it continues to grow. This has created a need for making some kind of automated unit test to make sure that edits don't break existing functionality. So far Mocha https://mochajs.org/ is the test framework that is considered, but if anyone has any other opinions I'm still open to suggestions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.