StylePanel.js 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287
  1. /**
  2. * Created by Administrator on 2017/12/8 0008.
  3. */
  4. /**
  5. * 属性面板管理器
  6. * @param options
  7. * {
  8. * div - 属性面板div
  9. * scene - viewer.scene
  10. * graphicObjectHandler - 标绘Handler
  11. * }
  12. * @constructor
  13. * @example
  14. */
  15. var StylePanel = function(div,plotEditControl,plotting) {
  16. var _self = this;
  17. this._div = div;
  18. this._plottingEdit = plotEditControl;
  19. this._plotting = plotting;
  20. this._selectedFeature = undefined;
  21. this._group = ["基本", "衬线", "军标大小", "线型", "填充", "文本", "子标号", "箭头类型", "缩放比例", "旋转角度", "图片大小","绘制墙"];
  22. this._displayName = ["镜像", "标号级别", "点标号显示模式", "模型路径", "图片路径", "整体高度", "Width", "Height", "x", "y", "z", "拉伸高度", "模型缩放","矢量缩放"];
  23. this._displayLineStyleName = ["线宽", "边线颜色", "线型"];
  24. this._displayFillStyleName = ["背景色", "背景透明", "渐变填充角度", "渐变填充模式", "渐变填充竖直偏移", "渐变填充水平偏移", "前景色", "填充模式", "填充透明度"];
  25. this._displayTextContentName = ["注记内容", "注记位置", "字体背景颜色", "注记大小", "注记字体", "注记颜色", "字体边框", "边框宽度", "边框颜色", "总是显示中间注记"];
  26. this._displaySurroundLineName = ["衬线类型", "衬线宽", "衬线颜色", "衬线透明度"];
  27. this._displayPositionName = ["经度", "纬度", "高度"];
  28. this._displayExtendWallName = ["绘制墙","拉伸墙透明度"];
  29. this._algoGroup = ["贴地形"];
  30. this.init();
  31. // 标号被选中回调函数
  32. this._plottingEdit.SelectedEvent.addEventListener(function(geoGraphicObject) {
  33. _self._selectedFeature = geoGraphicObject;
  34. var rows = _self.collectionPropertyGridRows(_self._selectedFeature);
  35. $('#pg').propertygrid('loadData', rows);
  36. });
  37. // 选中标号被释放回调函数
  38. this._plottingEdit.UnSelectedEvent.addEventListener(function() {
  39. _self._selectedFeature = undefined;
  40. var rows = _self.collectionPropertyGridRows(_self._selectedFeature);
  41. $('#pg').propertygrid('loadData', rows);
  42. });
  43. this._plottingEdit.ModifiedEvent.addEventListener(function (geoGraphicObject) {
  44. _self._selectedFeature = geoGraphicObject;
  45. var rows = _self.collectionPropertyGridRows(_self._selectedFeature);
  46. $('#pg').propertygrid('loadData', rows);
  47. });
  48. this._plottingEdit.RemoveFeatureEvent.addEventListener(function() {
  49. _self._selectedFeature = undefined;
  50. var rows = _self.collectionPropertyGridRows(_self._selectedFeature);
  51. $('#pg').propertygrid('loadData', rows);
  52. });
  53. };
  54. /**
  55. * @private
  56. * @function init
  57. * @description 初始化属性面板
  58. */
  59. StylePanel.prototype.init = function() {
  60. var _self = this;
  61. function afterModifySelectFeature() {
  62. var updated = $('#pg').propertygrid('getChanges', "updated");
  63. if (updated.length !== 0) {
  64. _self.updateSelectFeature(updated[0], _self._selectedFeature);
  65. }
  66. var rows = _self.collectionPropertyGridRows(_self._selectedFeature);
  67. $('#pg').propertygrid('loadData', rows);
  68. }
  69. var stylePanel = document.getElementById(_self._div);
  70. var propertygrid = document.createElement('table');
  71. propertygrid.id = "pg";
  72. propertygrid.className = "easyui-propertygrid";
  73. stylePanel.appendChild(propertygrid);
  74. $('#pg').propertygrid({
  75. showGroup:true,
  76. columns : [[
  77. { field : 'name', title: 'Name', width: 100, resizable: true },
  78. { field : 'value', title: 'Value', width: 100, resizable: true }
  79. ]],
  80. onAfterEdit : afterModifySelectFeature
  81. });
  82. };
  83. /**
  84. * @param graphicObject
  85. * @returns {Array}
  86. */
  87. StylePanel.prototype.collectionPropertyGridRows = function(graphicObject) {
  88. if (null === graphicObject || undefined === graphicObject || graphicObject.symbolName === "GroupObject") {
  89. return [];
  90. }
  91. var rows = [];
  92. if (null !== graphicObject && undefined !== graphicObject) {
  93. rows = [
  94. {"name": "标号ID", "value": graphicObject.id, "group": "标号"},
  95. {"name": "标号库ID", "value": graphicObject.libID, "group": "标号"},
  96. {"name": "标号code", "value": graphicObject.code, "group": "标号"},
  97. {"name": "标号名字", "value": graphicObject.symbolName, "group": "标号"}
  98. ];
  99. var annotationRows = this.getAnnotationRows(graphicObject);
  100. var symbolRankRows = this.getSymbolRankRows(graphicObject);
  101. var surroundLineTypeRows = this.getSurroundLineTypeRows(graphicObject);
  102. var dotShowModeRows = this.getDotShowModeRows(graphicObject);
  103. var fillSymbolIDRows = this.getFillSymbolIDRows(graphicObject);
  104. var fillGradientRows = this.getFillGradientModeRows(graphicObject);
  105. var lineStyleRows = this.getLineStyleRows(graphicObject);
  106. var subSymbolsTypeRows = this.getSubSymbolsTypeRows(graphicObject);
  107. // 镜像
  108. var dotSymbolNegativeImageObj = new Object();
  109. dotSymbolNegativeImageObj.name = this._displayName[0];
  110. dotSymbolNegativeImageObj.value = this.checkboxValueToString(this._selectedFeature.isNegativeImage);
  111. dotSymbolNegativeImageObj.group = this._group[0];
  112. dotSymbolNegativeImageObj.editor = {"type": 'checkbox', "options": {"on": true, "off": false}};
  113. // 标号级别
  114. var dotSymbolRankObj = new Object();
  115. dotSymbolRankObj.name = this._displayName[1];
  116. dotSymbolRankObj.value = this.symbolRankToString(this._selectedFeature.symbolRank);
  117. dotSymbolRankObj.group = this._group[0];
  118. dotSymbolRankObj.editor = {
  119. "type": 'combobox',
  120. "options": {"valueField": 'value', "textField": 'text', "data": symbolRankRows}
  121. };
  122. // 显示模式
  123. var dotSymbolShowModeObj = new Object();
  124. dotSymbolShowModeObj.name = this._displayName[2];
  125. dotSymbolShowModeObj.value = this.showModeToString(this._selectedFeature.showMode);
  126. dotSymbolShowModeObj.group = this._group[0];
  127. dotSymbolShowModeObj.editor = {
  128. "type": 'combobox',
  129. "options": {"valueField": 'value', "textField": 'text', "data": dotShowModeRows}
  130. };
  131. // 模型ID
  132. var modelIdObj = new Object();
  133. modelIdObj.name = this._displayName[3];
  134. modelIdObj.value = this._selectedFeature.modelPath;
  135. modelIdObj.group = this._group[0];
  136. modelIdObj.editor = "text";
  137. // 图片路径
  138. var picturePathObj = new Object();
  139. picturePathObj.name = this._displayName[4];
  140. picturePathObj.value = this._selectedFeature.picturePath;
  141. picturePathObj.group = this._group[0];
  142. picturePathObj.editor = "text";
  143. // 线宽
  144. var lineWidthObj = new Object();
  145. lineWidthObj.name = this._displayLineStyleName[0];
  146. lineWidthObj.value = 1 === graphicObject._symbolType ? this._selectedFeature.gridLineWidth : this._selectedFeature.symbolStyle.lineWidth;
  147. lineWidthObj.group = this._group[3];
  148. lineWidthObj.editor = "text";
  149. // 线色
  150. var lineColorObj = new Object();
  151. lineColorObj.name = this._displayLineStyleName[1];
  152. lineColorObj.value = this.colorGeometryToString(this._selectedFeature.symbolStyle.lineColor);
  153. lineColorObj.group = this._group[3];
  154. lineColorObj.editor = "colorpicker";
  155. //拉伸墙
  156. var extendWallObj = new Object();
  157. extendWallObj.name = this._displayExtendWallName[0];
  158. extendWallObj.value = this._selectedFeature.extendWallHeight;
  159. extendWallObj.group = this._group[11];
  160. extendWallObj.editor = "text";
  161. //拉伸墙透明度
  162. var extendWallOpacity = new Object();
  163. extendWallOpacity.name = this._displayExtendWallName[1];
  164. extendWallOpacity.value = this._selectedFeature.extendWallOpacity;
  165. extendWallOpacity.group = this._group[11];
  166. extendWallOpacity.editor = "text";
  167. //贴地形
  168. var isClampToGround = new Object();
  169. isClampToGround.name = this._algoGroup[0];
  170. isClampToGround.value = this.checkboxValueToString(this._selectedFeature.isClampToGround);
  171. isClampToGround.group = this._group[0];
  172. isClampToGround.editor = {"type": 'checkbox', "options": {"on": true, "off": false}};
  173. // 线型
  174. var lineStyleObj = new Object();
  175. lineStyleObj.name = this._displayLineStyleName[2];
  176. lineStyleObj.value = this.lineStyleToString(this._selectedFeature.lineSymbolID);
  177. lineStyleObj.group = this._group[3];
  178. lineStyleObj.editor = {
  179. "type": 'combobox',
  180. "options": {"valueField": 'value', "textField": 'text', "data": lineStyleRows}
  181. };
  182. // 填充背景色
  183. var fillBackColorObj = new Object();
  184. fillBackColorObj.name = this._displayFillStyleName[0];
  185. fillBackColorObj.value = this.colorGeometryToString(this._selectedFeature.symbolStyle.fillBackColor);
  186. fillBackColorObj.group = this._group[4];
  187. fillBackColorObj.editor = "colorpicker";
  188. // 背景透明
  189. var fillBackOpaqueObj = new Object();
  190. fillBackOpaqueObj.name = this._displayFillStyleName[1];
  191. fillBackOpaqueObj.value = this._selectedFeature.symbolStyle.fillBackOpaque;
  192. fillBackOpaqueObj.group = this._group[4];
  193. fillBackOpaqueObj.editor = {"type": "checkbox", "options": {"on": true, "off": false}};
  194. // 渐变填充角度
  195. var fillGradientAngleObj = new Object();
  196. fillGradientAngleObj.name = this._displayFillStyleName[2];
  197. fillGradientAngleObj.value = this._selectedFeature.symbolStyle.fillGradientAngle;
  198. fillGradientAngleObj.group = this._group[4];
  199. fillGradientAngleObj.editor = "text";
  200. // 渐变填充模式
  201. var fillGradientModeObj = new Object();
  202. fillGradientModeObj.name = this._displayFillStyleName[3];
  203. fillGradientModeObj.value = this.fillGradientModeToString(this._selectedFeature.symbolStyle.fillGradientMode);
  204. fillGradientModeObj.group = this._group[4];
  205. fillGradientModeObj.editor = {
  206. "type": 'combobox',
  207. "options": {"valueField": 'value', "textField": 'text', "data": fillGradientRows}
  208. };
  209. // 渐变填充竖直偏移
  210. var fillGradientOffsetRatioYObj = new Object();
  211. fillGradientOffsetRatioYObj.name = this._displayFillStyleName[4];
  212. fillGradientOffsetRatioYObj.value = this._selectedFeature.symbolStyle.fillGradientOffsetRatioY;
  213. fillGradientOffsetRatioYObj.group = this._group[4];
  214. fillGradientOffsetRatioYObj.editor = "text";
  215. // 渐变填充水平偏移
  216. var fillGradientOffsetRatioXObj = new Object();
  217. fillGradientOffsetRatioXObj.name = this._displayFillStyleName[5];
  218. fillGradientOffsetRatioXObj.value = this._selectedFeature.symbolStyle.fillGradientOffsetRatioY;
  219. fillGradientOffsetRatioXObj.group = this._group[4];
  220. fillGradientOffsetRatioXObj.editor = "text";
  221. // 前景色
  222. var fillForeColorObj = new Object();
  223. fillForeColorObj.name = this._displayFillStyleName[6];
  224. fillForeColorObj.value = this.colorGeometryToString(this._selectedFeature.symbolStyle.fillForeColor);
  225. fillForeColorObj.group = this._group[4];
  226. fillForeColorObj.editor = "colorpicker";
  227. // 填充模式
  228. var fillSymbolIdObj = new Object();
  229. fillSymbolIdObj.name = this._displayFillStyleName[7];
  230. fillSymbolIdObj.value = this.fillSymbolIdToString(this._selectedFeature.symbolStyle.fillSymbolID);
  231. fillSymbolIdObj.group = this._group[4];
  232. fillSymbolIdObj.editor = {
  233. "type": 'combobox',
  234. "options": {"valueField": 'value', "textField": 'text', "data": fillSymbolIDRows}
  235. };
  236. // 填充透明度
  237. var fillOpaqueRateObj = new Object();
  238. fillOpaqueRateObj.name = this._displayFillStyleName[8];
  239. fillOpaqueRateObj.value = this._selectedFeature.symbolStyle.fillOpaqueRate;
  240. fillOpaqueRateObj.group = this._group[4];
  241. fillOpaqueRateObj.editor = "text";
  242. // 文本内容
  243. var textContentObj = new Object();
  244. textContentObj.name = this._displayTextContentName[0];
  245. if (34 == this._selectedFeature.symbolType) {
  246. textContentObj.value = this._selectedFeature.textContent;
  247. } else {
  248. textContentObj.value = this._selectedFeature.textContent;
  249. }
  250. textContentObj.group = this._group[5];
  251. textContentObj.editor = "text";
  252. // 注记位置
  253. var markPosObj = new Object();
  254. markPosObj.name = this._displayTextContentName[1];
  255. markPosObj.value = this.annotationToString(this._selectedFeature.textPos);
  256. markPosObj.group = this._group[5];
  257. markPosObj.editor = {
  258. "type": 'combobox',
  259. "options": {"valueField": 'value', "textField": 'text', "data": annotationRows}
  260. };
  261. // 字体背景颜色
  262. var fontBackColor = new Object();
  263. fontBackColor.name = this._displayTextContentName[2];
  264. fontBackColor.value = this.colorGeometryToString(this._selectedFeature.symbolTextStyle.backColor);
  265. fontBackColor.group = this._group[5];
  266. fontBackColor.editor = "colorpicker";
  267. // 注记字体大小
  268. var fontSizeObj = new Object();
  269. fontSizeObj.name = this._displayTextContentName[3];
  270. fontSizeObj.value = this._selectedFeature.symbolTextStyle.fontSize;
  271. fontSizeObj.group = this._group[5];
  272. fontSizeObj.editor = "text";
  273. // 注记字体名称
  274. var fontFamilyObj = new Object();
  275. fontFamilyObj.name = this._displayTextContentName[4];
  276. fontFamilyObj.value = this._selectedFeature.symbolTextStyle.fontName;
  277. fontFamilyObj.group = this._group[5];
  278. fontFamilyObj.editor = "text";
  279. // 注记字体颜色
  280. var fontColorObj = new Object();
  281. fontColorObj.name = this._displayTextContentName[5];
  282. fontColorObj.value = this.colorGeometryToString(this._selectedFeature.symbolTextStyle.foreColor);
  283. fontColorObj.group = this._group[5];
  284. fontColorObj.editor = "colorpicker";
  285. // 注记边框
  286. var fontHaloObj = new Object();
  287. fontHaloObj.name = this._displayTextContentName[6];
  288. fontHaloObj.value = this.checkboxValueToString(this._selectedFeature.symbolTextStyle.outline);
  289. fontHaloObj.group = this._group[5];
  290. fontHaloObj.editor = {"type": "checkbox", "options": {"on": true, "off": false}};
  291. // 注记边框宽度
  292. var outlineWidthObj = new Object();
  293. outlineWidthObj.name = this._displayTextContentName[7];
  294. outlineWidthObj.value = this._selectedFeature.symbolTextStyle.outlineWidth;
  295. outlineWidthObj.group = this._group[5];
  296. outlineWidthObj.editor = "text";
  297. // 注记边框颜色
  298. var outlineColorObj = new Object();
  299. outlineColorObj.name = this._displayTextContentName[8];
  300. outlineColorObj.value = this.colorGeometryToString(this._selectedFeature.symbolTextStyle.outlineColor);
  301. outlineColorObj.group = this._group[5];
  302. outlineColorObj.editor = "colorpicker";
  303. //总是显示中间注记
  304. var alwaysHasMiddelText = new Object();
  305. alwaysHasMiddelText.name = this._displayTextContentName[9];
  306. alwaysHasMiddelText.value = this.checkboxValueToString(this._selectedFeature.alwaysHasMiddelText);
  307. alwaysHasMiddelText.group = this._group[5];
  308. alwaysHasMiddelText.editor = {"type": 'checkbox', "options": {"on": true, "off": false}};
  309. // 衬线类型
  310. var surroundLineTypeObj = new Object();
  311. surroundLineTypeObj.name = this._displaySurroundLineName[0];
  312. surroundLineTypeObj.value = this.surroundLineTypeToString(this._selectedFeature);
  313. surroundLineTypeObj.group = this._group[1];
  314. surroundLineTypeObj.editor = {
  315. "type": 'combobox',
  316. "options": {"valueField": 'value', "textField": 'text', "data": surroundLineTypeRows}
  317. };
  318. // 衬线宽
  319. var surroundLineWidthObj = new Object();
  320. surroundLineWidthObj.name = this._displaySurroundLineName[1];
  321. surroundLineWidthObj.value = 1===this._selectedFeature.symbolType ? this._selectedFeature.gridSurroundLineWidth : this._selectedFeature.symbolStyle.surroundLineWidth;
  322. surroundLineWidthObj.group = this._group[1];
  323. surroundLineWidthObj.editor = "text";
  324. // 衬线色
  325. var surroundLineColorObj = new Object();
  326. surroundLineColorObj.name = this._displaySurroundLineName[2];
  327. surroundLineColorObj.value = this.colorGeometryToString(this._selectedFeature.symbolStyle.surroundLineColor);
  328. surroundLineColorObj.group = this._group[1];
  329. surroundLineColorObj.editor = "colorpicker";
  330. // 标号大小
  331. var gridSymbolSizeXObj, gridSymbolSizeYObj,pictureSymbolSizeXObj,pictureSymbolSizeYObj,rotationX, rotationY,rotationZ,scaleX,scaleY,scaleZ;
  332. var modelScale, modelRotateX, modelRotateY, modelRotateZ;
  333. if (this._selectedFeature._symbolType === 1) {
  334. gridSymbolSizeXObj = new Object();
  335. gridSymbolSizeXObj.name = this._displayName[6];
  336. gridSymbolSizeXObj.value = parseInt(this._selectedFeature.gridSymbolSize.x);
  337. gridSymbolSizeXObj.group = this._group[2];
  338. gridSymbolSizeXObj.editor = "text";
  339. // 标号大小
  340. gridSymbolSizeYObj = new Object();
  341. gridSymbolSizeYObj.name = this._displayName[7];
  342. gridSymbolSizeYObj.value = parseInt(this._selectedFeature.gridSymbolSize.y);
  343. gridSymbolSizeYObj.group = this._group[2];
  344. gridSymbolSizeYObj.editor = "text";
  345. // 图片大小X
  346. pictureSymbolSizeXObj = new Object();
  347. pictureSymbolSizeXObj.name = this._displayName[6];
  348. pictureSymbolSizeXObj.value = this._selectedFeature.pictureSymbolSize.x;
  349. pictureSymbolSizeXObj.group = this._group[10];
  350. pictureSymbolSizeXObj.editor = "text";
  351. // 图片大小Y
  352. pictureSymbolSizeYObj = new Object();
  353. pictureSymbolSizeYObj.name = this._displayName[7];
  354. pictureSymbolSizeYObj.value = this._selectedFeature.pictureSymbolSize.y;
  355. pictureSymbolSizeYObj.group = this._group[10];
  356. pictureSymbolSizeYObj.editor = "text";
  357. if(2 === this._selectedFeature.showMode){
  358. modelScale = new Object();
  359. modelScale.name = this._displayName[12];
  360. modelScale.value = this._selectedFeature.modelScale.x;
  361. modelScale.group = this._group[8];
  362. modelScale.editor = "text";
  363. }else if(0 === this._selectedFeature.showMode){
  364. // 缩放比例X
  365. scaleX = new Object();
  366. scaleX.name = this._displayName[13];
  367. scaleX.value = this._selectedFeature.vectorScale;
  368. scaleX.group = this._group[8];
  369. scaleX.editor = "text";
  370. }
  371. if(2 === this._selectedFeature.showMode){
  372. modelRotateX = new Object();
  373. modelRotateX.name = this._displayName[8];
  374. modelRotateX.value = this._selectedFeature.modelRotate.x;
  375. modelRotateX.group = this._group[9];
  376. modelRotateX.editor = "text";
  377. modelRotateY = new Object();
  378. modelRotateY.name = this._displayName[9];
  379. modelRotateY.value = this._selectedFeature.modelRotate.y;
  380. modelRotateY.group = this._group[9];
  381. modelRotateY.editor = "text";
  382. modelRotateZ = new Object();
  383. modelRotateZ.name = this._displayName[10];
  384. modelRotateZ.value = this._selectedFeature.modelRotate.z;
  385. modelRotateZ.group = this._group[9];
  386. modelRotateZ.editor = "text";
  387. }else if(0 === this._selectedFeature.showMode){
  388. // 旋转角度X
  389. rotationX = new Object();
  390. rotationX.name = this._displayName[8];
  391. rotationX.value = this._selectedFeature.vectorRotate.x;
  392. rotationX.group = this._group[9];
  393. rotationX.editor = "text";
  394. // 旋转角度Y
  395. rotationY = new Object();
  396. rotationY.name = this._displayName[9];
  397. rotationY.value = this._selectedFeature.vectorRotate.y;
  398. rotationY.group = this._group[9];
  399. rotationY.editor = "text";
  400. // 旋转角度Z
  401. rotationZ = new Object();
  402. rotationZ.name = this._displayName[10];
  403. rotationZ.value = this._selectedFeature.vectorRotate.z;
  404. rotationZ.group = this._group[9];
  405. rotationZ.editor = "text";
  406. }
  407. }
  408. var selectedFeature = this._selectedFeature;
  409. if (34 === selectedFeature.symbolType
  410. || 20 === selectedFeature.symbolType) {
  411. if (20 === selectedFeature.symbolType) {
  412. rows.push(picturePathObj);
  413. rows.push(pictureSymbolSizeXObj);
  414. rows.push(pictureSymbolSizeYObj);
  415. } else {
  416. rows.push(textContentObj);
  417. rows.push(fontHaloObj);
  418. rows.push(fontBackColor);
  419. rows.push(fontSizeObj);
  420. rows.push(fontFamilyObj);
  421. rows.push(fontColorObj);
  422. rows.push(outlineWidthObj);
  423. rows.push(outlineColorObj);
  424. }
  425. }
  426. if (selectedFeature.middleMarkExist) {
  427. rows.push(alwaysHasMiddelText);
  428. }
  429. // 点标号
  430. if (1 === selectedFeature.symbolType) {
  431. if (0 === selectedFeature.showMode
  432. || 1 === selectedFeature.showMode) {
  433. rows.push(surroundLineTypeObj);
  434. rows.push(surroundLineWidthObj);
  435. rows.push(surroundLineColorObj);
  436. rows.push(dotSymbolRankObj);
  437. }
  438. rows.push(dotSymbolShowModeObj);
  439. if (1 === selectedFeature.showMode) {
  440. rows.push(dotSymbolNegativeImageObj);
  441. }
  442. rows.push(modelIdObj);
  443. if (0 === selectedFeature.showMode) {
  444. rows.push(scaleX);
  445. rows.push(rotationX);
  446. rows.push(rotationY);
  447. rows.push(rotationZ);
  448. }
  449. if (2 === selectedFeature.showMode) {
  450. rows.push(modelScale);
  451. rows.push(modelRotateX);
  452. rows.push(modelRotateY);
  453. rows.push(modelRotateZ);
  454. }
  455. if (3 === selectedFeature.showMode) {
  456. rows.push(pictureSymbolSizeXObj);
  457. rows.push(pictureSymbolSizeYObj);
  458. }
  459. rows.push(picturePathObj);
  460. if (0 === selectedFeature.showMode
  461. || 1 === selectedFeature.showMode) {
  462. rows.push(fillBackColorObj);
  463. rows.push(fillBackOpaqueObj);
  464. rows.push(fillGradientAngleObj);
  465. rows.push(fillGradientModeObj);
  466. rows.push(fillGradientOffsetRatioYObj);
  467. rows.push(fillGradientOffsetRatioXObj);
  468. rows.push(fillForeColorObj);
  469. rows.push(fillSymbolIdObj);
  470. rows.push(fillOpaqueRateObj);
  471. }
  472. if (0 === selectedFeature.showMode
  473. || 1 === selectedFeature.showMode
  474. || 2 === selectedFeature.showMode) {
  475. rows.push(textContentObj);
  476. rows.push(fontSizeObj);
  477. rows.push(fontColorObj);
  478. rows.push(fontFamilyObj);
  479. rows.push(markPosObj);
  480. rows.push(fontHaloObj);
  481. rows.push(outlineWidthObj);
  482. rows.push(outlineColorObj);
  483. }
  484. if (0 === selectedFeature.showMode
  485. || 1 === selectedFeature.showMode) {
  486. rows.push(lineWidthObj);
  487. rows.push(lineColorObj);
  488. if (1 === selectedFeature.showMode) {
  489. rows.push(lineStyleObj);
  490. rows.push(gridSymbolSizeXObj);
  491. rows.push(gridSymbolSizeYObj);
  492. }
  493. }
  494. var longitudeObj = new Object();
  495. longitudeObj.name = this._displayPositionName[0];
  496. longitudeObj.value = selectedFeature.localPoints[0].x;
  497. longitudeObj.group = "位置点";
  498. longitudeObj.index = 0;
  499. longitudeObj.editor = "text";
  500. var latitudeObj = new Object();
  501. latitudeObj.name = this._displayPositionName[1];
  502. latitudeObj.value = selectedFeature.localPoints[0].y;
  503. latitudeObj.group = "位置点";
  504. latitudeObj.index = 0;
  505. latitudeObj.editor = "text";
  506. var altitudeObj = new Object();
  507. altitudeObj.name = this._displayPositionName[2];
  508. altitudeObj.value = selectedFeature.localPoints[0].z;
  509. altitudeObj.group = "位置点";
  510. altitudeObj.index = 0;
  511. altitudeObj.editor = "text";
  512. rows.push(longitudeObj);
  513. rows.push(latitudeObj);
  514. rows.push(altitudeObj);
  515. }
  516. else {
  517. rows.push(surroundLineTypeObj);
  518. rows.push(surroundLineWidthObj);
  519. rows.push(surroundLineColorObj);
  520. rows.push(fillBackColorObj);
  521. rows.push(fillBackOpaqueObj);
  522. rows.push(fillGradientAngleObj);
  523. rows.push(fillGradientModeObj);
  524. rows.push(fillGradientOffsetRatioYObj);
  525. rows.push(fillGradientOffsetRatioXObj);
  526. rows.push(fillForeColorObj);
  527. rows.push(fillSymbolIdObj);
  528. rows.push(fillOpaqueRateObj);
  529. rows.push(lineWidthObj);
  530. rows.push(lineColorObj);
  531. rows.push(extendWallObj);
  532. rows.push(extendWallOpacity);
  533. rows.push(isClampToGround);
  534. if(selectedFeature.subSymbols){
  535. //子标号
  536. for (var i=0; i<selectedFeature.subSymbols.length; ++i) {
  537. var objectSubCode = new Object();
  538. objectSubCode.name = "Code";
  539. objectSubCode.value = selectedFeature.subSymbols[i].code;
  540. objectSubCode.group = this._group[6];
  541. objectSubCode.editor = {"type":'combobox', "options" : { "valueField": 'value', "textField": 'text', "data" : subSymbolsTypeRows }};
  542. objectSubCode.index = i;
  543. rows.push(objectSubCode);
  544. }
  545. if ((0 === selectedFeature.subSymbols.length && 0 === selectedFeature.libID && 1025 === selectedFeature.code) ||
  546. (0 === selectedFeature.subSymbols.length && 100 === selectedFeature.libID && 25200 === selectedFeature.code) ||
  547. (0 === selectedFeature.subSymbols.length && 100 === selectedFeature.libID && 3020901 === selectedFeature.code)) {
  548. var objectSubCode1 = new Object();
  549. objectSubCode1.name = "Code";
  550. objectSubCode1.value = subSymbolsTypeString(selectedFeature.subSymbols.length, selectedFeature);
  551. objectSubCode1.group = this._group[6];
  552. objectSubCode1.editor = {"type" : 'combobox', "options" : { "valueField" : 'value', "textField" : "text", "data" : subSymbolsTypeRows }};
  553. objectSubCode1.index = i;
  554. rows.push(objectSubCode1);
  555. }
  556. }
  557. if (1025 === selectedFeature.symbolType && selectedFeature.subSymbols.length > 0) {
  558. var objectLibID = new Object();
  559. objectLibID.name = "LibID";
  560. objectLibID.value = libIDToString(selectedFeature.subSymbols[0].libID);
  561. objectLibID.group = this._group[6];
  562. objectLibID.editor = "text";
  563. rows.push(objectLibID);
  564. }
  565. for (var i=0; i<selectedFeature.localPoints.length; ++i) {
  566. var longitudeObj = new Object();
  567. longitudeObj.name = this._displayPositionName[0];
  568. longitudeObj.value = selectedFeature.localPoints[i].x;
  569. longitudeObj.group = "位置点"+(i+1);
  570. longitudeObj.index = i;
  571. longitudeObj.editor = "text";
  572. var latitudeObj = new Object();
  573. latitudeObj.name = this._displayPositionName[1];
  574. latitudeObj.value = selectedFeature.localPoints[i].y;
  575. latitudeObj.group = "位置点"+(i+1);
  576. latitudeObj.index = i;
  577. latitudeObj.editor = "text";
  578. var altitudeObj = new Object();
  579. altitudeObj.name = this._displayPositionName[2];
  580. altitudeObj.value = selectedFeature.localPoints[i].z;
  581. altitudeObj.group = "位置点"+(i+1);
  582. altitudeObj.index = i;
  583. altitudeObj.editor = "text";
  584. rows.push(longitudeObj);
  585. rows.push(latitudeObj);
  586. rows.push(altitudeObj);
  587. }
  588. }
  589. return rows;
  590. }
  591. };
  592. StylePanel.prototype.updateSelectFeature = function(updated, selectFeature) {
  593. var _self = this;
  594. if (null != updated && selectFeature) {
  595. switch (updated.name) {
  596. case this._displayName[0]:
  597. selectFeature.isNegativeImage = this.fromCheckboxValue(updated.value);
  598. break;
  599. case this._displayName[1]:
  600. selectFeature.symbolRank = parseInt(updated.value);
  601. break;
  602. case this._displayName[2]:
  603. var mode = parseInt(updated.value);
  604. if (2 === mode && 0 === selectFeature.modelPath.length) {
  605. return;
  606. }
  607. if (3 === mode && 0 === selectFeature.picturePath.length) {
  608. return;
  609. }
  610. selectFeature.showMode = parseInt(updated.value);
  611. break;
  612. case this._displayName[3]:
  613. selectFeature.modelPath = updated.value;
  614. break;
  615. case this._displayName[4]:
  616. selectFeature.picturePath = updated.value;
  617. break;
  618. case this._displayName[5]:
  619. selectFeature.symbolStyle.wholeHeight = parseInt(updated.value);
  620. break;
  621. case this._displayName[6]:
  622. if (updated.group === this._group[10]) {
  623. selectFeature.pictureSymbolSize = new SuperMap3D.Cartesian2(x = parseInt(updated.value),y = selectFeature.pictureSymbolSize.y);
  624. } else {
  625. selectFeature.gridSymbolSize = new SuperMap3D.Cartesian2(x = parseInt(updated.value),y = selectFeature.gridSymbolSize.y);
  626. }
  627. break;
  628. case this._displayName[7]:
  629. if (updated.group === this._group[10]) {
  630. selectFeature.pictureSymbolSize = new SuperMap3D.Cartesian2(x = selectFeature.pictureSymbolSize.x,y = parseInt(updated.value));
  631. } else {
  632. selectFeature.gridSymbolSize = new SuperMap3D.Cartesian2(x = selectFeature.gridSymbolSize.x,y = parseInt(updated.value));
  633. }
  634. break;
  635. case this._displayName[8]:
  636. if (updated.group === this._group[8]) {
  637. selectFeature.scale.x = parseInt(updated.value);
  638. } else if (updated.group === this._group[9]) {
  639. if (2 === selectFeature.showMode) {
  640. var rotate = selectFeature.modelRotate;
  641. selectFeature.setModelRotate(parseInt(updated.value), rotate.y , rotate.z);
  642. } else {
  643. var rotate = selectFeature.vectorRotate;
  644. selectFeature.setVectorRotate(parseInt(updated.value), rotate.y , rotate.z);
  645. }
  646. }
  647. break;
  648. case this._displayName[9]:
  649. if (updated.group === this._group[8]) {
  650. selectFeature.scale.y = parseInt(updated.value);
  651. } else if (updated.group === this._group[9]) {
  652. if (2 === selectFeature.showMode) {
  653. var rotate = selectFeature.modelRotate;
  654. selectFeature.setModelRotate(rotate.x, parseInt(updated.value), rotate.z);
  655. } else {
  656. var rotate = selectFeature.vectorRotate;
  657. selectFeature.setVectorRotate(rotate.x, parseInt(updated.value), rotate.z);
  658. }
  659. }
  660. break;
  661. case this._displayName[10]:
  662. if (updated.group === this._group[8]) {
  663. selectFeature.scale.z = parseInt(updated.value);
  664. } else if (updated.group === this._group[9]) {
  665. if (2 === selectFeature.showMode) {
  666. var rotate = selectFeature.modelRotate;
  667. selectFeature.setModelRotate(rotate.x, rotate.y, parseInt(updated.value));
  668. } else {
  669. var rotate = selectFeature.vectorRotate;
  670. selectFeature.setVectorRotate(rotate.x, rotate.y, parseInt(updated.value));
  671. }
  672. }
  673. break;
  674. case this._displayName[12]:
  675. var modelScale = selectFeature.modelScale;
  676. selectFeature.modelScale = parseInt(updated.value);
  677. break;
  678. case this._displayName[13]:
  679. selectFeature.vectorScale = parseFloat(updated.value);
  680. break;
  681. case this._displaySurroundLineName[0]:
  682. selectFeature.symbolStyle.surroundLineType = parseInt(updated.value);
  683. break;
  684. case this._displaySurroundLineName[1]:
  685. if (1 === selectFeature.symbolType) {
  686. selectFeature.gridSurroundLineWidth = parseInt(updated.value);
  687. } else {
  688. selectFeature.symbolStyle.surroundLineWidth = parseInt(updated.value);
  689. }
  690. break;
  691. case this._displaySurroundLineName[2]:
  692. selectFeature.symbolStyle.surroundLineColor = colorConvert(updated.value);
  693. break;
  694. case this._displaySurroundLineName[3]:
  695. break;
  696. case this._displayFillStyleName[0]:
  697. selectFeature.symbolStyle.fillBackColor = colorConvert(updated.value);
  698. break;
  699. case this._displayFillStyleName[1]:
  700. selectFeature.symbolStyle.fillBackOpaque = this.fromCheckboxValue(updated.value);
  701. break;
  702. case this._displayFillStyleName[2]:
  703. selectFeature.symbolStyle.fillGradientAngle = parseInt(updated.value);
  704. break;
  705. case this._displayFillStyleName[3]:
  706. selectFeature.symbolStyle.fillGradientMode = parseInt(updated.value);
  707. break;
  708. case this._displayFillStyleName[4]:
  709. selectFeature.symbolStyle.fillGradientOffsetRatioY = parseInt(updated.value);
  710. break;
  711. case this._displayFillStyleName[5]:
  712. selectFeature.symbolStyle.fillGradientOffsetRatioX = parseInt(updated.value);
  713. break;
  714. case this._displayFillStyleName[6]:
  715. selectFeature.symbolStyle.fillForeColor = colorConvert(updated.value);
  716. break;
  717. case this._displayFillStyleName[7]:
  718. selectFeature.symbolStyle.fillSymbolID = parseInt(updated.value);
  719. break;
  720. case this._displayFillStyleName[8]:
  721. selectFeature.symbolStyle.fillOpaqueRate = parseInt(updated.value);
  722. break;
  723. case this._displayLineStyleName[0]:
  724. if (1===selectFeature.symbolType) {
  725. selectFeature.gridLineWidth = parseFloat(updated.value);
  726. } else {
  727. selectFeature.symbolStyle.lineWidth = parseFloat(updated.value);
  728. }
  729. break;
  730. case this._displayLineStyleName[1]:
  731. selectFeature.symbolStyle.lineColor = colorConvert(updated.value);
  732. break;
  733. case this._displayLineStyleName[2]:
  734. selectFeature.lineSymbolID = parseInt(updated.value);
  735. break;
  736. case this._displayTextContentName[0]:
  737. selectFeature.textContent = updated.value;
  738. break;
  739. case this._displayTextContentName[1]:
  740. selectFeature.textPos = parseInt(updated.value);
  741. break;
  742. case this._displayTextContentName[2]:
  743. selectFeature.symbolTextStyle.backColor = colorConvert(updated.value);
  744. break;
  745. case this._displayTextContentName[3]:
  746. selectFeature.symbolTextStyle.fontSize = parseInt(updated.value);
  747. break;
  748. case this._displayTextContentName[4]:
  749. selectFeature.symbolTextStyle.fontName = updated.value;
  750. break;
  751. case this._displayTextContentName[5]:
  752. selectFeature.symbolTextStyle.foreColor = colorConvert(updated.value);
  753. break;
  754. case this._displayTextContentName[6]:
  755. selectFeature.symbolTextStyle.outline = this.fromCheckboxValue(updated.value);
  756. break;
  757. case this._displayTextContentName[7]:
  758. selectFeature.symbolTextStyle.outlineWidth = parseFloat(updated.value);
  759. break;
  760. case this._displayTextContentName[8]:
  761. selectFeature.symbolTextStyle.outlineColor = colorConvert(updated.value);
  762. break;
  763. case this._displayTextContentName[9]:
  764. selectFeature.alwaysHasMiddelText = this.fromCheckboxValue(updated.value);
  765. break;
  766. case this._displayPositionName[0]:
  767. var pts = [];
  768. for (var i=0; i<selectFeature.localPoints.length; ++i) {
  769. pts.push(selectFeature.localPoints[i].clone());
  770. }
  771. pts[updated.index].x = parseInt(updated.value);
  772. selectFeature.localPoints = pts;
  773. break;
  774. case this._displayPositionName[1]:
  775. var pts = [];
  776. for (var i=0; i<selectFeature.localPoints.length; ++i) {
  777. pts.push(selectFeature.localPoints[i].clone());
  778. }
  779. pts[updated.index].y = parseInt(updated.value);
  780. selectFeature.localPoints = pts;
  781. break;
  782. case this._displayPositionName[2]:
  783. var pts = [];
  784. for (var i=0; i<selectFeature.localPoints.length; ++i) {
  785. pts.push(selectFeature.localPoints[i].clone());
  786. }
  787. pts[updated.index].z = parseInt(updated.value);
  788. selectFeature.localPoints = pts;
  789. break;
  790. case this._displayExtendWallName[0]:
  791. selectFeature.extendWallHeight = parseFloat(updated.value);
  792. break;
  793. case this._displayExtendWallName[1]:
  794. selectFeature.extendWallOpacity = parseFloat(updated.value);
  795. break;
  796. case this._algoGroup[0]:
  797. selectFeature.isClampToGround = this.fromCheckboxValue(updated.value);
  798. break;
  799. default:
  800. break;
  801. }
  802. if (updated.group == this._group[6]) {
  803. if (updated.name == "LibID") {
  804. if (null !== updated.value) {
  805. selectFeature.subSymbols[0].libID = parseInt(updated.value);
  806. }
  807. }
  808. //设置子标号
  809. if (updated.name == "Code") {
  810. var code = parseInt(updated.value);
  811. if(selectFeature.symbolType === 1025 && code != null) {
  812. var symbolLibManager = this._plotting.getSymbolLibManager();
  813. var subCode = symbolLibManager.findSymbolByCode(code);
  814. if(subCode.length !== 0 && subCode[0].symbolType === "SYMBOL_DOT"){
  815. //selectFeature.subSymbols[updated.index] = {libID : subCode[0].libID, code : code};
  816. var temp = {libID : subCode[0].libID, code : code};
  817. selectFeature.setSubSymbols(temp,updated.index);
  818. }
  819. } else {
  820. var temp = {libID:selectFeature.libID,code:code };
  821. selectFeature.setSubSymbols(temp,updated.index);
  822. }
  823. }
  824. }
  825. }
  826. var rows = _self.collectionPropertyGridRows(_self._selectedFeature);
  827. $('#pg').propertygrid('loadData', rows);
  828. };
  829. function colorConvert(colorString) {
  830. var red = parseInt(colorString.slice(1, 3), 16) / 255;
  831. var green = parseInt(colorString.slice(3, 5), 16) / 255;
  832. var blue = parseInt(colorString.slice(5, 7), 16) / 255;
  833. return new SuperMap3D.Color(red,green,blue);
  834. }
  835. StylePanel.prototype.getAnnotationRows = function(graphicObject) {
  836. var annotationRows = [];
  837. annotationRows.push({"value" : "0", "text" : "左上"});
  838. annotationRows.push({"value" : "1", "text" : "左下"});
  839. annotationRows.push({"value" : "2", "text" : "右上"});
  840. annotationRows.push({"value" : "3", "text" : "右下"});
  841. annotationRows.push({"value" : "4", "text" : "上"});
  842. annotationRows.push({"value" : "5", "text" : "下"});
  843. annotationRows.push({"value" : "6", "text" : "左"});
  844. annotationRows.push({"value" : "7", "text" : "右"});
  845. if (graphicObject.middleMarkExist) {
  846. annotationRows.push({"value" : "8", "text" : "中间"});
  847. }
  848. return annotationRows;
  849. };
  850. StylePanel.prototype.getSymbolRankRows = function(graphicObject) {
  851. var symbolRanks = [];
  852. if (graphicObject && graphicObject.symbolRanks) {
  853. symbolRanks = graphicObject.symbolRanks;
  854. }
  855. var rows = [];
  856. rows.push({"value" : "0", "text" : "无级别"});
  857. for (var i=0; i<symbolRanks.length; ++i) {
  858. if (1 == symbolRanks[i]) {
  859. rows.push({"value" : "1", "text" : "军区级"});
  860. } else if (2 == symbolRanks[i]) {
  861. rows.push({"value" : "2", "text" : "副大军区级"});
  862. } else if (3 == symbolRanks[i]) {
  863. rows.push({"value" : "3", "text" : "集团军级"});
  864. } else if (4 == symbolRanks[i]) {
  865. rows.push({"value" : "4", "text" : "师级"});
  866. } else if (5 == symbolRanks[i]) {
  867. rows.push({"value" : "5", "text" : "旅级"});
  868. } else if (6 == symbolRanks[i]) {
  869. rows.push({"value" : "6", "text" : "团级"});
  870. } else if (7 == symbolRanks[i]) {
  871. rows.push({'value' : "7", "text" : "营级"});
  872. } else if (8 == symbolRanks[i]) {
  873. rows.push({'value' : "8", "text" : "连级"});
  874. } else if (9 == symbolRanks[i]) {
  875. rows.push({'value' : "9", "text" : "排级"});
  876. }
  877. }
  878. return rows;
  879. };
  880. StylePanel.prototype.getSurroundLineTypeRows = function(graphicObject) {
  881. var rows = [];
  882. if (null == graphicObject || undefined == graphicObject) {
  883. return [];
  884. }
  885. var symbolType = graphicObject.symbolType;
  886. if (1 == symbolType) {
  887. rows.push({"value" : "0", "text" : "无衬线"});
  888. rows.push({"value" : "1", "text" : "有衬线"});
  889. } else {
  890. rows.push({"value" : "0", "text" : "无衬线"});
  891. rows.push({"value" : "1", "text" : "内侧衬线"});
  892. rows.push({"value" : "2", "text" : "外侧衬线"});
  893. rows.push({"value" : "3", "text" : "双侧衬线"});
  894. }
  895. return rows;
  896. };
  897. StylePanel.prototype.getDotShowModeRows = function(graphicObject) {
  898. var rows = [];
  899. rows.push({"value" : "0", "text" : "矢量模式"});
  900. rows.push({"value" : "1", "text" : "公告板模式"});
  901. rows.push({"value" : "2", "text" : "模型模式"});
  902. rows.push({"value" : "3", "text" : "图片模式"});
  903. return rows;
  904. };
  905. StylePanel.prototype.getFillGradientModeRows = function(graphicObject) {
  906. var rows = [];
  907. rows.push({"value" : "0", "text" : "无渐变"});
  908. rows.push({"value" : "1", "text" : "线性渐变"});
  909. rows.push({"value" : "2", "text" : "辐射渐变"});
  910. return rows;
  911. };
  912. StylePanel.prototype.getLineStyleRows = function(graphicObject) {
  913. var rows = [];
  914. rows.push({"value" : "0", "text" : "实线"});
  915. rows.push({"value" : "1", "text" : "长虚线"});
  916. rows.push({"value" : "2", "text" : "由点构成的直线"});
  917. rows.push({"value" : "3", "text" : "由线划线段构成的直线"});
  918. rows.push({"value" : "4", "text" : "由重复的线划点图案构成的直线"});
  919. return rows;
  920. };
  921. StylePanel.prototype.getSubSymbolsTypeRows = function(graphicObject) {
  922. var rows = [];
  923. rows.push({"value" : "0", "text" : ""});
  924. if (100 === graphicObject.libID) {
  925. rows.push({"value" : "100", "text" : "陆军"});
  926. rows.push({"value" : "200", "text" : "海军"});
  927. rows.push({"value" : "300", "text" : "空军"});
  928. } else if (123 === graphicObject.libID) {
  929. rows.push({"value" : "10101", "text" : "武装警察部队"});
  930. rows.push({"value" : "10102", "text" : "防爆装甲"});
  931. rows.push({"value" : "10103", "text" : "火炮"});
  932. } else if (900 === graphicObject.libID) {
  933. rows.push({"value" : "910200", "text" : "人民防空重点城市"});
  934. rows.push({"value" : "910300", "text" : "人民防空基本指挥所"});
  935. rows.push({"value" : "910402", "text" : "水路抢修专业队"});
  936. } else if (0 === graphicObject.libID) {
  937. rows.push({"value" : "9", "text" : "刑警"});
  938. rows.push({"value" : "80103", "text" : "交警"});
  939. rows.push({"value" : "80109", "text" : "专业警"});
  940. }
  941. return rows;
  942. };
  943. function subSymbolsTypeString(subSymbolsLength, geometry) {
  944. if (0 === subSymbolsLength) {
  945. return "";
  946. } else {
  947. if (100 === geometry.libID) {
  948. if (100 === geometry.subSymbols[0].code) {
  949. return "陆军";
  950. }
  951. if (123 === geometry.subSymbols[0].code) {
  952. return "海军";
  953. }
  954. if (300 === geometry.subSymbols[0].code) {
  955. return "空军";
  956. }
  957. } else if (123 === geometry.libID) {
  958. if (10101 === geometry.subSymbols[0].code) {
  959. return "武装警察部队";
  960. }
  961. if (10102 === geometry.subSymbols[0].code) {
  962. return "防爆装甲";
  963. }
  964. if (10103 === geometry.subSymbols[0].code) {
  965. return "火炮";
  966. }
  967. } else if (900 === geometry.libID) {
  968. if (910200 === geometry.subSymbols[0].code) {
  969. return "人民防空重点城市";
  970. }
  971. if (910300 === geometry.subSymbols[0].code) {
  972. return "人民防空基本指挥所";
  973. }
  974. if (910402 === geometry.subSymbols[0].code) {
  975. return "水路抢修专业队";
  976. }
  977. } else if (0 === geometry.libID) {
  978. if (9 === geometry.subSymbols[0].code) {
  979. return "刑警";
  980. }
  981. if (80103 === geometry.subSymbols[0].code) {
  982. return "交警";
  983. }
  984. if (80109 === geometry.subSymbols[0].code) {
  985. return "专业警";
  986. }
  987. }
  988. }
  989. }
  990. function libIDToString(libID) {
  991. if (421 == libID) {
  992. return "421(警用库)";
  993. } else if (100 == libID) {
  994. return "100(军队库)";
  995. } else if (123 == libID) {
  996. return "123(武警库)";
  997. } else if (900 == libID) {
  998. return "900(人防库)";
  999. }
  1000. }
  1001. StylePanel.prototype.getFillSymbolIDRows = function(graphicObject) {
  1002. var rows = [];
  1003. rows.push({"value" : "0", "text" : "实填充"});
  1004. rows.push({"value" : "1", "text" : "无填充"});
  1005. // rows.push({"value" : "2", "text" : "向上斜填充"});
  1006. // rows.push({"value" : "3", "text" : "十字填充"});
  1007. // rows.push({"value" : "4", "text" : "交叉填充"});
  1008. // rows.push({"value" : "5", "text" : "反斜线填充"});
  1009. // rows.push({"value" : "6", "text" : "水平填充"});
  1010. // rows.push({"value" : "7", "text" : "竖直填充"});
  1011. return rows;
  1012. };
  1013. StylePanel.prototype.displayToString = function(display) {
  1014. if (display && display === "none") {
  1015. return "不显示";
  1016. }
  1017. return "显示";
  1018. };
  1019. StylePanel.prototype.checkboxValueToString = function(checkboxValue) {
  1020. if (true === checkboxValue) {
  1021. return "true";
  1022. } else if (false === checkboxValue) {
  1023. return "false";
  1024. }
  1025. };
  1026. StylePanel.prototype.fromCheckboxValue = function(checkboxStr) {
  1027. if ("true" === checkboxStr) {
  1028. return true;
  1029. } else if ("false" === checkboxStr) {
  1030. return false;
  1031. }
  1032. };
  1033. StylePanel.prototype.symbolRankToString = function(symbolRank) {
  1034. if (0 == symbolRank) {
  1035. return "无级别";
  1036. } else if (1 == symbolRank) {
  1037. return "军区级";
  1038. } else if (2 == symbolRank) {
  1039. return "副大军区级";
  1040. } else if (3 == symbolRank) {
  1041. return "集团军级";
  1042. } else if (4 == symbolRank) {
  1043. return "师级";
  1044. } else if (5 == symbolRank) {
  1045. return "旅级";
  1046. } else if (6 == symbolRank) {
  1047. return "团级";
  1048. } else if (7 == symbolRank) {
  1049. return "营级";
  1050. } else if (8 == symbolRank) {
  1051. return "连级";
  1052. } else if (9 == symbolRank) {
  1053. return "排级";
  1054. }
  1055. };
  1056. StylePanel.prototype.showModeToString = function(dotShowMode) {
  1057. if (0 === dotShowMode) {
  1058. return "矢量模式";
  1059. } else if (1 === dotShowMode) {
  1060. return "公告板模式";
  1061. } else if (2 === dotShowMode) {
  1062. return "模型模式";
  1063. } else if (3 === dotShowMode) {
  1064. return "图片模式";
  1065. } else {
  1066. return "未定义";
  1067. }
  1068. };
  1069. StylePanel.prototype.fillGradientModeToString = function(fillGradientMode) {
  1070. if (0 === fillGradientMode) {
  1071. return "无渐变";
  1072. } else if (1 === fillGradientMode) {
  1073. return "线性渐变";
  1074. } else if (2 === fillGradientMode) {
  1075. return "辐射渐变";
  1076. }
  1077. };
  1078. StylePanel.prototype.annotationToString = function(annotation) {
  1079. if (0 === annotation) {
  1080. return "左上";
  1081. } else if (1 === annotation) {
  1082. return "左下";
  1083. } else if (2 === annotation) {
  1084. return "右上";
  1085. } else if (3 === annotation) {
  1086. return "右下";
  1087. } else if (4 === annotation) {
  1088. return "上";
  1089. } else if (5 === annotation) {
  1090. return "下";
  1091. } else if (6 === annotation) {
  1092. return "左";
  1093. } else if (7 === annotation) {
  1094. return "右";
  1095. } else if (8 === annotation) {
  1096. return "中间";
  1097. }
  1098. };
  1099. StylePanel.prototype.surroundLineTypeToString = function(graphicObject) {
  1100. if (1 === graphicObject.symbolType) {
  1101. if (0 === graphicObject.symbolStyle.surroundLineType) {
  1102. return "无衬线";
  1103. } else if (1 === graphicObject.symbolStyle.surroundLineType) {
  1104. return "有衬线";
  1105. }
  1106. } else {
  1107. if (0 === graphicObject.symbolStyle.surroundLineType) {
  1108. return "无衬线";
  1109. } else if (1 === graphicObject.symbolStyle.surroundLineType) {
  1110. return "内侧衬线";
  1111. } else if (2 === graphicObject.symbolStyle.surroundLineType) {
  1112. return "外侧衬线";
  1113. } else if (3 === graphicObject.symbolStyle.surroundLineType) {
  1114. return "双侧衬线";
  1115. }
  1116. }
  1117. };
  1118. StylePanel.prototype.colorGeometryToString = function(color) {
  1119. var value = color.value;
  1120. var red, green, blue;
  1121. if (undefined !== value && null !== value) {
  1122. red = value[2]>15 ? value[2].toString(16) : "0" + value[2].toString(16);
  1123. green = value[1]>15 ? value[2].toString(16) : "0" + value[1].toString(16);
  1124. blue = value[0]>15 ? value[0].toString(16) : "0" + value[0].toString(16);
  1125. } else {
  1126. red = color.red * 255;
  1127. red = red > 15 ? red.toString(16) : "0" + red;
  1128. green = color.green * 255;
  1129. green = green > 15 ? green.toString(16) : "0" + green;
  1130. blue = color.blue * 255;
  1131. blue = blue > 15 ? blue.toString(16) : "0" + blue;
  1132. }
  1133. return "#" + red + green + blue;
  1134. };
  1135. StylePanel.prototype.lineStyleToString = function(lineStyle) {
  1136. if (0 === lineStyle) {
  1137. return "实线";
  1138. } else if (1 === lineStyle) {
  1139. return "长虚线";
  1140. } else if (2 === lineStyle) {
  1141. return "由点构成的直线";
  1142. } else if (3 === lineStyle) {
  1143. return "由线划线段构成的直线";
  1144. } else if (4 === lineStyle) {
  1145. return "由重复的线划点图案构成的直线";
  1146. }
  1147. };
  1148. StylePanel.prototype.fillSymbolIdToString = function(fillSymbolID) {
  1149. switch (fillSymbolID) {
  1150. case 0:
  1151. return "实填充";
  1152. case 1:
  1153. return "无填充";
  1154. }
  1155. };