@armyc2.c5isr.renderer/mil-sym-ts-web 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/{dist/armyc2.c5isr.renderer-mil-sym-ts-web-2.2.0.tgz → armyc2.c5isr.renderer-mil-sym-ts-web-2.2.1.tgz} +0 -0
  2. package/package.json +15 -39
  3. package/buildNode.bat +0 -2
  4. package/buildWeb.bat +0 -2
  5. package/dist/LICENSE +0 -201
  6. package/dist/README.md +0 -57
  7. package/dist/package.json +0 -16
  8. package/index.ts +0 -169
  9. package/package.bak +0 -50
  10. package/package.node.json +0 -43
  11. package/package.pack.json +0 -19
  12. package/package.packWeb.json +0 -16
  13. package/package.web.json +0 -40
  14. package/src/main/ts/android/graphics/Bitmap.ts +0 -7
  15. package/src/main/ts/android/graphics/Paint.ts +0 -26
  16. package/src/main/ts/android/graphics/Path.ts +0 -78
  17. package/src/main/ts/android/graphics/PointF.ts +0 -14
  18. package/src/main/ts/android/graphics/Rect.ts +0 -18
  19. package/src/main/ts/android/graphics/RectF.ts +0 -50
  20. package/src/main/ts/android/graphics/Region.ts +0 -36
  21. package/src/main/ts/android/graphics/Typeface.ts +0 -11
  22. package/src/main/ts/armyc2/c5isr/JavaLineArray/BasicShapes.ts +0 -99
  23. package/src/main/ts/armyc2/c5isr/JavaLineArray/CChannelPoints2.ts +0 -34
  24. package/src/main/ts/armyc2/c5isr/JavaLineArray/CELineArray.ts +0 -193
  25. package/src/main/ts/armyc2/c5isr/JavaLineArray/Channels.ts +0 -2971
  26. package/src/main/ts/armyc2/c5isr/JavaLineArray/DISMSupport.ts +0 -4008
  27. package/src/main/ts/armyc2/c5isr/JavaLineArray/POINT2.ts +0 -93
  28. package/src/main/ts/armyc2/c5isr/JavaLineArray/Shape2.ts +0 -89
  29. package/src/main/ts/armyc2/c5isr/JavaLineArray/TacticalLines.ts +0 -515
  30. package/src/main/ts/armyc2/c5isr/JavaLineArray/arraysupport.ts +0 -5403
  31. package/src/main/ts/armyc2/c5isr/JavaLineArray/countsupport.ts +0 -1084
  32. package/src/main/ts/armyc2/c5isr/JavaLineArray/flot.ts +0 -2173
  33. package/src/main/ts/armyc2/c5isr/JavaLineArray/lineutility.ts +0 -4934
  34. package/src/main/ts/armyc2/c5isr/JavaLineArray/ref.ts +0 -7
  35. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/Modifier2.ts +0 -5601
  36. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/P1.ts +0 -14
  37. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/TGLight.ts +0 -648
  38. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsChannelUtility.ts +0 -647
  39. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsMETOC.ts +0 -2994
  40. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/clsUtility.ts +0 -2663
  41. package/src/main/ts/armyc2/c5isr/JavaTacticalRenderer/mdlGeodesic.ts +0 -669
  42. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipPolygon2.ts +0 -971
  43. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsClipQuad.ts +0 -871
  44. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer.ts +0 -3507
  45. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsRenderer2.ts +0 -500
  46. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtility.ts +0 -1089
  47. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityCPOF.ts +0 -2656
  48. package/src/main/ts/armyc2/c5isr/RenderMultipoints/clsUtilityGE.ts +0 -1419
  49. package/src/main/ts/armyc2/c5isr/data/genc.json +0 -1407
  50. package/src/main/ts/armyc2/c5isr/data/msd.json +0 -17311
  51. package/src/main/ts/armyc2/c5isr/data/mse.json +0 -18500
  52. package/src/main/ts/armyc2/c5isr/data/svgd.json +0 -31214
  53. package/src/main/ts/armyc2/c5isr/data/svge.json +0 -30558
  54. package/src/main/ts/armyc2/c5isr/graphics2d/AffineTransform.ts +0 -10
  55. package/src/main/ts/armyc2/c5isr/graphics2d/Area.ts +0 -437
  56. package/src/main/ts/armyc2/c5isr/graphics2d/BasicStroke.ts +0 -429
  57. package/src/main/ts/armyc2/c5isr/graphics2d/BasicTypes.ts +0 -7
  58. package/src/main/ts/armyc2/c5isr/graphics2d/BufferedImage.ts +0 -35
  59. package/src/main/ts/armyc2/c5isr/graphics2d/Font.ts +0 -111
  60. package/src/main/ts/armyc2/c5isr/graphics2d/FontMetrics.ts +0 -29
  61. package/src/main/ts/armyc2/c5isr/graphics2d/FontRenderContext.ts +0 -18
  62. package/src/main/ts/armyc2/c5isr/graphics2d/GeneralPath.ts +0 -211
  63. package/src/main/ts/armyc2/c5isr/graphics2d/Graphics2D.ts +0 -80
  64. package/src/main/ts/armyc2/c5isr/graphics2d/IPathIterator.ts +0 -33
  65. package/src/main/ts/armyc2/c5isr/graphics2d/ImageIO.ts +0 -16
  66. package/src/main/ts/armyc2/c5isr/graphics2d/Line2D.ts +0 -726
  67. package/src/main/ts/armyc2/c5isr/graphics2d/PathIterator.ts +0 -141
  68. package/src/main/ts/armyc2/c5isr/graphics2d/Point.ts +0 -112
  69. package/src/main/ts/armyc2/c5isr/graphics2d/Point2D.ts +0 -261
  70. package/src/main/ts/armyc2/c5isr/graphics2d/Polygon.ts +0 -391
  71. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle.ts +0 -567
  72. package/src/main/ts/armyc2/c5isr/graphics2d/Rectangle2D.ts +0 -445
  73. package/src/main/ts/armyc2/c5isr/graphics2d/Shape.ts +0 -31
  74. package/src/main/ts/armyc2/c5isr/graphics2d/Stroke.ts +0 -18
  75. package/src/main/ts/armyc2/c5isr/graphics2d/TextLayout.ts +0 -45
  76. package/src/main/ts/armyc2/c5isr/graphics2d/TexturePaint.ts +0 -25
  77. package/src/main/ts/armyc2/c5isr/renderer/IIconRenderer.ts +0 -15
  78. package/src/main/ts/armyc2/c5isr/renderer/IconRenderer.ts +0 -22
  79. package/src/main/ts/armyc2/c5isr/renderer/MilStdIconRenderer.ts +0 -269
  80. package/src/main/ts/armyc2/c5isr/renderer/ModifierRenderer.ts +0 -9882
  81. package/src/main/ts/armyc2/c5isr/renderer/PatternFillRenderer.ts +0 -146
  82. package/src/main/ts/armyc2/c5isr/renderer/SinglePointSVGRenderer.ts +0 -1265
  83. package/src/main/ts/armyc2/c5isr/renderer/shapes/arc.ts +0 -64
  84. package/src/main/ts/armyc2/c5isr/renderer/shapes/bcurve.ts +0 -95
  85. package/src/main/ts/armyc2/c5isr/renderer/shapes/ellipse.ts +0 -93
  86. package/src/main/ts/armyc2/c5isr/renderer/shapes/line.ts +0 -114
  87. package/src/main/ts/armyc2/c5isr/renderer/shapes/path.ts +0 -555
  88. package/src/main/ts/armyc2/c5isr/renderer/shapes/pathiterator.ts +0 -62
  89. package/src/main/ts/armyc2/c5isr/renderer/shapes/point.ts +0 -120
  90. package/src/main/ts/armyc2/c5isr/renderer/shapes/rectangle.ts +0 -431
  91. package/src/main/ts/armyc2/c5isr/renderer/shapes/roundedrectangle.ts +0 -99
  92. package/src/main/ts/armyc2/c5isr/renderer/shapes/types.ts +0 -25
  93. package/src/main/ts/armyc2/c5isr/renderer/shapes/utilities.ts +0 -203
  94. package/src/main/ts/armyc2/c5isr/renderer/utilities/AffiliationColors.ts +0 -104
  95. package/src/main/ts/armyc2/c5isr/renderer/utilities/Color.ts +0 -481
  96. package/src/main/ts/armyc2/c5isr/renderer/utilities/DistanceUnit.ts +0 -40
  97. package/src/main/ts/armyc2/c5isr/renderer/utilities/DrawRules.ts +0 -1323
  98. package/src/main/ts/armyc2/c5isr/renderer/utilities/EntityCode.ts +0 -51
  99. package/src/main/ts/armyc2/c5isr/renderer/utilities/ErrorLogger.ts +0 -736
  100. package/src/main/ts/armyc2/c5isr/renderer/utilities/GENCLookup.ts +0 -106
  101. package/src/main/ts/armyc2/c5isr/renderer/utilities/GeoPixelConversion3D.ts +0 -84
  102. package/src/main/ts/armyc2/c5isr/renderer/utilities/IMultiPointRenderer.ts +0 -87
  103. package/src/main/ts/armyc2/c5isr/renderer/utilities/IPointConversion.ts +0 -34
  104. package/src/main/ts/armyc2/c5isr/renderer/utilities/ImageInfo.ts +0 -324
  105. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUCache.ts +0 -127
  106. package/src/main/ts/armyc2/c5isr/renderer/utilities/LRUEntry.ts +0 -18
  107. package/src/main/ts/armyc2/c5isr/renderer/utilities/LogLevel.ts +0 -111
  108. package/src/main/ts/armyc2/c5isr/renderer/utilities/MODrawRules.ts +0 -219
  109. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSInfo.ts +0 -1008
  110. package/src/main/ts/armyc2/c5isr/renderer/utilities/MSLookup.ts +0 -882
  111. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdAttributes.ts +0 -380
  112. package/src/main/ts/armyc2/c5isr/renderer/utilities/MilStdSymbol.ts +0 -797
  113. package/src/main/ts/armyc2/c5isr/renderer/utilities/Modifiers.ts +0 -1699
  114. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversion.ts +0 -178
  115. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConversionDummy.ts +0 -45
  116. package/src/main/ts/armyc2/c5isr/renderer/utilities/PointConverter3D.ts +0 -126
  117. package/src/main/ts/armyc2/c5isr/renderer/utilities/RectUtilities.ts +0 -118
  118. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererException.ts +0 -11
  119. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererSettings.ts +0 -1201
  120. package/src/main/ts/armyc2/c5isr/renderer/utilities/RendererUtilities.ts +0 -591
  121. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGInfo.ts +0 -29
  122. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGLookup.ts +0 -753
  123. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGSymbolInfo.ts +0 -137
  124. package/src/main/ts/armyc2/c5isr/renderer/utilities/SVGTextInfo.ts +0 -438
  125. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEvent.ts +0 -19
  126. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsChangedEventListener.ts +0 -10
  127. package/src/main/ts/armyc2/c5isr/renderer/utilities/SettingsEventListener.ts +0 -5
  128. package/src/main/ts/armyc2/c5isr/renderer/utilities/Shape2SVG.ts +0 -404
  129. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeInfo.ts +0 -525
  130. package/src/main/ts/armyc2/c5isr/renderer/utilities/ShapeUtilities.ts +0 -55
  131. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolDimensionInfo.ts +0 -36
  132. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolID.ts +0 -1055
  133. package/src/main/ts/armyc2/c5isr/renderer/utilities/SymbolUtilities.ts +0 -2085
  134. package/src/main/ts/armyc2/c5isr/renderer/utilities/TextInfo.ts +0 -157
  135. package/src/main/ts/armyc2/c5isr/web/render/GeoPixelConversion.ts +0 -86
  136. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandler.ts +0 -3798
  137. package/src/main/ts/armyc2/c5isr/web/render/MultiPointHandlerSVG.ts +0 -412
  138. package/src/main/ts/armyc2/c5isr/web/render/PointConverter.ts +0 -124
  139. package/src/main/ts/armyc2/c5isr/web/render/SymbolModifiers.ts +0 -26
  140. package/src/main/ts/armyc2/c5isr/web/render/WebRenderer.ts +0 -677
  141. package/src/main/ts/armyc2/c5isr/web/render/utilities/JavaRendererUtilities.ts +0 -484
  142. package/src/main/ts/armyc2/c5isr/web/render/utilities/LineInfo.ts +0 -62
  143. package/src/main/ts/armyc2/c5isr/web/render/utilities/SymbolInfo.ts +0 -46
  144. package/src/main/ts/armyc2/c5isr/web/render/utilities/TextInfo.ts +0 -51
  145. package/src/main/ts/org/gavaghan/geodesy/Angle.ts +0 -31
  146. package/src/main/ts/org/gavaghan/geodesy/Ellipsoid.ts +0 -71
  147. package/src/main/ts/org/gavaghan/geodesy/GeodeticCalculator.ts +0 -200
  148. package/src/main/ts/org/gavaghan/geodesy/GeodeticCurve.ts +0 -55
  149. package/src/main/ts/org/gavaghan/geodesy/GeodeticMeasurement.ts +0 -68
  150. package/src/main/ts/org/gavaghan/geodesy/GlobalCoordinates.ts +0 -103
  151. package/src/main/ts/org/gavaghan/geodesy/GlobalPosition.ts +0 -90
  152. package/test/ExportSPImages.js +0 -692
  153. package/test/MPWW.html +0 -556
  154. package/test/MPWorker.js +0 -318
  155. package/test/SPWorker.js +0 -233
  156. package/test/SVGWW.html +0 -363
  157. package/test/singlePointTester3.html +0 -751
  158. package/tsconfig.json +0 -54
  159. package/typedoc.json +0 -30
  160. package/updateVersion.js +0 -21
  161. package/webpack.config.js +0 -34
  162. package/webpackn.config.js +0 -28
  163. package/webpackr.config.js +0 -47
  164. package/webpackw.config.js +0 -23
  165. /package/{dist/C5Ren.d.ts → C5Ren.d.ts} +0 -0
  166. /package/{dist/C5Ren.js → C5Ren.js} +0 -0
  167. /package/{dist/C5Ren.js.map → C5Ren.js.map} +0 -0
  168. /package/{dist/manifest.json → manifest.json} +0 -0
