missioncommand / mil-sym-js

(RETIRED) MIL-STD-2525 symbol rendering JavaScript library for modern web applications
Apache License 2.0
76 stars 25 forks source link

Cannot render Boundary mit T and T1 modifier #1

Closed mad61 closed 10 years ago

mad61 commented 10 years ago

I try to render a Multipoint feature as JSON

Code example:

var id = "4711";
var featureDescription = "Robertos Linie";
var featureName = "Robertos Linie";
var symid = "GFGFGLB----HGEX";
var points = "3.0000000000000004,45 3.1,45.1";
var scale = 108335.72891406555;
var bbox = null;
var modifiers = { T : "Linker", T1: "Rechter" };
var format = 1;
var rendererMP = sec.web.renderer.SECWebRenderer;
var json=rendererMP.RenderSymbol(
            id,
            featureName,
            featureDescription,
            symid,
            points,
            "clampToGround",
            scale,
            bbox,
            modifiers,
            format
        );

This generates the following error:

Mar 25, 2014 19:36:32.492 Modifier2 AddModifiers
Severe: TypeError: Object #<Object> has no method 'castNullAs' - Failed inside AddModifiers sm-bc.js:99333
armyc2.c2sd.renderer.utilities.ErrorLogger.LogException sm-bc.js:99333
armyc2.c2sd.JavaTacticalRenderer.Modifier2.AddModifiers sm-bc.js:91915
armyc2.c2sd.JavaRendererServer.RenderMultipoints.clsRenderer.render_GE sm-bc.js:117977
armyc2.c2sd.JavaRendererServer.RenderMultipoints.clsRenderer.renderWithPolylines sm-bc.js:117879
sec.web.renderer.MultiPointHandler.RenderSymbol sm-bc.js:127127
sec.web.renderer.SECWebRenderer.RenderSymbol
...

No Modifier are created.

Acording to my debugging the Clazz object (Class.js) has no method "castNullAs" as used in line 2063 from Modifier2.js !?

What's my mistake?

michael-spinelli commented 10 years ago

Our mistake. A bug very specific to boundaries without a bounding box specified. Modifier2.js has been updated. Your example worked for me after making the fix. Let me know if you have any further issues.

mdeutch3 commented 10 years ago

I searched the files and found no more instances of Clazz.castNullAs so I think we’re Ok. I could add the function to Clazz and return null but probably don’t need it.

From: Michael Spinelli [mailto:notifications@github.com] Sent: Tuesday, March 25, 2014 3:48 PM To: missioncommand/mil-sym-js Subject: Re: [mil-sym-js] Cannot render Boundary mit T and T1 modifier (#1)

Closed #1 https://github.com/missioncommand/mil-sym-js/issues/1 .

— Reply to this email directly or view it on GitHub https://github.com/missioncommand/mil-sym-js/issues/1 . https://github.com/notifications/beacon/5973557__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMTM5NjA4OSwiZGF0YSI6eyJpZCI6Mjg1MDI4NDd9fQ==--8ba056fc1e3225a3cec4602c440c7f9a52b10e94.gif