userSetting.js 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656
  1. /**
  2. * @fileoverview 全局设置 模块
  3. * @author Song.Huang
  4. * @version 1.0.0
  5. */
  6. define(['html!templates/user/userSetting',
  7. 'css!styles/user/userSetting'
  8. ], function (tplLayout) {
  9. /**
  10. * 模块数据 用于数据存储和外部调用
  11. * @type {Object}
  12. * 数据存放
  13. */
  14. var modValue = {}
  15. /**
  16. * 是否已经初始化
  17. * @type {Boolean}
  18. * @default false
  19. */
  20. var status = {
  21. initialized: false,
  22. //是否可以post数据 用于表单验证
  23. canPost: false
  24. };
  25. /**
  26. * 初始化
  27. * @type {Function}
  28. */
  29. function init(jiD) {
  30. if (!status.initialized) {
  31. setLayout();
  32. //bindEvent();
  33. status.initialized = true;
  34. } else {
  35. $("#globalSetting").show();
  36. }
  37. //设置zIndex 为最高
  38. //var zIndex = ONEMAP.M.sideBar.getZIndex();
  39. //$('#globalSetting').css({zIndex:zIndex});
  40. //ONEMAP.D.currentSideBarMod = 'userSetting';
  41. //开启侧栏
  42. //ONEMAP.C.publisher.publish('show','layout::sideBar');
  43. if (jiD == 3) {
  44. $(".left_header ul li").removeClass("active");
  45. $(".left_header ul li").eq(1).addClass("active");
  46. $("#map3DSetting").show();
  47. $("#map2DSetting").hide();
  48. }
  49. };
  50. /**
  51. * 设置界面
  52. */
  53. function setLayout() {
  54. $(tplLayout).appendTo($("body"));
  55. $("#globalSetting .panel-body .itemleft .left_header ul li").eq(0).addClass('active');
  56. $("#map2DSetting").show();
  57. $("#thematicSetting").addClass('active');
  58. $("#model3DSetting").addClass('active');
  59. // $("#IGoalsContentSetting").addClass('active');
  60. layoutResize();
  61. $(window).resize(function () {
  62. layoutResize();
  63. });
  64. if (ONEMAP.D.globalSettingData.mapSetting) {
  65. $('#mapLat').val(ONEMAP.D.globalSettingData.mapSetting.center.lat);
  66. $('#mapLng').val(ONEMAP.D.globalSettingData.mapSetting.center.lng);
  67. $('#mapZoom').val(ONEMAP.D.globalSettingData.mapSetting.zoom);
  68. $('#mapType').val(ONEMAP.D.globalSettingData.mapSetting.type);
  69. }
  70. buildDxForm();
  71. $("#map2DSettingInfoContent .thematicModelList").mCustomScrollbar({
  72. scrollInertia: 100
  73. });
  74. $("#thematicList ul").mCustomScrollbar({
  75. scrollInertia: 100
  76. });
  77. $("#globalSetting .panel-body").mCustomScrollbar({
  78. scrollInertia: 100
  79. });
  80. buildMxForm();
  81. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar({
  82. scrollInertia: 100
  83. });
  84. $("#model3DList ul").mCustomScrollbar({
  85. scrollInertia: 100
  86. });
  87. buildThemativC();
  88. $("#map2DSettingInfoContent .thematicCategoryList").mCustomScrollbar({
  89. scrollInertia: 100
  90. });
  91. buildModelC();
  92. $("#map3DSettingInfoContent .model3DCategoryList").mCustomScrollbar({
  93. scrollInertia: 100
  94. });
  95. buildIGList();
  96. $("#IGoalsSettingInfoContent .iGItemList").mCustomScrollbar({
  97. scrollInertia: 100
  98. });
  99. buildIGCa();
  100. $("#IGoalsSettingInfoContent .iGItemCList").mCustomScrollbar({
  101. scrollInertia: 100
  102. });
  103. buildKuozhan();
  104. bindEvent();
  105. }
  106. /**
  107. * 分类保存显示
  108. */
  109. function reSetLayout() {
  110. if (ONEMAP.D.globalSettingData.mapSetting) {
  111. $('#mapLat').val(ONEMAP.D.globalSettingData.mapSetting.center.lat);
  112. $('#mapLng').val(ONEMAP.D.globalSettingData.mapSetting.center.lng);
  113. $('#mapZoom').val(ONEMAP.D.globalSettingData.mapSetting.zoom);
  114. $('#mapType').val(ONEMAP.D.globalSettingData.mapSetting.type);
  115. }
  116. buildDxForm();
  117. $("#map2DSettingInfoContent .thematicModelList").mCustomScrollbar({
  118. scrollInertia: 100
  119. });
  120. $("#thematicList ul").mCustomScrollbar({
  121. scrollInertia: 100
  122. });
  123. $("#globalSetting .panel-body").mCustomScrollbar({
  124. scrollInertia: 100
  125. });
  126. buildMxForm();
  127. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar({
  128. scrollInertia: 100
  129. });
  130. $("#model3DList ul").mCustomScrollbar({
  131. scrollInertia: 100
  132. });
  133. buildThemativC();
  134. $("#map2DSettingInfoContent .thematicCategoryList").mCustomScrollbar({
  135. scrollInertia: 100
  136. });
  137. buildModelC();
  138. $("#map3DSettingInfoContent .model3DCategoryList").mCustomScrollbar({
  139. scrollInertia: 100
  140. });
  141. buildIGList();
  142. $("#IGoalsSettingInfoContent .iGItemList").mCustomScrollbar({
  143. scrollInertia: 100
  144. });
  145. buildIGCa();
  146. $("#IGoalsSettingInfoContent .iGItemCList").mCustomScrollbar({
  147. scrollInertia: 100
  148. });
  149. bindEvent();
  150. };
  151. /**
  152. * 界面重置
  153. * @return {[type]} [description]
  154. */
  155. function layoutResize() {
  156. //$('#map2DSettingInfoContent .body').css({height:$(window).height()-145-$("#map2DForm").height()});
  157. //$('#mxList .body').css({height:$(window).height()-145-$("#map2DForm").height()});
  158. $("#globalSetting .panel-body").css({
  159. height: $(window).height() - 100
  160. });
  161. $("#globalSetting .panel-body .itemleft").css({
  162. height: $(window).height() - 100
  163. });
  164. $("#globalSetting .panel-body .itemright").css({
  165. height: $(window).height() - 100
  166. });
  167. $("#thematicList").css({
  168. height: $(window).height() - 360
  169. });
  170. $("#thematicList .listContent").css({
  171. height: $("#thematicList").height() - 30
  172. })
  173. $("#model3DList").css({
  174. height: $(window).height() - 360
  175. });
  176. $("#model3DList .listContent").css({
  177. height: $("#model3DList").height() - 30
  178. })
  179. $("#iGNameList").css({
  180. height: $(window).height() - 200
  181. });
  182. $("#iGNameList .listContent").css({
  183. height: $("#model3DList").height() - 30
  184. })
  185. }
  186. /**
  187. * 获取扩展服务
  188. * @return {[type]} [description]
  189. */
  190. function buildKuozhan() {
  191. // var kz = onemapUrlConfig.defaultGlobalSettingData.kuozhanLink;
  192. if (ONEMAP.D.globalSettingData.kuozhanLink) {
  193. var kz = ONEMAP.D.globalSettingData.kuozhanLink;
  194. // console.log(kz);
  195. for (var i = 0, l = kz.length; i < l; i++) {
  196. var title = kz[i].title;
  197. var link = kz[i].link;
  198. var liDom = $('<li><p><span>名称:</span><input type="text" value="' + title + '" name="title"></p><p><span>链接:</span><input type="text" value="' + link + '" class="linkAddr"></p><button>删除</button></li>');
  199. liDom.appendTo($("#kzList"));
  200. }
  201. }
  202. };
  203. /**
  204. * 界面事件绑定
  205. * @return {[type]} [description]
  206. */
  207. function bindEvent() {
  208. //添加拓展服务
  209. $(".add-kz").bind("click", function () {
  210. var liDom = $('<li><p><span>名称:</span><input type="text" name="title"></p><p><span>链接:</span><input type="text" class="linkAddr"></p><button>删除</button></li>');
  211. liDom.appendTo($("#kzList"));
  212. $("#kzList button").bind("click", function () {
  213. $(this).parent().remove();
  214. })
  215. })
  216. $("#kzList button").bind("click", function () {
  217. $(this).parent().remove();
  218. })
  219. $(".chhoostListContent").on('mouseleave', $("#globalSetting"), function () {
  220. $(".chhoostListContent").hide();
  221. })
  222. $("#globalSetting .panel-footer .sure").unbind('click').bind('click', function () {
  223. saveSetting();
  224. });
  225. $("#globalSetting .panel-header .closeSetting").unbind('click').bind('click', function () {
  226. $("#globalSetting").hide();
  227. })
  228. //面板切换
  229. $("#globalSetting .panel-body .itemleft .left_header ul li").unbind('click').bind('click', function () {
  230. if ($(this).hasClass('active')) {
  231. return false;
  232. } else {
  233. var contentId = $(this).attr('tab');
  234. $(this).addClass('active');
  235. $(this).siblings().removeClass('active');
  236. $("#" + contentId).show();
  237. $("#" + contentId).siblings().hide();
  238. $("#" + contentId + "InfoContent").show();
  239. $("#" + contentId + "InfoContent").siblings().hide();
  240. }
  241. })
  242. $("#thematicSetting").unbind('click').bind('click', function () {
  243. $(".thematicModelList").show();
  244. $(".thematicCategoryList").hide();
  245. $("#thematicSetting").addClass('active');
  246. $("#thematicCategorySetting,#kuozhanSetting").removeClass('active');
  247. $("#thematicList .add-new").show();
  248. $("#thematicList .add-newCa,.kuozhanList,#thematicList .add-kz").hide();
  249. })
  250. $("#thematicCategorySetting").unbind('click').bind('click', function () {
  251. $(".thematicModelList").hide();
  252. $(".thematicCategoryList").show();
  253. $("#thematicSetting,#kuozhanSetting").removeClass('active');
  254. $("#thematicCategorySetting").addClass('active');
  255. $("#thematicList .add-new,.kuozhanList,#thematicList .add-kz").hide();
  256. $("#thematicList .add-newCa").show();
  257. })
  258. $("#kuozhanSetting").unbind('click').bind('click', function () {
  259. $(".kuozhanList,#thematicList .add-kz").show();
  260. $(".beforelist,#thematicList .beforelink").hide();
  261. $(".beforebtn").removeClass('active');
  262. $("#kuozhanSetting").addClass('active');
  263. })
  264. $("#model3DSetting").unbind('click').bind('click', function () {
  265. $(".model3DModelList").show();
  266. $(".model3DCategoryList").hide();
  267. $("#model3DSetting").addClass('active');
  268. $("#model3DCategorySetting").removeClass('active');
  269. $("#model3DList .add-new").show();
  270. $("#model3DList .add-newb").show();
  271. $("#model3DList .add-newCa").hide();
  272. })
  273. $("#model3DCategorySetting").unbind('click').bind('click', function () {
  274. $(".model3DModelList").hide();
  275. $(".model3DCategoryList").show();
  276. $("#model3DSetting").removeClass('active');
  277. $("#model3DCategorySetting").addClass('active');
  278. $("#model3DList .add-new").hide();
  279. $("#model3DList .add-newb").hide();
  280. $("#model3DList .add-newCa").show();
  281. })
  282. // $("#IGoalsContentSetting").unbind('click').bind('click', function () {
  283. // $(".iGItemList").show();
  284. // $(".iGItemCList").hide();
  285. // $("#IGoalsContentSetting").addClass('active');
  286. // $("#IGoalsCategorySetting").removeClass('active');
  287. // $("#iGNameList .add-new").show();
  288. // $("#iGNameList .add-newCa").hide();
  289. // })
  290. // $("#IGoalsCategorySetting").unbind('click').bind('click', function () {
  291. // $(".iGItemList").hide();
  292. // $(".iGItemCList").show();
  293. // $("#IGoalsContentSetting").removeClass('active');
  294. // $("#IGoalsCategorySetting").addClass('active');
  295. // $("#iGNameList .add-new").hide();
  296. // $("#iGNameList .add-newCa").show();
  297. // })
  298. $('#thematicList .add-new').unbind('click').bind('click', function () {
  299. $(".bacover").show();
  300. $("#map2DOrigin").show();
  301. });
  302. $("#map2DOrigin .originSure").unbind('click').bind('click', function () {
  303. $(".bacover").hide();
  304. $("#map2DOrigin").hide();
  305. var type = $("#map2DOrigin .map2DOrigin").val();
  306. addNewDxForm(type);
  307. })
  308. $("#map2DOrigin .originCancel").unbind('click').bind('click', function () {
  309. $(".bacover").hide();
  310. $("#map2DOrigin").hide();
  311. })
  312. $('#map2DSettingInfoContent .delete').unbind('click').bind('click', function (e) {
  313. if (window.confirm('确定删除?')) {
  314. var el = e.target ? e.target : e.srcElement;
  315. $(el).parent().remove();
  316. $("#map2DSettingInfoContent .thematicModelList").mCustomScrollbar('update');
  317. }
  318. });
  319. $('#map2DSettingInfoContent .up').unbind('click').bind('click', function (e) {
  320. var _this = $(this).parent();
  321. $(_this).prev().before(_this)
  322. })
  323. $('#map2DSettingInfoContent .down').unbind('click').bind('click', function (e) {
  324. var _this = $(this).parent();
  325. $(_this).next().after(_this)
  326. })
  327. $('#map2DSettingInfoContent .addsx').unbind('click').bind('click', function (e) {
  328. var dom = $(this).parent().find(".zixiang").eq(0).clone();
  329. $(this).parent().append(dom);
  330. })
  331. $('#mxList .up').unbind('click').bind('click', function (e) {
  332. var _this = $(this).parent();
  333. $(_this).prev().before(_this)
  334. })
  335. $('#mxList .down').unbind('click').bind('click', function (e) {
  336. var _this = $(this).parent();
  337. $(_this).next().after(_this)
  338. })
  339. $('#model3DList .add-new').unbind('click').bind('click', function () {
  340. addNewMxForm();
  341. });
  342. $('#model3DList .add-newb').unbind('click').bind('click', function () {
  343. seTdModel();
  344. });
  345. $('#iGNameList .add-new').unbind('click').bind('click', function () {
  346. addNewIGForm();
  347. });
  348. $('#mxList .delete').unbind('click').bind('click', function (e) {
  349. if (window.confirm('确定删除?')) {
  350. var el = e.target ? e.target : e.srcElement;
  351. $(el).parent().remove();
  352. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar('update');
  353. }
  354. });
  355. $('#iGList .delete').unbind('click').bind('click', function (e) {
  356. if (window.confirm('确定删除?')) {
  357. var el = e.target ? e.target : e.srcElement;
  358. $(el).parent().remove();
  359. $("#IGoalsSettingInfoContent .iGItemCList").mCustomScrollbar('update');
  360. }
  361. });
  362. $("#dxCList li .delete").unbind('click').bind('click', function () {
  363. if (window.confirm('确定删除?')) {
  364. var name = $(this).prev().html();
  365. removeThematicClumn(name);
  366. $(this).parent().parent().remove();
  367. $("#map2DSettingInfoContent .thematicCategoryList").mCustomScrollbar('update');
  368. }
  369. })
  370. $("#dxCList li .editer").unbind('click').bind('click', function () {
  371. $(this).parent().parent().find('.li_control').hide();
  372. $(this).parent().parent().find('.li_control_Ch').show();
  373. });
  374. $("#dxCList li .cancel").unbind('click').bind('click', function () {
  375. $(this).parent().parent().find('.li_control').show();
  376. $(this).parent().parent().find('.li_control_Ch').hide();
  377. });
  378. $("#dxCList li .sure").unbind('click').bind('click', function () {
  379. //数据保存
  380. var data = {
  381. newName: $(this).prev().val(),
  382. oldName: $(this).parent().prev().prev().html(),
  383. };
  384. dxCListCaSure(data);
  385. $(this).parent().parent().find('.li_control').show();
  386. $(this).parent().parent().find('.li_control_Ch').hide();
  387. });
  388. $("#mxCList li .delete").unbind('click').bind('click', function () {
  389. if (window.confirm('确定删除?')) {
  390. var name = $(this).prev().html();
  391. removeModelClumn(name);
  392. $(this).parent().parent().remove();
  393. $("#map3DSettingInfoContent .model3DCategoryList").mCustomScrollbar('update');
  394. }
  395. })
  396. $("#mxCList li .editer").unbind('click').bind('click', function () {
  397. $(this).parent().parent().find('.li_control').hide();
  398. $(this).parent().parent().find('.li_control_Ch').show();
  399. });
  400. $("#mxCList li .cancel").unbind('click').bind('click', function () {
  401. $(this).parent().parent().find('.li_control').show();
  402. $(this).parent().parent().find('.li_control_Ch').hide();
  403. });
  404. $("#mxCList li .sure").unbind('click').bind('click', function () {
  405. //数据保存
  406. var data = {
  407. newName: $(this).prev().val(),
  408. oldName: $(this).parent().prev().prev().html(),
  409. };
  410. mxCListCaSure(data);
  411. $(this).parent().parent().find('.li_control').show();
  412. $(this).parent().parent().find('.li_control_Ch').hide();
  413. });
  414. $("#iGCList li .delete").unbind('click').bind('click', function () {
  415. if (window.confirm('确定删除?')) {
  416. var name = $(this).prev().html();
  417. removeIGClumn(name);
  418. $(this).parent().parent().remove();
  419. $("#IGoalsSettingInfoContent .iGItemCList").mCustomScrollbar('update');
  420. }
  421. })
  422. $("#iGCList li .editer").unbind('click').bind('click', function () {
  423. $(this).parent().parent().find('.li_control').hide();
  424. $(this).parent().parent().find('.li_control_Ch').show();
  425. });
  426. $("#iGCList li .cancel").unbind('click').bind('click', function () {
  427. $(this).parent().parent().find('.li_control').show();
  428. $(this).parent().parent().find('.li_control_Ch').hide();
  429. });
  430. $("#iGCList li .sure").unbind('click').bind('click', function () {
  431. //数据保存
  432. var data = {
  433. newName: $(this).prev().val(),
  434. oldName: $(this).parent().prev().prev().html(),
  435. };
  436. iGCListCaSure(data);
  437. $(this).parent().parent().find('.li_control').show();
  438. $(this).parent().parent().find('.li_control_Ch').hide();
  439. });
  440. $("#thematicList .listContent li").unbind('click').bind('click', function () {
  441. var cid = $(this).attr('cid');
  442. $("#map2DSettingInfoContent .thematicModelList").mCustomScrollbar("scrollTo", "#" + cid + "");
  443. })
  444. $("#model3DList .listContent li").unbind('click').bind('click', function () {
  445. var cid = $(this).attr('cid');
  446. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar("scrollTo", "#" + cid + "");
  447. })
  448. $("#iGNameList .listContent li").unbind('click').bind('click', function () {
  449. var cid = $(this).attr('cid');
  450. $("#IGoalsSettingInfoContent .iGItemList").mCustomScrollbar("scrollTo", "#" + cid + "");
  451. })
  452. $('#thematicList .add-newCa').unbind('click').bind('click', function () {
  453. addNewCa("thematic");
  454. })
  455. $('#model3DList .add-newCa').unbind('click').bind('click', function () {
  456. addNewCa("threeModel");
  457. })
  458. $('#iGNameList .add-newCa').unbind('click').bind('click', function () {
  459. addNewCa("IG");
  460. })
  461. }
  462. /**
  463. * 添加新的分类
  464. */
  465. function addNewCa(option) {
  466. var addNewCaHtml = $("<li><span>新分类</span>" +
  467. "<div class='li_control content'>" +
  468. "<a class='btn editer btn2 btn-small'>编辑</a>" +
  469. "<a class='btn delete btn2 btn-small'>删除</a>" +
  470. "</div>" +
  471. "<div class='li_control_Ch content'>" +
  472. "<input class='curCa'>" +
  473. "<a class='btn sure btn2 btn-small'>确定</a>" +
  474. "<a class='btn cancel btn2 btn-small'>取消</a>" +
  475. "</div>" +
  476. "</li>");
  477. if (option === "thematic") {
  478. var length = ONEMAP.D.globalSettingData.map2DThematicCategory.length;
  479. var content = "新分类" + length;
  480. addNewCaHtml.find('span').html(content);
  481. addNewCaHtml.appendTo($("#dxCList"));
  482. ONEMAP.D.globalSettingData.map2DThematicCategory.push(content);
  483. } else if (option === "threeModel") {
  484. var length = ONEMAP.D.globalSettingData.map3DModelSettingCategory.length;
  485. var content = "新分类" + length;
  486. addNewCaHtml.find('span').html(content);
  487. ONEMAP.D.globalSettingData.map3DModelSettingCategory.push(content);
  488. addNewCaHtml.appendTo($("#mxCList"));
  489. } else if (option === "IG") {
  490. var length = ONEMAP.D.globalSettingData.importantGoalsCategory.length;
  491. var content = "新分类" + length;
  492. addNewCaHtml.find('span').html(content);
  493. ONEMAP.D.globalSettingData.importantGoalsCategory.push(content);
  494. addNewCaHtml.appendTo($("#iGCList"));
  495. }
  496. bindEvent();
  497. }
  498. /**
  499. * 二维地图分类修改保存
  500. */
  501. function dxCListCaSure(data) {
  502. //console.log(data);
  503. var onemapSettingData = ONEMAP.D.globalSettingData.map2DThematicSetting;
  504. $.each(onemapSettingData, function (i, t) {
  505. if (t.category === data.oldName) {
  506. ONEMAP.D.globalSettingData.map2DThematicSetting[i].category = data.newName;
  507. }
  508. });
  509. $.each(ONEMAP.D.globalSettingData.map2DThematicCategory, function (i, t) {
  510. if (t === data.oldName) {
  511. ONEMAP.D.globalSettingData.map2DThematicCategory[i] = data.newName;
  512. }
  513. });
  514. reSetLayout();
  515. };
  516. /**
  517. * 三维地图分类修改保存
  518. */
  519. function mxCListCaSure(data) {
  520. //console.log(data);
  521. var onemapSettingData = ONEMAP.D.globalSettingData.map3DModelSetting;
  522. $.each(onemapSettingData, function (i, t) {
  523. if (t.category === data.oldName) {
  524. ONEMAP.D.globalSettingData.map3DModelSetting[i].category = data.newName;
  525. }
  526. });
  527. $.each(ONEMAP.D.globalSettingData.map3DModelSettingCategory, function (i, t) {
  528. if (t === data.oldName) {
  529. ONEMAP.D.globalSettingData.map3DModelSettingCategory[i] = data.newName;
  530. }
  531. });
  532. reSetLayout();
  533. };
  534. /**
  535. * 重要目标与事件分类修改保存
  536. */
  537. function iGCListCaSure(data) {
  538. //console.log(data);
  539. var onemapSettingData = ONEMAP.D.globalSettingData.importantGoalsSetting;
  540. $.each(onemapSettingData, function (i, t) {
  541. if (t.category === data.oldName) {
  542. ONEMAP.D.globalSettingData.importantGoalsSetting[i].category = data.newName;
  543. }
  544. });
  545. $.each(ONEMAP.D.globalSettingData.importantGoalsCategory, function (i, t) {
  546. if (t === data.oldName) {
  547. ONEMAP.D.globalSettingData.importantGoalsCategory[i] = data.newName;
  548. }
  549. });
  550. reSetLayout();
  551. };
  552. /**
  553. * 根据分类移除重要目标与事件
  554. */
  555. function removeIGClumn(options) {
  556. $('#iGList .item-form').each(function (index, item) {
  557. var clumnName = $(item).find('input[name="category"]').val();
  558. if (clumnName === options) {
  559. $(item).remove();
  560. var name = $(item).find('input[name="name"]').val();
  561. $("#iGNameList .listContent").find('li[tab="' + name + '"]').remove();
  562. }
  563. });
  564. $("#iGNameList ul").mCustomScrollbar("update");
  565. $("#IGoalsSettingInfoContent .iGItemList").mCustomScrollbar("update");
  566. }
  567. /**
  568. * 根据分类移除三维模型
  569. */
  570. function removeModelClumn(options) {
  571. $('#mxList .item-form').each(function (index, item) {
  572. var clumnName = $(item).find('input[name="category"]').val();
  573. if (clumnName === options) {
  574. $(item).remove();
  575. var name = $(item).find('input[name="name"]').val();
  576. $("#model3DList .listContent").find('li[tab="' + name + '"]').remove();
  577. }
  578. });
  579. $("#model3DList ul").mCustomScrollbar("update");
  580. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar("update");
  581. };
  582. /**
  583. * 根据分类移除专题图层
  584. */
  585. function removeThematicClumn(options) {
  586. $('#dxList .item-form').each(function (index, item) {
  587. var clumnName = $(item).find('input[name="category"]').val();
  588. if (clumnName === options) {
  589. $(item).remove();
  590. var name = $(item).find('input[name="name"]').val();
  591. $("#thematicList .listContent").find('li[tab="' + name + '"]').remove();
  592. }
  593. });
  594. $("#thematicList ul").mCustomScrollbar("update");
  595. $('#map2DSettingInfoContent .thematicModelList').mCustomScrollbar("update");
  596. };
  597. /**
  598. * 构建重要目标与事件列表
  599. * @type {Function}
  600. * @private
  601. */
  602. function buildIGList() {
  603. $('#IGoalsSettingInfoContent #iGList').empty();
  604. $("#iGNameList ul").empty();
  605. $.each(ONEMAP.D.globalSettingData.importantGoalsSetting, function (i, item) {
  606. var id = map23DControl.buildGuid();
  607. item.id = id;
  608. var iGListTemplate = Handlebars.compile($('#IG-item-template').html());
  609. $('#IGoalsSettingInfoContent #iGList').append(iGListTemplate(item));
  610. $("<li tab='" + item.name + "' cId='" + id + "'>" + item.name + "</li>").appendTo($("#iGNameList ul"));
  611. });
  612. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  613. for (var i = 0; i < ONEMAP.D.globalSettingData.importantGoalsCategory.length; i++) {
  614. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.importantGoalsCategory[i] + '</li>');
  615. $(liHtml).appendTo($(chooseHtml));
  616. }
  617. $("#iGList .category .chhoostListContent").remove();
  618. $(chooseHtml).appendTo($("#iGList .category").parent());
  619. //分类输入框选择
  620. $("#iGList .category").unbind('focus').bind('focus', function (e) {
  621. e.stopPropagation();
  622. $(this).next().show();
  623. $(this).parent().parent().parent().siblings().find('.chhoostListContent').hide();
  624. });
  625. $("#iGList .chhoostListContent li").unbind('click').bind('click', function () {
  626. $("#iGList .chhoostListContent").hide();
  627. $(this).parent().parent().find('input').val($(this).html());
  628. });
  629. }
  630. /**
  631. * 构建地形图数据列表
  632. * @type {Function}
  633. * @private
  634. */
  635. function buildDxForm() {
  636. $("#thematicList ul").empty();
  637. $('#map2DSettingInfoContent #dxList').empty();
  638. if (ONEMAP.D.globalSettingData.baseMap2D) {
  639. $('#mapLat').val(ONEMAP.D.globalSettingData.baseMap2D.center.lat);
  640. $('#mapLng').val(ONEMAP.D.globalSettingData.baseMap2D.center.lng);
  641. $('#mapZoom').val(ONEMAP.D.globalSettingData.baseMap2D.zoom);
  642. $('#mapType').val(ONEMAP.D.globalSettingData.baseMap2D.type);
  643. }
  644. $.each(ONEMAP.D.globalSettingData.map2DThematicSetting, function (i, item) {
  645. var id = map23DControl.buildGuid();
  646. item.id = id;
  647. if (item.type === "thematicOrigin") {
  648. var dxListTemplate = Handlebars.compile($('#dixing-item-templateTOrigin').html());
  649. $('#map2DSettingInfoContent #dxList').append(dxListTemplate(item));
  650. } else if (item.type === "vectorOrigin") {
  651. var dxListTemplate = Handlebars.compile($('#dixing-item-templateVOrigin').html());
  652. $('#map2DSettingInfoContent #dxList').append(dxListTemplate(item));
  653. } else if (item.type === "weatherMap") {
  654. var dxListTemplate = Handlebars.compile($('#dixing-item-templateWOrigin').html());
  655. $('#map2DSettingInfoContent #dxList').append(dxListTemplate(item));
  656. } else if (item.type === "otherOrigin") {
  657. var dxListTemplate = Handlebars.compile($('#dixing-item-templateOOrigin').html());
  658. $('#map2DSettingInfoContent #dxList').append(dxListTemplate(item));
  659. } else if (item.type === "shixuOrigin") {
  660. var dxListTemplate = Handlebars.compile($('#dixing-item-templateSOrigin').html());
  661. $('#map2DSettingInfoContent #dxList').append(dxListTemplate(item));
  662. }
  663. $("<li tab='" + item.name + "' cId='" + id + "'>" + item.name + "</li>").appendTo($("#thematicList ul"));
  664. });
  665. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  666. for (var i = 0; i < ONEMAP.D.globalSettingData.map2DThematicCategory.length; i++) {
  667. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.map2DThematicCategory[i] + '</li>');
  668. $(liHtml).appendTo($(chooseHtml));
  669. }
  670. $("#dxList .category .chhoostListContent").remove();
  671. $(chooseHtml).appendTo($("#dxList .category").parent());
  672. //分类输入框选择
  673. $("#dxList .category").unbind('focus').bind('focus', function (e) {
  674. $(this).next().show();
  675. $(this).parent().parent().parent().siblings().find('.chhoostListContent').hide();
  676. e.stopPropagation();
  677. });
  678. $("#dxList .chhoostListContent li").unbind('click').bind('click', function () {
  679. $("#dxList .chhoostListContent").hide();
  680. $(this).parent().parent().find('input').val($(this).html());
  681. });
  682. };
  683. /**
  684. * 添加一条新的地形图表单
  685. * @type {Function}
  686. * @private
  687. */
  688. function addNewDxForm(options) {
  689. if (options === "thematicOrigin") {
  690. $('#map2DSettingInfoContent #dxList').append($('#dixing-item-formTOrigin-template').html())
  691. } else if (options === "vectorOrigin") {
  692. $('#map2DSettingInfoContent #dxList').append($('#dixing-item-formVOrigin-template').html())
  693. } else if (options === "weatherMap") {
  694. $('#map2DSettingInfoContent #dxList').append($('#dixing-item-formWeather-template').html())
  695. } else if (options === "otherOrigin") {
  696. $('#map2DSettingInfoContent #dxList').append($('#dixing-item-formOOrigin-template').html())
  697. } else if (options === "shixuOrigin") {
  698. $('#map2DSettingInfoContent #dxList').append($('#dixing-item-formSOrigin-template').html())
  699. }
  700. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  701. for (var i = 0; i < ONEMAP.D.globalSettingData.map2DThematicCategory.length; i++) {
  702. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.map2DThematicCategory[i] + '</li>');
  703. $(liHtml).appendTo($(chooseHtml));
  704. }
  705. $("#dxList .category .chhoostListContent").remove();
  706. $(chooseHtml).appendTo($("#dxList .category").parent());
  707. //分类输入框选择
  708. $("#dxList .category").unbind('focus').bind('focus', function (e) {
  709. e.stopPropagation();
  710. $(this).next().show();
  711. $(this).parent().parent().parent().siblings().find('.chhoostListContent').hide();
  712. });
  713. $("#dxList .chhoostListContent li").unbind('click').bind('click', function () {
  714. $("#dxList .chhoostListContent").hide();
  715. $(this).parent().parent().find('input').val($(this).html());
  716. });
  717. $('#map2DSettingInfoContent .thematicModelList').mCustomScrollbar("update");
  718. $('#map2DSettingInfoContent .thematicModelList').mCustomScrollbar("scrollTo", "bottom");
  719. bindEvent();
  720. };
  721. /**
  722. * 构建模型数据列表
  723. * @type {Function}
  724. * @private
  725. */
  726. function buildMxForm() {
  727. // console.log("build");
  728. $('#mxList').empty();
  729. $("#model3DList ul").empty();
  730. if (ONEMAP.D.globalSettingData.baseMap3D) {
  731. //$('#base3DMapUrl').val(ONEMAP.D.globalSettingData.baseMap3D.map3DLayer);
  732. $('#base3DMapDEM').val(ONEMAP.D.globalSettingData.baseMap3D.map3DDEM);
  733. $('#base3DMapName').val(ONEMAP.D.globalSettingData.baseMap3D.map3DName);
  734. }
  735. $.each(ONEMAP.D.globalSettingData.map3DModelSetting, function (i, item) {
  736. var id = map23DControl.buildGuid();
  737. item.id = id;
  738. if (item.type === "mxData") {
  739. var mxListTemplate = Handlebars.compile($('#moxing-item-templatemx').html());
  740. $('#mxList').append(mxListTemplate(item));
  741. } else {
  742. var mxListTemplate = Handlebars.compile($('#moxing-item-templateqx').html());
  743. $('#mxList').append(mxListTemplate(item));
  744. }
  745. $("<li tab='" + item.name + "' cId='" + id + "'>" + item.name + "</li>").appendTo($("#model3DList ul"));
  746. })
  747. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  748. for (var i = 0; i < ONEMAP.D.globalSettingData.map3DModelSettingCategory.length; i++) {
  749. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.map3DModelSettingCategory[i] + '</li>');
  750. $(liHtml).appendTo($(chooseHtml));
  751. }
  752. $("#mxList .category .chhoostListContent").remove();
  753. $(chooseHtml).appendTo($("#mxList .category").parent());
  754. //分类输入框选择
  755. $("#mxList .category").unbind('focus').bind('focus', function (e) {
  756. e.stopPropagation();
  757. $(this).next().show();
  758. });
  759. $("#mxList .chhoostListContent li").unbind('click').bind('click', function () {
  760. $("#mxList .chhoostListContent").hide();
  761. $(this).parent().parent().find('input').val($(this).html());
  762. });
  763. };
  764. /**
  765. * 添加新的重要目标与事件菜单
  766. */
  767. function addNewIGForm() {
  768. $('#iGList').append($('#IG-item-form-template').html());
  769. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  770. for (var i = 0; i < ONEMAP.D.globalSettingData.importantGoalsCategory.length; i++) {
  771. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.importantGoalsCategory[i] + '</li>');
  772. $(liHtml).appendTo($(chooseHtml));
  773. }
  774. $("#iGList .category .chhoostListContent").remove();
  775. $(chooseHtml).appendTo($("#iGList .category").parent());
  776. //分类输入框选择
  777. $("#iGList .category").unbind('focus').bind('focus', function (e) {
  778. e.stopPropagation();
  779. $(this).next().show();
  780. });
  781. $("#iGList .chhoostListContent li").unbind('click').bind('click', function () {
  782. $("#iGList .chhoostListContent").hide();
  783. $(this).parent().parent().find('input').val($(this).html());
  784. });
  785. $("#IGoalsSettingInfoContent .iGItemList").mCustomScrollbar("update");
  786. $("#IGoalsSettingInfoContent .iGItemList").mCustomScrollbar("scrollTo", "bottom");
  787. bindEvent();
  788. };
  789. /**
  790. * 添加一条新的模型表单
  791. * @type {Function}
  792. * @private
  793. */
  794. function seTdModel() {
  795. var tdSet = {},
  796. tdSetQ = {};
  797. $("#tdtsList ul").html("");
  798. $.ajax({
  799. url: onemapUrlConfig.tdModelUrl,
  800. type: 'GET',
  801. dataType: 'json'
  802. })
  803. .done(function (data) {
  804. console.log(data)
  805. if (onemapUrlConfig.threeDimensionalDataUrl.indexOf("v1.0") > -1) {
  806. tdSet = data;
  807. } else {
  808. tdSet = data.data;
  809. }
  810. for (var i = 0; i < tdSet.length; i++) {
  811. var tdata = JSON.stringify(tdSet[i]).replace(/\"/g, "\'");
  812. var pli = $('<li dt="' + tdata + '" type="1"><span class="check"></span><span class="name">' + tdSet[i].layer_name + '</span></li>');
  813. $("#tdtsList .p1 ul").prepend(pli);
  814. }
  815. $("#tdtsList li .check").off("click").on("click", function () {
  816. if ($(this).parent().hasClass('checked')) {
  817. $(this).parent().removeClass('checked')
  818. $(this).removeClass('bg')
  819. } else {
  820. $(this).parent().addClass('checked');
  821. $(this).addClass('bg');
  822. }
  823. })
  824. })
  825. $.ajax({
  826. url: onemapUrlConfig.tdQxsyUrl,
  827. type: 'GET',
  828. dataType: 'json'
  829. })
  830. .done(function (data) {
  831. console.log(data)
  832. if (onemapUrlConfig.threeDimensionalDataUrl.indexOf("v1.0") > -1) {
  833. tdSetQ = data;
  834. } else {
  835. tdSetQ = data.data;
  836. }
  837. for (var i = 0; i < tdSetQ.length; i++) {
  838. var tdata = JSON.stringify(tdSetQ[i]).replace(/\"/g, "\'");
  839. var pli = $('<li dt="' + tdata + '" type="2"><span class="check"></span><span class="name">' + tdSetQ[i].layer_name + '</span></li>');
  840. $("#tdtsList .p2 ul").prepend(pli);
  841. }
  842. $("#tdtsList li .check").off("click").on("click", function () {
  843. if ($(this).parent().hasClass('checked')) {
  844. $(this).parent().removeClass('checked')
  845. $(this).removeClass('bg')
  846. } else {
  847. $(this).parent().addClass('checked');
  848. $(this).addClass('bg');
  849. }
  850. })
  851. })
  852. // $("#tdTheSelect").addClass('active');
  853. $(".bacover").show();
  854. // $("#tdTheSelect .submit").off("click").on("click",function(){
  855. // var value = $("#tdMChoose").val();
  856. // if(value == 1){
  857. // $('#mxList').append($('#moxing-item-form-template').html());
  858. // addNewMxForm()
  859. // } else if(value == 2){
  860. $("#tdtsList").addClass('active')
  861. $("#tdtsList ul").mCustomScrollbar({
  862. scrollInertia: 100
  863. });
  864. // }
  865. // $("#tdTheSelect").removeClass('active');
  866. // })
  867. // $("#tdTheSelect .cancel").off("click").on("click",function(){
  868. // $("#tdTheSelect").removeClass('active');
  869. // $(".bacover").hide();
  870. // })
  871. $("#tdtsList .cancel").off("click").on("click", function () {
  872. $("#tdtsList").removeClass('active');
  873. $(".bacover").hide();
  874. })
  875. $("#tdtsList .submit").off("click").on("click", function () {
  876. var lis = $("#tdtsList li.checked");
  877. for (var i = 0; i < lis.length; i++) {
  878. var dt = lis.eq(i).attr("dt").replace(/\'/g, "\"");
  879. var ldata = JSON.parse(dt);
  880. var type = lis.eq(i).attr("type");
  881. var category, st;
  882. if (type == 1) {
  883. category = "三维模型", st = 0;
  884. if (onemapUrlConfig.threeDimensionalDataUrl.indexOf("v1.0") > -1) {
  885. $("#tdyuanModel .item-form .modelUrl").attr("value", onemapUrlConfig.threeDimensionalDataUrl + '/geo_model/' + ldata.guid + '.gfp');
  886. } else {
  887. $("#tdyuanModel .item-form .modelUrl").attr("value", onemapUrlConfig.threeDimensionalDataUrl + '/geo_model/' + ldata.guid + '/subfile/' + ldata.guid + '.json');
  888. }
  889. } else if (type == 2) {
  890. category = "倾斜摄影", st = 1;
  891. if (onemapUrlConfig.threeDimensionalDataUrl.indexOf("v1.0") > -1) {
  892. $("#tdyuanModel .item-form .modelUrl").attr("value", onemapUrlConfig.threeDimensionalDataUrl + '/oblique/global/' + ldata.guid + '.gft');
  893. } else {
  894. $("#tdyuanModel .item-form .modelUrl").attr("value", onemapUrlConfig.threeDimensionalDataUrl + '/oblique/' + ldata.guid + '/subfile/' + ldata.guid + '.json');
  895. }
  896. }
  897. $("#tdyuanModel .item-form .name").attr("value", ldata.layer_name);
  898. $("#tdyuanModel .item-form .center-lat").attr("value", ldata.center[1]);
  899. $("#tdyuanModel .item-form .center-lng").attr("value", ldata.center[0]);
  900. $("#tdyuanModel .item-form .guid").attr("value", ldata.guid);
  901. $("#tdyuanModel .item-form .category").attr("value", category);
  902. $("#tdyuanModel .item-form .zoom").attr("value", 1000);
  903. $("#tdyuanModel .item-form select option").eq(st).attr("selected", true)
  904. $('#mxList').append($('#tdyuanModel').html());
  905. }
  906. $("#tdtsList").removeClass('active');
  907. $(".bacover").hide();
  908. bindEvent()
  909. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar("update");
  910. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar("scrollTo", "bottom");
  911. })
  912. $("#tdtsList .title span").off("click").on("click", function () {
  913. if ($(this).hasClass('he')) {
  914. $(this).removeClass('he')
  915. $(this).parents().filter(".mtype").find("ul").removeClass('he')
  916. } else {
  917. $(this).addClass('he')
  918. $(this).parents().filter(".mtype").find("ul").addClass('he')
  919. }
  920. })
  921. }
  922. function addNewMxForm() {
  923. $('#mxList').append($('#moxing-item-form-template').html());
  924. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  925. for (var i = 0; i < ONEMAP.D.globalSettingData.map3DModelSettingCategory.length; i++) {
  926. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.map3DModelSettingCategory[i] + '</li>');
  927. $(liHtml).appendTo($(chooseHtml));
  928. }
  929. $("#mxList .category .chhoostListContent").remove();
  930. $(chooseHtml).appendTo($("#mxList .category").parent());
  931. //分类输入框选择
  932. $("#mxList .category").unbind('focus').bind('focus', function (e) {
  933. e.stopPropagation();
  934. $(this).next().show();
  935. });
  936. $("#mxList .chhoostListContent li").unbind('click').bind('click', function () {
  937. $("#mxList .chhoostListContent").hide();
  938. $(this).parent().parent().find('input').val($(this).html());
  939. });
  940. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar("update");
  941. $("#map3DSettingInfoContent .model3DModelList").mCustomScrollbar("scrollTo", "bottom");
  942. bindEvent();
  943. };
  944. /**
  945. * 构建重要目标与事件分类数据
  946. */
  947. function buildIGCa() {
  948. $("#iGCList").empty();
  949. if (ONEMAP.D.globalSettingData.importantGoalsCategory) {
  950. var data = ONEMAP.D.globalSettingData.importantGoalsCategory;
  951. for (var i = 0; i < data.length; i++) {
  952. $("<li><span>" + data[i] + "</span>" +
  953. "<div class='li_control content'>" +
  954. "<a class='btn editer btn2 btn-small'>编辑</a>" +
  955. "<a class='btn delete btn2 btn-small'>删除</a>" +
  956. "</div>" +
  957. "<div class='li_control_Ch content'>" +
  958. "<input class='curCa'>" +
  959. "<a class='btn sure btn2 btn-small'>确定</a>" +
  960. "<a class='btn cancel btn2 btn-small'>取消</a>" +
  961. "</div>" +
  962. "</li>").appendTo($("#iGCList"))
  963. }
  964. }
  965. }
  966. /**
  967. * 构建专题图分类数据
  968. */
  969. function buildThemativC() {
  970. $("#dxCList").empty();
  971. if (ONEMAP.D.globalSettingData.map2DThematicCategory) {
  972. var data = ONEMAP.D.globalSettingData.map2DThematicCategory;
  973. for (var i = 0; i < data.length; i++) {
  974. $("<li><span>" + data[i] + "</span>" +
  975. "<div class='li_control content'>" +
  976. "<a class='btn editer btn2 btn-small'>编辑</a>" +
  977. "<a class='btn delete btn2 btn-small'>删除</a>" +
  978. "</div>" +
  979. "<div class='li_control_Ch content'>" +
  980. "<input class='curCa'>" +
  981. "<a class='btn sure btn2 btn-small'>确定</a>" +
  982. "<a class='btn cancel btn2 btn-small'>取消</a>" +
  983. "</div>" +
  984. "</li>").appendTo($("#dxCList"))
  985. }
  986. }
  987. }
  988. /**
  989. * 构建三维模型分类数据
  990. */
  991. function buildModelC() {
  992. $("#mxCList").empty();
  993. if (ONEMAP.D.globalSettingData.map3DModelSettingCategory) {
  994. var data = ONEMAP.D.globalSettingData.map3DModelSettingCategory;
  995. for (var i = 0; i < data.length; i++) {
  996. $("<li><span>" + data[i] + "</span>" +
  997. "<div class='li_control content'>" +
  998. "<a class='btn editer btn2 btn-small'>编辑</a>" +
  999. "<a class='btn delete btn2 btn-small'>删除</a>" +
  1000. "</div>" +
  1001. "<div class='li_control_Ch content'>" +
  1002. "<input class='curCa'>" +
  1003. "<a class='btn sure btn2 btn-small'>确定</a>" +
  1004. "<a class='btn cancel btn2 btn-small'>取消</a>" +
  1005. "</div>" +
  1006. "</li>").appendTo($("#mxCList"))
  1007. }
  1008. }
  1009. }
  1010. /**
  1011. * 外部添加重点方向与目标
  1012. */
  1013. function linkAddIG(options) {
  1014. if (!modValue.initialized) {
  1015. init();
  1016. };
  1017. var contentId = "IGoalsSetting";
  1018. $(".left_header").find('li[tab="IGoalsSetting"]').addClass('active');
  1019. $(".left_header").find('li[tab="IGoalsSetting"]').siblings().removeClass('active');
  1020. $("#" + contentId).show();
  1021. $("#" + contentId).siblings().hide();
  1022. $("#" + contentId + "InfoContent").show();
  1023. $("#" + contentId + "InfoContent").siblings().hide();
  1024. var iGListTemplate = Handlebars.compile($('#IG-item-template').html());
  1025. // $('#IGoalsSettingInfoContent #iGList').append(iGListTemplate(options));
  1026. var chooseHtml = $('<ul class="chhoostListContent"></ul>');
  1027. for (var i = 0; i < ONEMAP.D.globalSettingData.importantGoalsCategory.length; i++) {
  1028. var liHtml = $('<li>' + ONEMAP.D.globalSettingData.importantGoalsCategory[i] + '</li>');
  1029. $(liHtml).appendTo($(chooseHtml));
  1030. }
  1031. $("#iGList .category .chhoostListContent").remove();
  1032. $(chooseHtml).appendTo($("#iGList .category").parent());
  1033. //分类输入框选择
  1034. $("#iGList .category").unbind('focus').bind('focus', function (e) {
  1035. e.stopPropagation();
  1036. $(this).next().show();
  1037. });
  1038. $("#iGList .chhoostListContent li").unbind('click').bind('click', function () {
  1039. $("#iGList .chhoostListContent").hide();
  1040. $(this).parent().parent().find('input').val($(this).html());
  1041. });
  1042. };
  1043. /**
  1044. * 获取地形图表单数据
  1045. * @type {Function}
  1046. * @returns {Array} 地形图数据数组
  1047. * @private
  1048. */
  1049. function getDxFormData() {
  1050. var map2DThematicSetting = [];
  1051. if ($('#dxList .item-form').length > 0) {
  1052. $('#dxList .item-form').each(function (index, item) {
  1053. var tempObj = {};
  1054. var guid = "";
  1055. var productUrl = "";
  1056. var category = $(item).find('input[name="category"]').val();
  1057. var type = $(item).find('input[name="type"]').val();
  1058. var legend = $(item).find('input[name="legend"]').val();
  1059. var info = $(item).find('input[name="info"]').val();
  1060. var name = $(item).find('input[name="name"]').val();
  1061. var zoom = $(item).find('input[name="zoom"]').val();
  1062. var centerLat = $(item).find('input[name="center-lat"]').val();
  1063. var centerLng = $(item).find('input[name="center-lng"]').val();
  1064. var tileLayerUrl = $(item).find('input[name="tileLayerUrl"]').val();
  1065. if (type === "专题图图源") {
  1066. type = "thematicOrigin";
  1067. } else if (type === "矢量图源") {
  1068. type = "vectorOrigin";
  1069. } else if (type === "第三方图源") {
  1070. type = "otherOrigin";
  1071. } else if (type === "气象云图") {
  1072. type = "weatherMap";
  1073. } else if (type === "时序图层图源") {
  1074. type = "shixuOrigin";
  1075. category = "时序图层";
  1076. }
  1077. if (type == "shixuOrigin") {
  1078. var intervalTime = $(item).find('input[name="intervalTime"]').val();
  1079. var time = $(item).find('input[name="time"]').val();
  1080. var inputs = $(item).find("input");
  1081. for (var i = 0; i < inputs.length; i++) {
  1082. if (inputs[i].value.length < 1) {
  1083. alert("时序图层的所有项不得为空");
  1084. }
  1085. }
  1086. if (name.length > 16 || name.length < 1) {
  1087. alert('名称为 ' + name + ' 的文字长度为1-16个字符');
  1088. status.canPost = false;
  1089. return false;
  1090. }
  1091. if (time.length = 0) {
  1092. alert('时间不能为空');
  1093. status.canPost = false;
  1094. return false;
  1095. }
  1096. if (tileLayerUrl.length = 0) {
  1097. alert('url地址不能为空');
  1098. status.canPost = false;
  1099. return false;
  1100. }
  1101. if (centerLat < -90 || centerLat > 90 || centerLng < -180 || centerLng > 180) {
  1102. alert('名称为 ' + name + ' 的中心点超出经纬度范围');
  1103. status.canPost = false;
  1104. return false;
  1105. }
  1106. tempObj.type = type;
  1107. tempObj.info = info;
  1108. tempObj.name = name;
  1109. tempObj.category = category;
  1110. tempObj.intervalTime = intervalTime;
  1111. tempObj.zoom = parseInt(zoom);
  1112. tempObj.center = {
  1113. lat: parseFloat(centerLat),
  1114. lng: parseFloat(centerLng)
  1115. };
  1116. tempObj.zixiang = [];
  1117. var zixiang = $(item).find(".zixiang");
  1118. for (var i = 0; i < zixiang.length; i++) {
  1119. var zx = {};
  1120. zx.sxTime = zixiang.eq(i).find('input[name="time"]').val();
  1121. zx.sxUrl = zixiang.eq(i).find('input[name="tileLayerUrl"]').val();
  1122. tempObj.zixiang.push(zx);
  1123. }
  1124. map2DThematicSetting.push(tempObj);
  1125. status.canPost = true;
  1126. } else if (category.length > 0 && type.length > 0 && name.length > 0 && zoom.length > 0 && centerLat.length > 0 && centerLng.length > 0 && tileLayerUrl.length > 0) {
  1127. if (name.length > 16) {
  1128. alert('名称为 ' + name + ' 的文字长度不能超过16个字符');
  1129. status.canPost = false;
  1130. return false;
  1131. }
  1132. if (centerLat < -90 || centerLat > 90 || centerLng < -180 || centerLng > 180) {
  1133. alert('名称为 ' + name + ' 的中心点超出经纬度范围');
  1134. status.canPost = false;
  1135. return false;
  1136. }
  1137. if (type === "thematicOrigin") {
  1138. guid = $(item).find('input[name="guid"]').val();
  1139. if (guid.length = 0) {
  1140. alert('名称为 ' + name + '的guid不能为空');
  1141. status.canPost = false;
  1142. return false;
  1143. }
  1144. }
  1145. if (type === "weatherMap") {
  1146. productUrl = $(item).find('input[name="productUrl"]').val();
  1147. guid = $(item).find('input[name="guid"]').val();
  1148. if (productUrl.length = 0) {
  1149. alert('名称为 ' + name + '的产品服务地址不能为空');
  1150. status.canPost = false;
  1151. return false;
  1152. }
  1153. if (guid.length = 0) {
  1154. alert('名称为 ' + name + '的guid不能为空');
  1155. status.canPost = false;
  1156. return false;
  1157. }
  1158. }
  1159. tempObj.category = category;
  1160. tempObj.type = type;
  1161. tempObj.legend = legend;
  1162. tempObj.info = info;
  1163. tempObj.name = name;
  1164. if (guid.length > 0) {
  1165. tempObj.guid = guid;
  1166. }
  1167. if (productUrl.length > 0) {
  1168. tempObj.productUrl = productUrl;
  1169. }
  1170. tempObj.zoom = parseInt(zoom);
  1171. tempObj.center = {
  1172. lat: parseFloat(centerLat),
  1173. lng: parseFloat(centerLng)
  1174. };
  1175. tempObj.url = tileLayerUrl;
  1176. map2DThematicSetting.push(tempObj);
  1177. status.canPost = true;
  1178. } else {
  1179. alert('名称为 ' + name + ' 的所有选项都是必填选项!请填写完整');
  1180. status.canPost = false;
  1181. return false;
  1182. }
  1183. });
  1184. } else {
  1185. status.canPost = true;
  1186. }
  1187. return map2DThematicSetting;
  1188. };
  1189. /**
  1190. * 获取模型表单数据
  1191. * @type {Function}
  1192. * @returns {Array} 模型数据数组
  1193. * @private
  1194. */
  1195. function getMxFormData() {
  1196. var map3DModelSetting = [];
  1197. if ($('#mxList .item-form').length > 0) {
  1198. $('#mxList .item-form').each(function (index, item) {
  1199. var tempObj = {};
  1200. var category = $(item).find('input[name="category"]').val();
  1201. var type = $(item).find('select[name="type"]').val();
  1202. var name = $(item).find('input[name="name"]').val();
  1203. var info = $(item).find('input[name="info"]').val();
  1204. // var height = $(item).find('input[name="height"]').val();
  1205. var centerLat = $(item).find('input[name="center-lat"]').val();
  1206. var centerLng = $(item).find('input[name="center-lng"]').val();
  1207. var modelUrl = $(item).find('input[name="modelUrl"]').val();
  1208. if (type.length > 0 && category.length > 0 && name.length > 0 && centerLat.length > 0 && centerLng.length > 0 && modelUrl.length > 0) { //&& height.length > 0
  1209. if (name.length > 16) {
  1210. alert('名称为 ' + name + ' 的文字长度不能超过16个字符');
  1211. status.canPost = false;
  1212. return false;
  1213. }
  1214. if (centerLat < -90 || centerLat > 90 || centerLng < -180 || centerLng > 180) {
  1215. alert('名称为 ' + name + ' 的中心点超出经纬度范围');
  1216. status.canPost = false;
  1217. return false;
  1218. }
  1219. if(type == "mxData"){
  1220. tempObj.m_height = $(item).find('input[name="m_height"]').val();
  1221. tempObj.m_scale = $(item).find('input[name="m_scale"]').val();
  1222. tempObj.m_hdeading = $(item).find('input[name="m_hdeading"]').val();
  1223. tempObj.m_pitch = $(item).find('input[name="m_pitch"]').val();
  1224. tempObj.m_roll = $(item).find('input[name="m_roll"]').val();
  1225. }
  1226. tempObj.category = category;
  1227. tempObj.info = info;
  1228. tempObj.type = type;
  1229. tempObj.name = name;
  1230. // tempObj.zoom = parseInt(height);
  1231. tempObj.center = {
  1232. lat: parseFloat(centerLat),
  1233. lng: parseFloat(centerLng)
  1234. };
  1235. tempObj.url = modelUrl;
  1236. map3DModelSetting.push(tempObj);
  1237. status.canPost = true;
  1238. } else {
  1239. alert('名称为 ' + name + ' 的所有选项都是必填选项!请填写完整');
  1240. status.canPost = false;
  1241. return false;
  1242. }
  1243. });
  1244. } else {
  1245. status.canPost = true;
  1246. }
  1247. return map3DModelSetting;
  1248. };
  1249. /**
  1250. * 获取二维地图设置数据
  1251. */
  1252. function getMap2DFromData() {
  1253. var baseMap2D = {};
  1254. var mapLat = ($('#map2DForm').find('input[name="mapLat"]').val()).replace(/\ /g, "");
  1255. var mapLng = ($('#map2DForm').find('input[name="mapLng"]')).val().replace(/\ /g, "");
  1256. var mapZoom = parseInt($('#mapZoom').val());
  1257. var mapType = $('#mapType').val();
  1258. if (mapLat.length > 0 && mapLng.length > 0) {
  1259. if (mapLat < -90 && mapLat > 90 && mapLng < -180 && mapLng > 180) {
  1260. alert('地图默认中心点超出经纬度范围');
  1261. status.canPost = false;
  1262. return false;
  1263. }
  1264. baseMap2D.center = {
  1265. lat: parseFloat(mapLat),
  1266. lng: parseFloat(mapLng)
  1267. };
  1268. baseMap2D.type = parseInt(mapType);
  1269. baseMap2D.zoom = parseInt(mapZoom);
  1270. status.canPost = true;
  1271. } else {
  1272. alert('二维地图设置所有选项都是必填选项!请填写完整');
  1273. status.canPost = false;
  1274. return false;
  1275. }
  1276. return baseMap2D;
  1277. }
  1278. /**
  1279. * 获取三维地图设置
  1280. */
  1281. function getMap3DFromData() {
  1282. var baseMap3D = {};
  1283. //var baseMap3D_Layer = $('#map3DForm').find('input[name="base3DMapUrl"]').val();
  1284. var baseMap3D_DEM = $('#map3DForm').find('input[name="base3DMapDEM"]').val();
  1285. var baseMap3D_Name = $('#map3DForm').find('input[name="base3DMapName"]').val();
  1286. if (baseMap3D_DEM.length > 0 && baseMap3D_Name.length > 0) {
  1287. //baseMap3D.map3DLayer = baseMap3D_Layer;
  1288. baseMap3D.map3DDEM = baseMap3D_DEM;
  1289. baseMap3D.map3DName = baseMap3D_Name;
  1290. status.canPost = true;
  1291. } else {
  1292. alert('三维地图设置所有选项都是必填选项!请填写完整');
  1293. status.canPost = false;
  1294. return false;
  1295. }
  1296. return baseMap3D;
  1297. };
  1298. /**
  1299. * 获取专题地图数据栏目
  1300. */
  1301. function getThematicCategory() {
  1302. var map2DThematicCategory = [];
  1303. if ($('#dxList .item-form').length > 0) {
  1304. $('#dxList .item-form').each(function (index, item) {
  1305. var isAddToArray = false;
  1306. var category = $(item).find('input[name="category"]').val();
  1307. var type = $(item).find('input[name="type"]').val();
  1308. if (type == "时序图层图源") {
  1309. category = "时序图层"
  1310. }
  1311. for (var i = 0; i < map2DThematicCategory.length; i++) {
  1312. if (map2DThematicCategory[i] === category) {
  1313. isAddToArray = true;
  1314. }
  1315. }
  1316. if (!isAddToArray) {
  1317. map2DThematicCategory.push(category);
  1318. }
  1319. })
  1320. }
  1321. $("#dxCList li").each(function (index, item) {
  1322. var isAddToArray = false;
  1323. var category = $(item).find('span').html();
  1324. for (var i = 0; i < map2DThematicCategory.length; i++) {
  1325. if (map2DThematicCategory[i] === category) {
  1326. isAddToArray = true;
  1327. }
  1328. }
  1329. if (!isAddToArray) {
  1330. map2DThematicCategory.push(category);
  1331. }
  1332. })
  1333. return map2DThematicCategory;
  1334. };
  1335. /**
  1336. * 获取三维模型分类
  1337. */
  1338. function getModel3DCategory() {
  1339. var map3DModelSettingCategory = [];
  1340. if ($('#mxList .item-form').length > 0) {
  1341. $('#mxList .item-form').each(function (index, item) {
  1342. var category = $(item).find('input[name="category"]').val();
  1343. var isAddToArray = false;
  1344. for (var i = 0; i < map3DModelSettingCategory.length; i++) {
  1345. if (map3DModelSettingCategory[i] === category) {
  1346. isAddToArray = true;
  1347. }
  1348. }
  1349. if (!isAddToArray) {
  1350. map3DModelSettingCategory.push(category);
  1351. }
  1352. })
  1353. }
  1354. $("#mxCList li").each(function (index, item) {
  1355. var isAddToArray = false;
  1356. var category = $(item).find('span').html();
  1357. for (var i = 0; i < map3DModelSettingCategory.length; i++) {
  1358. if (map3DModelSettingCategory[i] === category) {
  1359. isAddToArray = true;
  1360. }
  1361. }
  1362. if (!isAddToArray) {
  1363. map3DModelSettingCategory.push(category);
  1364. }
  1365. })
  1366. return map3DModelSettingCategory;
  1367. }
  1368. /**
  1369. * 获取重点目标分类
  1370. */
  1371. function getImportantGC() {
  1372. var importantGoalsCategory = [];
  1373. if ($('#iGList .item-form').length > 0) {
  1374. $('#iGList .item-form').each(function (index, item) {
  1375. var isAddToArray = false;
  1376. var category = $(item).find('input[name="category"]').val();
  1377. for (var i = 0; i < importantGoalsCategory.length; i++) {
  1378. if (importantGoalsCategory[i] === category) {
  1379. isAddToArray = true;
  1380. }
  1381. }
  1382. if (!isAddToArray) {
  1383. importantGoalsCategory.push(category);
  1384. }
  1385. })
  1386. }
  1387. $("#iGCList li").each(function (index, item) {
  1388. var isAddToArray = false;
  1389. var category = $(item).find('span').html();
  1390. for (var i = 0; i < importantGoalsCategory.length; i++) {
  1391. if (importantGoalsCategory[i] === category) {
  1392. isAddToArray = true;
  1393. }
  1394. }
  1395. if (!isAddToArray) {
  1396. importantGoalsCategory.push(category);
  1397. }
  1398. })
  1399. return importantGoalsCategory;
  1400. }
  1401. function getImportantData() {
  1402. var importantGoalsSetting = [];
  1403. if ($('#iGList .item-form').length > 0) {
  1404. $('#iGList .item-form').each(function (index, item) {
  1405. var tempObj = {};
  1406. var category = $(item).find('input[name="category"]').val();
  1407. var columnName = $(item).find('input[name="columnName"]').val();
  1408. var name = $(item).find('input[name="name"]').val();
  1409. if (category.length > 0 && name.length > 0 && columnName.length > 0) {
  1410. if (name.length > 16) {
  1411. alert('名称为 ' + name + ' 的文字长度不能超过16个字符');
  1412. status.canPost = false;
  1413. return false;
  1414. }
  1415. tempObj.category = category;
  1416. tempObj.name = name;
  1417. tempObj.columnName = columnName;
  1418. importantGoalsSetting.push(tempObj);
  1419. status.canPost = true;
  1420. } else {
  1421. alert('名称为 ' + name + ' 的所有选项都是必填选项!请填写完整');
  1422. status.canPost = false;
  1423. return false;
  1424. }
  1425. });
  1426. } else {
  1427. status.canPost = true;
  1428. }
  1429. return importantGoalsSetting;
  1430. };
  1431. function getKuozhanData() {
  1432. var kuozhanData = [];
  1433. if ($("#kzList li").length > 0) {
  1434. $("#kzList li").each(function (index, item) {
  1435. var tempObj = {};
  1436. var title = $(item).find('input[name="title"]').val();
  1437. var link = $(item).find('input.linkAddr').val();
  1438. if (title.length > 0 && link.length > 0) {
  1439. if (title.length > 16) {
  1440. alert('名称为 ' + title + ' 的文字长度不能超过16个字符');
  1441. status.canPost = false;
  1442. return false;
  1443. }
  1444. tempObj.title = title;
  1445. tempObj.link = link;
  1446. kuozhanData.push(tempObj);
  1447. status.canPost = true;
  1448. } else {
  1449. alert('名称为 ' + title + ' 的所有选项都是必填选项!请填写完整');
  1450. status.canPost = false;
  1451. return false;
  1452. }
  1453. })
  1454. } else {
  1455. status.canPost = true;
  1456. }
  1457. console.log(kuozhanData);
  1458. return kuozhanData;
  1459. }
  1460. /**
  1461. * 获取地图模式设置单数据
  1462. * @type {Function}
  1463. * @returns {Array}
  1464. * @private
  1465. */
  1466. function getMapFormData() {
  1467. var mapData = {};
  1468. var mapLat = ($('#map2DForm').find('input[name="mapLat"]').val()).replace(/\ /g, "");
  1469. var mapLng = ($('#map2DForm').find('input[name="mapLng"]')).val().replace(/\ /g, "");
  1470. var mapZoom = parseInt($('#mapZoom').val());
  1471. var mapType = $('#mapType').val();
  1472. if (mapLat.length > 0 && mapLng.length > 0) {
  1473. if (mapLat < -90 || mapLat > 90 || mapLng < -180 || mapLng > 180) {
  1474. alert('地图默认中心点超出经纬度范围');
  1475. status.canPost = false;
  1476. return false;
  1477. }
  1478. mapData.center = {
  1479. lat: parseFloat(mapLat),
  1480. lng: parseFloat(mapLng)
  1481. };
  1482. mapData.type = parseInt(mapType);
  1483. mapData.zoom = parseInt(mapZoom);
  1484. status.canPost = true;
  1485. } else {
  1486. alert('地图模式设置所有选项都是必填选项!请填写完整');
  1487. status.canPost = false;
  1488. return false;
  1489. }
  1490. return mapData;
  1491. };
  1492. /**
  1493. * 保存设置 保存成功则刷新页面
  1494. * @type {Function}
  1495. * @returns {boolean}
  1496. * @private
  1497. */
  1498. function saveSetting() {
  1499. var ajaxData = {};
  1500. /*var mapData = getMapFormData();
  1501. ajaxData.mapSetting = mapData;
  1502. var dxData = getDxFormData();
  1503. ajaxData.dixing = dxData;
  1504. var mxData = getMxFormData();
  1505. ajaxData.moxing = mxData;*/
  1506. var baseMap2DData = getMap2DFromData();
  1507. if (!baseMap2DData) {
  1508. return false
  1509. }
  1510. ajaxData.baseMap2D = baseMap2DData;
  1511. var map2DThematicData = getDxFormData();
  1512. if (!map2DThematicData) {
  1513. return false
  1514. }
  1515. ajaxData.map2DThematicSetting = map2DThematicData;
  1516. var map2DThematicCData = getThematicCategory();
  1517. if (!map2DThematicCData) {
  1518. return false
  1519. }
  1520. ajaxData.map2DThematicCategory = map2DThematicCData;
  1521. var baseMap3DData = getMap3DFromData();
  1522. if (!baseMap3DData) {
  1523. return false
  1524. }
  1525. ajaxData.baseMap3D = baseMap3DData;
  1526. var map3DModelSCData = getModel3DCategory();
  1527. if (!map3DModelSCData) {
  1528. return false
  1529. }
  1530. ajaxData.map3DModelSettingCategory = map3DModelSCData;
  1531. var map3DModelSettingData = getMxFormData();
  1532. if (!map3DModelSettingData) {
  1533. return false
  1534. }
  1535. ajaxData.map3DModelSetting = map3DModelSettingData;
  1536. var iGoalsCategorData = getImportantGC();
  1537. if (!iGoalsCategorData) {
  1538. return false
  1539. }
  1540. ajaxData.importantGoalsCategory = iGoalsCategorData;
  1541. var iGoalsSettingData = getImportantData();
  1542. if (!iGoalsSettingData) {
  1543. return false
  1544. }
  1545. ajaxData.importantGoalsSetting = iGoalsSettingData;
  1546. var kuozhanData = getKuozhanData();
  1547. if (!kuozhanData) {
  1548. return false
  1549. }
  1550. ajaxData.kuozhanLink = kuozhanData;
  1551. if (status.canPost) {
  1552. $.ajax({
  1553. type: "post",
  1554. dataType: 'json',
  1555. url: onemapUrlConfig.gcmsServiceUrl + '/storage',
  1556. data: {
  1557. mapSetting: JSON.stringify(ajaxData)
  1558. },
  1559. beforeSend: ONEMAP.V.loading.load(),
  1560. success: function (data) {
  1561. console.log(data);
  1562. if (window.confirm('保存成功,是否刷新页面应用设置?')) {
  1563. location.reload(true);
  1564. }
  1565. },
  1566. error: function (data) {
  1567. alert('保存失败,请重试!');
  1568. },
  1569. completer: ONEMAP.V.loading.loaded()
  1570. });
  1571. }
  1572. };
  1573. function sanWeiList() {
  1574. setLayout();
  1575. // console.log($("#model3DList ul .mCSB_container").html());
  1576. }
  1577. return ONEMAP.M.setting = {
  1578. init: init,
  1579. linkAddIG: linkAddIG,
  1580. sanWeiList: sanWeiList,
  1581. addNewDxForm: addNewDxForm,
  1582. bindEvent: bindEvent,
  1583. buildDxForm: buildDxForm
  1584. };
  1585. });