@@ -1,677 +0,0 @@
1
-
2
- // This import is if we need to call a javascript function
3
- // It requires that you import the plugins.jar from the jdk folder into the project libraries
4
- //import netscape.javascript.JSObject;
5
-
6
-
7
-
8
- import { type long, type double, type int } from "../../../c5isr/graphics2d/BasicTypes";
9
- import { Font } from "../../graphics2d/Font";
10
- import { Point2D } from "../../graphics2d/Point2D";
11
- import { Rectangle2D } from "../../graphics2d/Rectangle2D";
12
- import { Color } from "../../renderer/utilities/Color";
13
- import { ErrorLogger } from "../../renderer/utilities/ErrorLogger";
14
- import { LogLevel } from "../../renderer/utilities/LogLevel";
15
- import { MilStdAttributes } from "../../renderer/utilities/MilStdAttributes";
16
- import { MilStdSymbol } from "../../renderer/utilities/MilStdSymbol";
17
- import { Modifiers } from "../../renderer/utilities/Modifiers";
18
- import { RendererSettings } from "../../renderer/utilities/RendererSettings";
19
- import { SymbolUtilities } from "../../renderer/utilities/SymbolUtilities";
20
- import { MultiPointHandler } from "./MultiPointHandler";
21
- import { SymbolModifiers } from "./SymbolModifiers";
22
- import { JavaRendererUtilities } from "./utilities/JavaRendererUtilities";
23
- import { RendererUtilities } from "../../renderer/utilities/RendererUtilities";
24
- import { mdlGeodesic } from "../../JavaTacticalRenderer/mdlGeodesic"
25
- import { POINT2 } from "../../JavaLineArray/POINT2";
26
- import { ref } from "../../JavaLineArray/ref"
27
- import { BasicShapes } from "../../JavaLineArray/BasicShapes";
28
-
29
-
30
- /**
31
- * Main class for rendering multi-point graphics such as Control Measures, Atmospheric, and Oceanographic.
32
- *
33
- */
34
- //@SuppressWarnings("unused")
35
- export class WebRenderer /* extends Applet */ {
36
- // private static readonly serialVersionUID: long = -2691218568602318366n;
37
-
38
- public static readonly OUTPUT_FORMAT_KML = 0;
39
- /**
40
- * @deprecated
41
- */
42
- public static readonly OUTPUT_FORMAT_JSON = 1;
43
- public static readonly OUTPUT_FORMAT_GEOJSON = 2;
44
- public static readonly OUTPUT_FORMAT_GEOSVG = 3;
45
-
46
-
47
- // Arbitrary default values of attributes
48
- public static readonly MIN_ALT_DEFAULT: double = 0.0;
49
- public static readonly MAX_ALT_DEFAULT: double = 100.0;
50
- public static readonly RADIUS1_DEFAULT: double = 50.0;
51
- public static readonly RADIUS2_DEFAULT: double = 100.0;
52
- public static readonly LEFT_AZIMUTH_DEFAULT: double = 0.0;
53
- public static readonly RIGHT_AZIMUTH_DEFAULT: double = 90.0;
54
-
55
- public static readonly ERR_ATTRIBUTES_NOT_FORMATTED: string = "{\"type\":\"error\","
56
- + "\"error\":\"The attribute paramaters are not formatted "
57
- + "correctly";
58
-
59
- public static readonly DEFAULT_ATTRIBUTES: string =
60
- `{"attributes":[{"radius1":${WebRenderer.RADIUS1_DEFAULT},
61
- "radius2":${WebRenderer.RADIUS2_DEFAULT},
62
- "minalt":${WebRenderer.MIN_ALT_DEFAULT},"maxalt":${WebRenderer.MAX_ALT_DEFAULT},
63
- "leftAzimuth":${WebRenderer.LEFT_AZIMUTH_DEFAULT},"rightAzimuth":${WebRenderer.RIGHT_AZIMUTH_DEFAULT}}]}`;
64
-
65
-
66
- private static _initSuccess: boolean = false;
67
-
68
-
69
- private static init(): void {
70
- try {
71
- if (WebRenderer._initSuccess === false) {
72
- //use WebRenderer.setLoggingLevel()
73
-
74
- //sets default value for single point symbology to have an outline.
75
- //outline color will be automatically determined based on line color
76
- //unless a color value is manually set.
77
-
78
- //Set Renderer Settings/////////////////////////////////////////////
79
- RendererSettings.getInstance().setTextBackgroundMethod(
80
- RendererSettings.TextBackgroundMethod_OUTLINE_QUICK);
81
- //RendererSettings.getInstance().setLabelForegroundColor(Color.BLACK);
82
- //RendererSettings.getInstance().setLabelBackgroundColor(new Color(255, 255, 255, 200));
83
- RendererSettings.getInstance().setLabelFont("arial", Font.PLAIN, 12);
84
- ErrorLogger.setLevel(LogLevel.FINE);
85
-
86
- WebRenderer._initSuccess = true;
87
- }
88
-
89
- } catch (exc) {
90
- if (exc instanceof Error) {
91
- ErrorLogger.LogException("WebRenderer", "init", exc, LogLevel.WARNING);
92
- } else {
93
- throw exc;
94
- }
95
- }
96
-
97
-
98
- }
99
-
100
- /**\
101
- * Set minimum level at which an item can be logged.
102
- * In descending order:
103
- * OFF = Integer.MAX_VALUE
104
- * Severe = 1000
105
- * Warning = 900
106
- * Info = 800
107
- * Config = 700
108
- * Fine = 500
109
- * Finer = 400
110
- * Finest = 300
111
- * All = Integer.MIN_VALUE
112
- * Use like WebRenderer.setLoggingLevel(Level.INFO);
113
- * or
114
- * Use like WebRenderer.setLoggingLevel(800);
115
- */
116
- public static setLoggingLevel(level: LogLevel | int): void {
117
- if (level instanceof LogLevel) {
118
- try {
119
- ErrorLogger.setLevel(level, true);
120
- ErrorLogger.LogMessage("WebRenderer", "setLoggingLevel(Level)",
121
- "Logging level set to: " + ErrorLogger.getLevel().getName(),
122
- LogLevel.CONFIG);
123
- } catch (exc) {
124
- if (exc instanceof Error) {
125
- ErrorLogger.LogException("WebRenderer", "setLoggingLevel(Level)", exc, LogLevel.INFO);
126
- } else {
127
- throw exc;
128
- }
129
- }
130
- } else {
131
- try {
132
- if (level > 1000) {
133
- ErrorLogger.setLevel(LogLevel.OFF, true);
134
- } else if (level > 900) {
135
- ErrorLogger.setLevel(LogLevel.SEVERE, true);
136
- } else if (level > 800) {
137
- ErrorLogger.setLevel(LogLevel.WARNING, true);
138
- } else if (level > 700) {
139
- ErrorLogger.setLevel(LogLevel.INFO, true);
140
- } else if (level > 500) {
141
- ErrorLogger.setLevel(LogLevel.CONFIG, true);
142
- } else if (level > 400) {
143
- ErrorLogger.setLevel(LogLevel.FINE, true);
144
- } else if (level > 300) {
145
- ErrorLogger.setLevel(LogLevel.FINER, true);
146
- } else if (level > Number.MIN_VALUE) {
147
- ErrorLogger.setLevel(LogLevel.FINEST, true);
148
- } else {
149
- ErrorLogger.setLevel(LogLevel.ALL, true);
150
- }
151
-
152
- ErrorLogger.LogMessage("WebRenderer", "setLoggingLevel(int)",
153
- "Logging level set to: " + ErrorLogger.getLevel().getName(),
154
- LogLevel.CONFIG);
155
- } catch (exc) {
156
- if (exc instanceof Error) {
157
- ErrorLogger.LogException("WebRenderer", "setLoggingLevel(int)", exc, LogLevel.INFO);
158
- } else {
159
- throw exc;
160
- }
161
- }
162
- }
163
- }
164
-
165
-
166
- /**
167
- * Single Point Tactical Graphics are rendered from font files.
168
- * The font size you specify here determines how big the symbols will
169
- * be rendered. This should be set once at startup.
170
- * @param size
171
- */
172
- public static setTacticalGraphicPointSize(size: int): void {
173
- // sps.setTacticalGraphicPointSize(size);
174
- }
175
-
176
- /**
177
- * Units are rendered from font files.
178
- * The font size you specify here determines how big the symbols will
179
- * be rendered. This should be set once at startup.
180
- * @param size
181
- */
182
- public static setUnitPointSize(size: int): void {
183
- // sps.setUnitPointSize(size);
184
- }
185
-
186
- /**
187
- * Modifier Text Color will by default match the line color.
188
- * This will override all modifier text color.
189
- * @param hexColor
190
- */
191
- /* public static void setModifierTextColor(String hexColor)
192
- {
193
- Color textColor = RendererUtilities.getColorFromHexString(hexColor);
194
- if(textColor==null)
195
- {
196
- textColor = Color.black;
197
- }
198
- RendererSettings.getInstance().setLabelForegroundColor(textColor);
199
- }*/
200
-
201
-
202
-
203
-
204
-
205
- /**
206
- * Renders all multi-point symbols, creating KML that can be used to draw
207
- * it on a Google map. Multipoint symbols cannot be draw the same
208
- * at different scales. For instance, graphics with arrow heads will need to
209
- * redraw arrowheads when you zoom in on it. Similarly, graphics like a
210
- * Forward Line of Troops drawn with half circles can improve performance if
211
- * clipped when the parts of the graphic that aren't on the screen. To help
212
- * readjust graphics and increase performance, this function requires the
213
- * scale and bounding box to help calculate the new locations.
214
- * @param id A unique identifier used to identify the symbol by Google map.
215
- * The id will be the folder name that contains the graphic.
216
- * @param name a string used to display to the user as the name of the
217
- * graphic being created.
218
- * @param description a brief description about the graphic being made and
219
- * what it represents.
220
- * @param symbolCode A 20-30 digit symbolID corresponding to one of the
221
- * graphics in the MIL-STD-2525D
222
- * @param controlPoints The vertices of the graphics that make up the
223
- * graphic. Passed in the format of a string, using decimal degrees
224
- * separating lat and lon by a comma, separating coordinates by a space.
225
- * The following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."
226
- * @param altitudeMode Indicates whether the symbol should interpret
227
- * altitudes as above sea level or above ground level. Options are
228
- * "clampToGround", "relativeToGround" (from surface of earth), "absolute"
229
- * (sea level), "relativeToSeaFloor" (from the bottom of major bodies of
230
- * water).
231
- * @param scale A number corresponding to how many meters one meter of our
232
- * map represents. A value "50000" would mean 1:50K which means for every
233
- * meter of our map it represents 50000 meters of real world distance.
234
- * @param bbox The viewable area of the map. Passed in the format of a
235
- * string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required
236
- * but can speed up rendering in some cases.
237
- * example: "-50.4,23.6,-42.2,24.2"
238
- * @param modifiers {@link Map}, keyed using constants from Modifiers.
239
- * Pass in comma delimited String for modifiers with multiple values like AM, AN & X
240
- * @param attributes {@link Map}, keyed using constants from MilStdAttributes.
241
- * @param format An enumeration: 2 for GeoJSON.
242
- * @return A JSON string representation of the graphic.
243
- */
244
- public static RenderSymbol(id: string, name: string, description: string,
245
- symbolCode: string, controlPoints: string, altitudeMode: string,
246
- scale: double, bbox: string, modifiers: Map<string, string>, attributes: Map<string, string>, format: int): string {
247
- let output: string = "";
248
- try {
249
-
250
- JavaRendererUtilities.addAltModeToModifiersString(attributes, altitudeMode);
251
-
252
-
253
- output = MultiPointHandler.RenderSymbol(id, name, description, symbolCode, controlPoints,
254
- scale, bbox, modifiers, attributes, format);
255
-
256
- //DEBUGGING
257
- if (ErrorLogger.getLevel().intValue() <= LogLevel.FINER.intValue()) {
258
- console.log("");
259
- let sb: string = "";
260
- sb += ("\nID: " + id + "\n");
261
- sb += ("Name: " + name + "\n");
262
- sb += ("Description: " + description + "\n");
263
- sb += ("SymbolID: " + symbolCode + "\n");
264
- sb += ("Scale: " + scale.toString() + "\n");
265
- sb += ("BBox: " + bbox + "\n");
266
- sb += ("Coords: " + controlPoints + "\n");
267
- sb += ("Modifiers: " + modifiers + "\n");
268
- ErrorLogger.LogMessage("WebRenderer", "RenderSymbol", sb.toString(), LogLevel.FINER);
269
- }
270
- if (ErrorLogger.getLevel().intValue() <= LogLevel.FINEST.intValue()) {
271
- let briefOutput: string = output.replaceAll("</Placemark>", "</Placemark>\n");
272
- briefOutput = output.replaceAll("(?s)<description[^>]*>.*?</description>", "<description></description>");
273
- ErrorLogger.LogMessage("WebRenderer", "RenderSymbol", "Output:\n" + briefOutput, LogLevel.FINEST);
274
- }
275
-
276
-
277
-
278
- } catch (ea) {
279
- if (ea instanceof Error) {
280
-
281
- output = "{\"type\":'error',error:'There was an error creating the MilStdSymbol - " + ea.toString() + "'}";
282
- ErrorLogger.LogException("WebRenderer", "RenderSymbol", ea, LogLevel.WARNING);
283
- } else {
284
- throw ea;
285
- }
286
- }
287
-
288
- return output;
289
- }
290
-
291
-
292
-
293
-
294
-
295
- /**
296
- * Renders all multi-point symbols, creating KML or JSON for the user to
297
- * parse and render as they like.
298
- * This function requires the bounding box to help calculate the new
299
- * locations.
300
- * @param id A unique identifier used to identify the symbol by Google map.
301
- * The id will be the folder name that contains the graphic.
302
- * @param name a string used to display to the user as the name of the
303
- * graphic being created.
304
- * @param description a brief description about the graphic being made and
305
- * what it represents.
306
- * @param symbolCode A 20-30 digit symbolID corresponding to one of the
307
- * graphics in the MIL-STD-2525D
308
- * @param controlPoints The vertices of the graphics that make up the
309
- * graphic. Passed in the format of a string, using decimal degrees
310
- * separating lat and lon by a comma, separating coordinates by a space.
311
- * The following format shall be used "x1,y1 [xn,yn]..."
312
- * @param pixelWidth pixel dimensions of the viewable map area
313
- * @param pixelHeight pixel dimensions of the viewable map area
314
- * @param bbox The viewable area of the map. Passed in the format of a
315
- * string "lowerLeftX,lowerLeftY,upperRightX,upperRightY."
316
- * example: "-50.4,23.6,-42.2,24.2"
317
- * @param modifiers {@link Map}, keyed using constants from Modifiers.
318
- * Pass in comma delimited String for modifiers with multiple values like AM, AN &amp; X
319
- * @param attributes {@link Map}, keyed using constants from MilStdAttributes.
320
- * @param format An enumeration: 2 for GeoJSON.
321
- * @return A JSON (1) or KML (0) string representation of the graphic.
322
- */
323
- public static RenderSymbol2D(id: string, name: string, description: string, symbolCode: string, controlPoints: string,
324
- pixelWidth: int, pixelHeight: int, bbox: string, modifiers: Map<string, string>,
325
- attributes: Map<string, string>, format: int): string {
326
- let output: string = "";
327
- try {
328
- output = MultiPointHandler.RenderSymbol2D(id, name, description,
329
- symbolCode, controlPoints, pixelWidth, pixelHeight, bbox,
330
- modifiers, attributes, format);
331
- } catch (exc) {
332
- if (exc instanceof Error) {
333
- output = "{\"type\":'error',error:'There was an error creating the MilStdSymbol: " + symbolCode + " - ID: " + id + " " + exc.toString() + "'}";
334
- } else {
335
- throw exc;
336
- }
337
- }
338
- return output;
339
- }
340
-
341
-
342
- /**
343
- * Renders all MilStd 2525 multi-point symbols, creating MilStdSymbol that contains the
344
- * information needed to draw the symbol on the map.
345
- * DOES NOT support RADARC, CAKE, TRACK etc...
346
- * ArrayList&lt;Point2D&gt; milStdSymbol.getSymbolShapes[index].getPolylines()
347
- * and
348
- * ShapeInfo = milStdSymbol.getModifierShapes[index].
349
- *
350
- *
351
- * @param id
352
- * A unique identifier used to identify the symbol by Google map.
353
- * The id will be the folder name that contains the graphic.
354
- * @param name
355
- * a string used to display to the user as the name of the
356
- * graphic being created.
357
- * @param description
358
- * a brief description about the graphic being made and what it
359
- * represents.
360
- * @param symbolCode
361
- * A 20-30 digit symbolID corresponding to one of the graphics
362
- * in the MIL-STD-2525D
363
- * @param controlPoints
364
- * The vertices of the graphics that make up the graphic. Passed
365
- * in the format of a string, using decimal degrees separating
366
- * lat and lon by a comma, separating coordinates by a space. The
367
- * following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."
368
- * @param altitudeMode
369
- * Indicates whether the symbol should interpret altitudes as
370
- * above sea level or above ground level. Options are
371
- * "clampToGround", "relativeToGround" (from surface of earth),
372
- * "absolute" (sea level), "relativeToSeaFloor" (from the bottom
373
- * of major bodies of water).
374
- * @param scale
375
- * A number corresponding to how many meters one meter of our map
376
- * represents. A value "50000" would mean 1:50K which means for
377
- * every meter of our map it represents 50000 meters of real
378
- * world distance.
379
- * @param bbox
380
- * The viewable area of the map. Passed in the format of a string
381
- * "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required
382
- * but can speed up rendering in some cases. example:
383
- * "-50.4,23.6,-42.2,24.2"
384
- * @param modifiers
385
- * Used like:
386
- * modifiers.set(Modifiers.T_UNIQUE_DESIGNATION_1, "T");
387
- * Or
388
- * modifiers.set(Modifiers.AM_DISTANCE, "1000,2000,3000");
389
- * @param attributes
390
- * Used like:
391
- * attributes.set(MilStdAttributes.LineWidth, "3");
392
- * Or
393
- * attributes.set(MilStdAttributes.LineColor, "#00FF00");
394
- * @return MilStdSymbol
395
- */
396
- public static RenderMultiPointAsMilStdSymbol(id: string, name: string, description: string, symbolCode: string,
397
- controlPoints: string, altitudeMode: string, scale: double, bbox: string, modifiers: Map<string, string>, attributes: Map<string, string>): MilStdSymbol {
398
- let mSymbol: MilStdSymbol;
399
- try {
400
- mSymbol = MultiPointHandler.RenderSymbolAsMilStdSymbol(id, name, description, symbolCode,
401
- controlPoints, scale, bbox, modifiers, attributes);
402
-
403
- //Uncomment to show sector1 modifiers as fill pattern
404
- // int symbolSet = SymbolID.getEntityCode(symbolCode);
405
- // if(symbolSet == 270707 || symbolSet == 270800 || symbolSet == 270801 || symbolSet == 151100) //Mined Areas
406
- // {
407
- // int size = RendererSettings.getInstance().getDefaultPixelSize();
408
- //
409
- // ArrayList<ShapeInfo> shapes = mSymbol.getSymbolShapes();
410
- // if(shapes.length > 0){
411
- // ShapeInfo shape = shapes[0];
412
- // shape.setPatternFillImage(PatternFillRendererD.MakeSymbolPatternFill(symbolCode,size));
413
- // if(shape.getPatternFillImage() != null)
414
- // shape.setShader(new BitmapShader(shape.getPatternFillImage(), Shader.TileMode.REPEAT, Shader.TileMode.REPEAT));
415
- // }
416
- // }
417
- } catch (ea) {
418
- if (ea instanceof Error) {
419
- mSymbol = null;
420
- ErrorLogger.LogException("WebRenderer", "RenderMultiPointAsMilStdSymbol" + " - " + symbolCode, ea, LogLevel.WARNING);
421
- } else {
422
- throw ea;
423
- }
424
- }
425
-
426
- //console.log("RenderMultiPointAsMilStdSymbol exit");
427
- return mSymbol;
428
- }
429
-
430
- /**
431
- * Renders all MilStd 2525 multi-point symbols, creating MilStdSymbol that contains the
432
- * information needed to draw the symbol on the map.
433
- * DOES NOT support RADARC, CAKE, TRACK etc...
434
- * ArrayList&lt;Point2D&gt; milStdSymbol.getSymbolShapes[index].getPolylines()
435
- * and
436
- * ShapeInfo = milStdSymbol.getModifierShapes[index].
437
- *
438
- *
439
- * @param id
440
- * A unique identifier used to identify the symbol by Google map.
441
- * The id will be the folder name that contains the graphic.
442
- * @param name
443
- * a string used to display to the user as the name of the
444
- * graphic being created.
445
- * @param description
446
- * a brief description about the graphic being made and what it
447
- * represents.
448
- * @param basicShapeType
449
- * {@link BasicShapes}
450
- * @param controlPoints
451
- * The vertices of the graphics that make up the graphic. Passed
452
- * in the format of a string, using decimal degrees separating
453
- * lat and lon by a comma, separating coordinates by a space. The
454
- * following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."
455
- * @param altitudeMode
456
- * Indicates whether the symbol should interpret altitudes as
457
- * above sea level or above ground level. Options are
458
- * "clampToGround", "relativeToGround" (from surface of earth),
459
- * "absolute" (sea level), "relativeToSeaFloor" (from the bottom
460
- * of major bodies of water).
461
- * @param scale
462
- * A number corresponding to how many meters one meter of our map
463
- * represents. A value "50000" would mean 1:50K which means for
464
- * every meter of our map it represents 50000 meters of real
465
- * world distance.
466
- * @param bbox
467
- * The viewable area of the map. Passed in the format of a string
468
- * "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required
469
- * but can speed up rendering in some cases. example:
470
- * "-50.4,23.6,-42.2,24.2"
471
- * @param modifiers
472
- * Used like:
473
- * modifiers.set(Modifiers.T_UNIQUE_DESIGNATION_1, "T");
474
- * Or
475
- * modifiers.set(Modifiers.AM_DISTANCE, "1000,2000,3000");
476
- * @param attributes
477
- * Used like:
478
- * attributes.set(MilStdAttributes.LineWidth, "3");
479
- * Or
480
- * attributes.set(MilStdAttributes.LineColor, "#00FF00");
481
- * @return MilStdSymbol
482
- */
483
- public static RenderBasicShapeAsMilStdSymbol(id: string, name: string, description: string, basicShapeType: int,
484
- controlPoints: string, altitudeMode: string, scale: double, bbox: string, modifiers: Map<string, string>, attributes: Map<string, string>): MilStdSymbol {
485
- let mSymbol: MilStdSymbol;
486
- try {
487
- if (SymbolUtilities.isBasicShape(basicShapeType))
488
- mSymbol = MultiPointHandler.RenderBasicShapeAsMilStdSymbol(id, name, description, basicShapeType,
489
- controlPoints, scale, bbox, modifiers, attributes);
490
- } catch (ea) {
491
- if (ea instanceof Error) {
492
- mSymbol = null;
493
- ErrorLogger.LogException("WebRenderer", "RenderMultiPointAsMilStdSymbol" + " - " + basicShapeType, ea, LogLevel.WARNING);
494
- } else {
495
- throw ea;
496
- }
497
- }
498
-
499
- return mSymbol;
500
- }
501
-
502
- /**
503
- * Renders all multi-point symbols, creating KML that can be used to draw
504
- * it on a Google map. Multipoint symbols cannot be draw the same
505
- * at different scales. For instance, graphics with arrow heads will need to
506
- * redraw arrowheads when you zoom in on it. Similarly, graphics like a
507
- * Forward Line of Troops drawn with half circles can improve performance if
508
- * clipped when the parts of the graphic that aren't on the screen. To help
509
- * readjust graphics and increase performance, this function requires the
510
- * scale and bounding box to help calculate the new locations.
511
- * @param id A unique identifier used to identify the symbol by Google map.
512
- * The id will be the folder name that contains the graphic.
513
- * @param name a string used to display to the user as the name of the
514
- * graphic being created.
515
- * @param description a brief description about the graphic being made and
516
- * what it represents.
517
- * @param basicShapeType {@link BasicShapes}
518
- * @param controlPoints The vertices of the graphics that make up the
519
- * graphic. Passed in the format of a string, using decimal degrees
520
- * separating lat and lon by a comma, separating coordinates by a space.
521
- * The following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."
522
- * @param altitudeMode Indicates whether the symbol should interpret
523
- * altitudes as above sea level or above ground level. Options are
524
- * "clampToGround", "relativeToGround" (from surface of earth), "absolute"
525
- * (sea level), "relativeToSeaFloor" (from the bottom of major bodies of
526
- * water).
527
- * @param scale A number corresponding to how many meters one meter of our
528
- * map represents. A value "50000" would mean 1:50K which means for every
529
- * meter of our map it represents 50000 meters of real world distance.
530
- * @param bbox The viewable area of the map. Passed in the format of a
531
- * string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required
532
- * but can speed up rendering in some cases.
533
- * example: "-50.4,23.6,-42.2,24.2"
534
- * @param modifiers {@link Map}, keyed using constants from Modifiers.
535
- * Pass in comma delimited String for modifiers with multiple values like AM, AN &amp; X
536
- * @param attributes {@link Map}, keyed using constants from MilStdAttributes.
537
- * @param format An enumeration: 2 for GeoJSON.
538
- * @return A JSON string representation of the graphic.
539
- */
540
- public static RenderBasicShape(id: string, name: string, description: string,
541
- basicShapeType: int, controlPoints: string, altitudeMode: string,
542
- scale: double, bbox: string, modifiers: Map<string, string>, attributes: Map<string, string>, format: int): string {
543
- let output: string = "";
544
- try {
545
- JavaRendererUtilities.addAltModeToModifiersString(attributes, altitudeMode);
546
- if (SymbolUtilities.isBasicShape(basicShapeType))
547
- output = MultiPointHandler.RenderBasicShape(id, name, description, basicShapeType, controlPoints,
548
- scale, bbox, modifiers, attributes, format);
549
- } catch (ea) {
550
- if (ea instanceof Error) {
551
- output = "{\"type\":'error',error:'There was an error creating the MilStdSymbol - " + ea.toString() + "'}";
552
- ErrorLogger.LogException("WebRenderer", "RenderSymbol", ea, LogLevel.WARNING);
553
- } else {
554
- throw ea;
555
- }
556
- }
557
-
558
- return output;
559
- }
560
-
561
- /**
562
- * Given a symbol code meant for a single point symbol, returns the
563
- * anchor point at which to display that image based off the image returned
564
- * from the URL of the SinglePointServer.
565
- *
566
- * @param symbolID - the 20-30 digit symbolID of a single point MilStd2525
567
- * symbol.
568
- * @return A pixel coordinate of the format "x,y".
569
- * Returns an empty string if an error occurs.
570
- * @deprecated
571
- */
572
- public getSinglePointAnchor(symbolID: string): string {
573
- let anchorPoint: string = "";
574
- let anchor: Point2D = new Point2D();
575
- anchorPoint = anchor.getX() + "," + anchor.getY();
576
- return anchorPoint;
577
- }
578
-
579
- /**
580
- * Given a symbol code meant for a single point symbol, returns the
581
- * anchor point at which to display that image based off the image returned
582
- * from the URL of the SinglePointServer.
583
- *
584
- * @param symbolID - the 20-30 digit symbolID of a single point MilStd2525
585
- * symbol.
586
- * @return A pixel coordinate of the format "anchorX,anchorY,SymbolBoundsX,
587
- * SymbolBoundsY,SymbolBoundsWidth,SymbolBoundsHeight,IconWidth,IconHeight".
588
- * Anchor, represents the center point of the core symbol within the image.
589
- * The image should be centered on this point.
590
- * Symbol bounds represents the bounding rectangle of the core symbol within
591
- * the image.
592
- * IconWidth/Height represents the height and width of the image in its
593
- * entirety.
594
- * Returns an empty string if an error occurs.
595
- * @deprecated
596
- */
597
- public static getSinglePointInfo(symbolID: string): string {
598
- let info: string = "";
599
- let anchor: Point2D = new Point2D();
600
- let symbolBounds: Rectangle2D = new Rectangle2D();
601
- return info;
602
- }
603
-
604
- /**
605
- * Returns true if we recommend clipping a particular symbol.
606
- * Would return false for and Ambush but would return true for a Line of
607
- * Contact due to the decoration on the line.
608
- * @param symbolID
609
- * @return
610
- */
611
- public static ShouldClipMultipointSymbol(symbolID: string): string {
612
- if (MultiPointHandler.ShouldClipSymbol(symbolID)) {
613
-
614
- return "true";
615
- }
616
-
617
- else {
618
-
619
- return "false";
620
- }
621
-
622
- }
623
-
624
- /**
625
- * Given a symbol code meant for a single point symbol, returns the
626
- * symbol as a byte array.
627
- *
628
- * @param symbolID - the 20-30 digit symbolID of a single point MilStd2525
629
- * symbol.
630
- * @return byte array.
631
- * @deprecated
632
- */
633
- public static getSinglePointByteArray(symbolID: string): null {
634
- //return sps.getSinglePointByteArray(symbolID);
635
- return null;
636
- }
637
-
638
- /**
639
- * Converts a rectangle with two points and a width to a polygon that contains the four corners of the rectangle
640
- *
641
- * @param endpoints the two end points of the rectangle
642
- * @param width the width of the rectangle
643
- * @returns the points of a polygon containing the four points of a rectangle
644
- */
645
- public static getRectangleCorners(endpoints: string, width: number) {
646
- let pt0 = new POINT2();
647
- let pt1 = new POINT2();
648
- const points: POINT2[] = [];
649
-
650
- let attitude = new ref<number[]>();
651
- let a21 = new ref<number[]>();
652
-
653
- let coordinates = endpoints.split(" ");
654
- let latlon = coordinates[0].split(",");
655
- pt0.x = parseFloat(latlon[0]);
656
- pt0.y = parseFloat(latlon[1]);
657
-
658
- latlon = coordinates[1].split(",");
659
- pt1.x = parseFloat(latlon[0]);
660
- pt1.y = parseFloat(latlon[1]);
661
-
662
- mdlGeodesic.geodesic_distance(pt0, pt1, attitude, a21);
663
-
664
- points.push(mdlGeodesic.geodesic_coordinate(pt0, width / 2.0, attitude.value[0] - 90)); //top left
665
- points.push(mdlGeodesic.geodesic_coordinate(pt0, width / 2.0, attitude.value[0] + 90)); //top right
666
- points.push(mdlGeodesic.geodesic_coordinate(pt1, width / 2.0, attitude.value[0] + 90)); //bottom right
667
- points.push(mdlGeodesic.geodesic_coordinate(pt1, width / 2.0, attitude.value[0] - 90)); //bottom left
668
-
669
- let pointString = "";
670
- for(let point of points) {
671
- pointString += `${point.getX()},${point.getY()} `;
672
- }
673
- ;
674
- return pointString.trim();
675
-
676
- }
677
- }