milsymbol icon indicating copy to clipboard operation
milsymbol copied to clipboard

Problem using Milsymbol 2.0.0 with Milgraphics

Open gallenem opened this issue 5 years ago • 1 comments

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 avatar Feb 03 '20 09:02 gallenem

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.

gallenem avatar Feb 04 '20 08:02 gallenem

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

spatialillusions avatar Feb 24 '23 08:02 spatialillusions