spatialillusions / milsymbol

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

Unable to apply color to mine symbol background #263

Closed 32dohs closed 2 years ago

32dohs commented 2 years ago

Hello all,

I am trying to create symbols that have a black frame and a white background.

I was able to achieve that for the most part by doing this:

**var sym = new ms.Symbol("SFUPWM------***", { size: 20, colorMode: "White" });

sym.setOptions({
    frameColor: {
        Civilian: "black",
        Friend: "black",
        Hostile: "black",
        Neutral: "black",
        Unknown: "black",
    }
});**

However, mine icons seem to be the exception. That background is always transparent, and I have been unable to find a way to get them styled the way I want. I have a picture to illustrate.

MinesTransBkgrnd

The version I am using is 2.0.0.

Is there any way to achieve what I need?

Thank you in advance for any help you can provide.

spatialillusions commented 2 years ago

You can sort of do this... If you use number based SIDC from MIL-STD-2525D or APP6 D, and set alternateMedal:true, at the moment there isn't another way that I can think about.

32dohs commented 2 years ago

Thank you for the assistance. I reworked my code based on your suggestion and I was able to generate the icons with the styles they need. Many thanks!