spatialillusions / milsymbol

Military Symbols in JavaScript
www.spatialillusions.com/milsymbol
MIT License
544 stars 133 forks source link

Problem using Milsymbol 2.0.0 with Milgraphics #246

Closed gallenem closed 1 year ago

gallenem commented 4 years ago

I am attempting to use the latest version of Milsymbols with Milgraphics and get the following error message reported by getproperties.js on line 77:

ms._getLetterPropertiesGraphic() is not present, you will need to load functionality for letter based SIDCs

I see that there has been an change to the index.js file from 1.3.3 to 2.0.0 of Milsymbols.

The index.js file in version 2.0.0. no longer has the following:

ms._getLetterProperties = require("./letter-sidc/properties.js");

This causes the "if" statement on line 69 of getproperties.js to fail.

Will there be another version of milgraphics which is compatible with 2.0.0 of milsymbols?

gallenem commented 4 years ago

I apologise if this is the wrong repository for this issue. I will re-raise this issue in the Milgraphics repository.

For everyone's information I have come up with a solution for Milgraphics and edited /src/graphic/getproperties.js by replacing: if (typeof ms._getNumberProperties === "function") { with if (typeof ms._getMetadata.number === "function") { and if (typeof ms._getLetterProperties === "function") { with if (typeof ms._getMetadata.letter === "function") {

This solution appears to work satisfactorily and all of the Milgraphics test data in the example-data/tacticaljson folder are all rendered correctly. I also tested with point icons generated using Milgraphics and they also render correctly. My proposed solution to add Weapon/Sensor Range Fan Circular and Weapon/Sensor Range Fan Sector to milgraphics also renders correctly.

spatialillusions commented 1 year ago

Milgraphics problems should be reported in the milgraphics repository, and milgraphics isn't under active development at the moment.