spatialillusions / milsymbol

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

render tactical symbols #272

Closed NoviceInWeb closed 1 year ago

NoviceInWeb commented 2 years ago

hello, @spatialillusions and @kjellmf

I have a question. I'm using a normal 2D canvas(no 3D map, no cesium, no openLayers) So I used the svg type. However, some returned images were marked with a 'question mark' as shown below. The function I used seems to be 'multipoint' returns a 'question mark'. In short, can you tell me the function that I can draw for 'multipoint'? Or is there an example?

[The result I wanted] Arrow circle

[Reality] image

[My Render Code]

let myTactical= ['GFT*I-----****X','GFT*N-----****X','GFT*D-----****X','G*T*F-----****X','G*T*AS----****X','G*T*E-----****X','G*T*O-----****X','G*T*Q-----****X', 'G*T*S-----****X','G*G*OAF---****X','G*T*B-----****X','G*T*H-----****X','G*T*Y-----****X','G*T*C-----****X','G*T*X-----****X','G*T*J-----****X','G*T*UC----****X']; 

--> (each symbolElement)

let renderedContent = new ms.Symbol(myTactical[symbolElement], { size: size, uniqueDesignation: element, additionalInformation: element, infoFields: "textInfo" }).asSVG();

ctx.beginPath();
ctx.drawImage(myTactical[symbolElement], x1, y1, x2 - x1, y2 - y1);
ctx.stroke();

Thank you...😒

spatialillusions commented 2 years ago

Hi,

Milsymbol only supports point symbols and not any multipoint symbols. You can find all supported symbols in the documentation.

/Måns

On 5 Jul 2022, at 08:24, NoviceInWeb @.***> wrote:

 hello, @spatialillusions and @kjellmf

I have a question. I'm using a regular 2D canvas, not a 3D map. So I used the svg type. However, some returned images were marked with a 'question mark' as shown below. The function I used seems to be 'multipoint' returns a 'question mark'. In short, can you tell me the function that I can draw for 'multipoint'? Or is there an example?

[The result I wanted]

[Actual results]

[My Render Code]

let myTactical= ['GFT*I-----X','GFT*N-----***X','GFTD-----X','GTF-----X','GTAS----X','GTE-----X','GTO-----X','GTQ-----X', 'GTS-----X','GGOAF---X','GTB-----X','GTH-----X','GTY-----X','GTC-----X','GTX-----X','GTJ-----X','GTUC----X'];

--> (each symbolElement)

let renderedContent = new ms.Symbol(myTactical[symbolElement], { size: size, uniqueDesignation: element, additionalInformation: element, infoFields: "textInfo" }).asSVG();

ctx.beginPath(); ctx.drawImage(myTactical[symbolElement], x1, y1, x2 - x1, y2 - y1); ctx.stroke(); Thank you...😒

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

ThomasHalwax commented 2 years ago

@NoviceInWeb Drawing tactical graphics is not trivial. Take a look at our open source C2IS ODIN.

NoviceInWeb commented 2 years ago

thank you!

NoviceInWeb commented 2 years ago

@NoviceInWeb Drawing tactical graphics is not trivial. Take a look at our open source C2IS ODIN.

thank you!

jrblanno commented 3 weeks ago

Hi! I love your project! you are a genius! any plans to support multipoint?