Test2.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="Access-Control-Allow-Origin" content="*">
  6. <title>城管通Map Test</title>
  7. <script src="jquery/jquery-2.2.3.min.js"></script>
  8. <script src="Common/mapClass/GisShare.js"></script>
  9. <script type="text/javascript" src="jquery/xml2json.js"></script>
  10. <script>
  11. function doGetGraphicByJson_click() {
  12. var jsonStr = '{"ExChangeRoot": {"Features": [' +
  13. ' { "type": "polygon", "featureName": "用地", "Feature":[ {"Geometry": { "Rings": [{ "Ring": "1000,-1000|0,-1500|-1000,-1000|-1000,1000|1000,1000|2000,0" } ]},"Attribute": { "ID": "1", "地块面积": "100", "建筑限高": "20" }, "ToolTip": "用地地块","Color": "yellow", "Style": "solid" } ] },' +
  14. '{ "type": "polyline", "featureName": "道路", "Feature": [{"ShowInfo":"yes", "Geometry": {"Paths": [{ "Path": "3778,-2008|2777,-2816|3777,-3021|3777,-3529|3772,-3928|3774,-4405|3777,-5206" }] }, "Attribute": {"ID": "2","道路名": "人民大道", "道路长度": "10000", "道路宽度": "25" }, "ToolTip": "人民大道", "Color": [225,0,0,0.5], "Size": "5" }] },' +
  15. '{ "type": "point", "featureName": "兴趣点", "Feature":[ { "Geometry": { "Points":[ { "Point": "2600,900" } ]},"Attribute": { "ID": "3","名称": "东方明珠" }, "ToolTip": "东方明珠","Color": "blue", "Size": "10", "Style": "square"}]}]}}';
  16. // var jsonStr = '{"ExChangeRoot": {"Features": [' +
  17. // '{ "type": "point", "Feature":[ { "Geometry": { "Points":[ { "Point": "2600,900,100" } ]},' +
  18. // '"Attribute": { "id": "3","名称": "",newImgWidth:"20",newImgHeight:"20" }, "ToolTip": "东方明珠","ImgUrl":"http://10.101.35.46/zhwj/assets/image/水源.png" ,' +
  19. // '"ImgWidth":"92px" ,"ImgHeight":"92px" }]}]}}';
  20. var jsonStr2='{"ExChangeRoot":{"Features":[ {"type":"point","Feature":[{"Geometry":{"Points":[{"Point":"2600,900,600"}]},"Attribute":{"编号": "310114","地址": "嘉定区安亭镇昌吉路153号","经度": "6653.29804326876","区名": "嘉定区","类型": 1,"名称": "上海市嘉定自来水有限公司","维度": "-28418.3397776738","坐标x": "121.168663","坐标y": "31.295120","水源编号": "281270"},"ToolTip":"东方明珠","ImgUrl":"https://10.101.35.50/zhwj/assets/image/水源.png","ImgWidth":"92px","ImgHeight":"92px","TextSize":"10","TextColor":[255,0,0]}]}]}}';
  21. doGetGraphicByJson(jsonStr2, true);
  22. }
  23. function doDeletePointById_click() {
  24. doDeletePointById(3)
  25. }
  26. function btPointByJson() {
  27. var jsonStr = '{"ExChangeRoot": {"Features": [' +
  28. ' { "type": "point", "featureName": "兴趣点", "Feature":[ { "Geometry": { "Points":[ { "Point": "-771.067748323432,4616.52835227014" } ]},"Attribute": { "ID": "1","名称": "测试点1" }, "ToolTip": "东方明珠","Color": "blue", "Size": "10", "Style": "square"}] },' +
  29. '{ "type": "point", "featureName": "兴趣点", "Feature":[ { "Geometry": { "Points":[ { "Point": "-323.288,7877.093000000001" } ]},"Attribute": { "ID": "2","名称": "测试点2" }, "ToolTip": "东方明珠","Color": "blue", "Size": "10", "Style": "square"}] },' +
  30. '{ "type": "point", "featureName": "兴趣点", "Feature":[ { "Geometry": { "Points":[ { "Point": "1939.53,1942.0980000000002" } ]},"Attribute": { "ID": "3","名称": "东方明珠" }, "ToolTip": "东方明珠","Color": "blue", "Size": "10", "Style": "square"}]}]}}';
  31. doGetGraphicByJson(jsonStr);
  32. }
  33. function doquery() {
  34. var str = txtQueryStr.value;
  35. var layerName = txtQueryLayerName.value;
  36. query(str, layerName);
  37. }
  38. function onMapLoaded() {
  39. alert("加载完成");
  40. }
  41. var f00 = 0;
  42. var f01 = 0;
  43. var f02 = 0;
  44. var f03 = 0;
  45. var f04 = 0;
  46. var f05 = 0;
  47. var f06 = 0;
  48. var f07 = 0;
  49. var f08 = 0;
  50. var f09 = 0;
  51. var f10 = 0;
  52. function doQueryByWhere() {
  53. var whereString = document.getElementById("txtSearchWhere");
  54. var layerName = document.getElementById("txtSearchLayerName");
  55. var str = whereString.value;
  56. var layerName = txtQueryLayerName.value;
  57. queryByWhereStr(str, layerName);
  58. }
  59. function btOpenFeatureLayerByNameClick() {
  60. var layerName = document.getElementById("txtSearchLayerName");
  61. if (layerName.value.length > 0) {
  62. if (parseInt(f00) == 1) {
  63. f00 = 0;
  64. }
  65. else {
  66. f00 = 1;
  67. }
  68. doOpenFeatureLayerByName(layerName.value, f00);
  69. }
  70. }
  71. function btOpenFeatureLayerClick0() {
  72. if (parseInt(f00) == 1) {
  73. f00 = 0;
  74. }
  75. else {
  76. f00 = 1;
  77. }
  78. doOpenFeatureLayer0(f00);
  79. }
  80. function btOpenFeatureLayerClick1() {
  81. if (parseInt(f01) == 1) {
  82. f01 = 0;
  83. }
  84. else {
  85. f01 = 1;
  86. }
  87. doOpenFeatureLayer1(f01);
  88. }
  89. function btOpenFeatureLayerClick2() {
  90. if (parseInt(f02) == 1) {
  91. f02 = 0;
  92. }
  93. else {
  94. f02 = 1;
  95. }
  96. doOpenFeatureLayer2(f02);
  97. }
  98. function btOpenFeatureLayerClick3() {
  99. if (parseInt(f03) == 1) {
  100. f03 = 0;
  101. }
  102. else {
  103. f03 = 1;
  104. }
  105. doOpenFeatureLayer3(f03);
  106. }
  107. function btOpenFeatureLayerClick4() {
  108. if (parseInt(f04) == 1) {
  109. f04 = 0;
  110. }
  111. else {
  112. f04 = 1;
  113. }
  114. doOpenFeatureLayer4(f04);
  115. }
  116. function btOpenFeatureLayerClick5() {
  117. if (parseInt(f05) == 1) {
  118. f05 = 0;
  119. }
  120. else {
  121. f05 = 1;
  122. }
  123. doOpenFeatureLayer5(f05);
  124. }
  125. function btOpenFeatureLayerClick6() {
  126. if (parseInt(f06) == 1) {
  127. f06 = 0;
  128. }
  129. else {
  130. f06 = 1;
  131. }
  132. doOpenFeatureLayer6(f06);
  133. }
  134. function btOpenFeatureLayerClick7() {
  135. if (parseInt(f07) == 1) {
  136. f07 = 0;
  137. }
  138. else {
  139. f07 = 1;
  140. }
  141. doOpenFeatureLayer7(f07);
  142. }
  143. function btOpenFeatureLayerClick8() {
  144. if (parseInt(f08) == 1) {
  145. f08 = 0;
  146. }
  147. else {
  148. f08 = 1;
  149. }
  150. doOpenFeatureLayer8(f08);
  151. }
  152. function btOpenFeatureLayerClick9() {
  153. if (parseInt(f09) == 1) {
  154. f09 = 0;
  155. }
  156. else {
  157. f09 = 1;
  158. }
  159. doOpenFeatureLayer9(f09);
  160. }
  161. function btOpenFeatureLayerClick10() {
  162. if (parseInt(f10) == 1) {
  163. f10 = 0;
  164. }
  165. else {
  166. f10 = 1;
  167. }
  168. doOpenFeatureLayer10(f10);
  169. }
  170. function btFlashFE0Click() {
  171. doFlashStatus("违章建筑");
  172. }
  173. function btFlashFE1Click() {
  174. doFlashStatus("虹口烟感");
  175. }
  176. function btFlashFE2Click() {
  177. doFlashStatus("门磁");
  178. }
  179. function btFlashFE3Click() {
  180. doFlashStatus("");
  181. }
  182. function btSetCenterExtentByPointR() {
  183. var x = 0;
  184. var y = 0;
  185. var r = 100;
  186. setCenterExtentByPointR(x, y, r)
  187. }
  188. function btDrawCircle() {
  189. doDrawCircle([225, 200, 0, 0.8])
  190. }
  191. function btQueryByCircle() {
  192. doQueryByCircle("BUILDING", "assets/image/btReset.png", 10, 10)
  193. }
  194. function SetExtent(num) {
  195. doSetExtent(num);
  196. }
  197. function btOnLocation() {
  198. var x = document.getElementById("txtXStr").value;
  199. var y = document.getElementById("txtYStr").value;
  200. var Attribute = '{ "ID": "1","名称": "测试点1" }';
  201. var ToolTip = '测试点1';
  202. var ImgUrl = 'https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png';
  203. var ImgWidth = "92px";
  204. var ImgHeight = "92px";
  205. doOnLocation(x, y, Attribute, ToolTip, ImgUrl, ImgWidth, ImgHeight);
  206. }
  207. function btOnLocationforGrid() {
  208. var x = document.getElementById("txtXStr").value;
  209. var y = document.getElementById("txtYStr").value;
  210. doOnLocationforGrid(x, y);
  211. }
  212. // window.onmessage = function(e) {
  213. // var payload = JSON.parse(e.data);
  214. // switch (payload.method) {
  215. // case "measureLengthCallback":{
  216. // var len = payload.data[0];
  217. // break;
  218. // }
  219. // }
  220. // }
  221. // var measureLengthCallback = function (length){
  222. // var len = length;
  223. // };
  224. function btMeasureLength() {
  225. var x = document.getElementById("txtStartXStr").value;
  226. var y = document.getElementById("txtStartYStr").value;
  227. var x1 = document.getElementById("txtEndXStr").value;
  228. var y1 = document.getElementById("txtEndYStr").value;
  229. doMeasureLengthByPoint(x, y, x1, y1, "measureLengthCallback");
  230. }
  231. function btNewQuery() {
  232. var str = document.getElementById("txtQueryStr").value;
  233. var layerName = document.getElementById("txtQueryLayerName").value;
  234. doNewQuery(str, layerName);
  235. }
  236. function btGridQuery() {
  237. var str = document.getElementById("txtQueryGridStr").value;
  238. var isgoto = false;
  239. doGridQuery(str, isgoto);
  240. }
  241. function btChangeLayerStateByName() {
  242. var layerName = document.getElementById("txtLayerStr").value;
  243. // doOpenFeatureLayerByName("街道乡镇", true, "1=1");
  244. doOpenFeatureLayerByName("十二月内存量零", true, "1=1");
  245. // doOpenFeatureLayerByName("非法行医",true,"所属区='宝山区'");
  246. }
  247. function btCloseChangeLayer() {
  248. doCloseChangeLayer();
  249. }
  250. function btOnLocationforAddress() {
  251. var x = document.getElementById("txtXStr").value;
  252. var y = document.getElementById("txtYStr").value;
  253. doOnLocationforAddress(x, y);
  254. }
  255. function btOnPointQuery() {
  256. var x = document.getElementById("txtXStr").value;
  257. var y = document.getElementById("txtYStr").value;
  258. var radius = 50;//米
  259. var layername = document.getElementById("txtQueryLayerName").value;
  260. // doOnQueryByPoint(x,y,"上水井盖",radius,true);
  261. doOnQueryByPoint(x, y, "万米网格", radius, true, false);
  262. }
  263. function btOnGridQuery() {
  264. var grid = "19258";
  265. var layername = document.getElementById("txtQueryLayerName").value;
  266. doOnQueryByGrid(grid, "路灯");
  267. }
  268. function btOnMapCenter() {
  269. doOnMapCenter();
  270. }
  271. function btOnMapLevel() {
  272. doOnMapLevel();
  273. }
  274. function btOnMapSetCenter() {
  275. var x = document.getElementById("txtXStr").value;
  276. var y = document.getElementById("txtYStr").value;
  277. doOnMapSetCenter(x, y);
  278. }
  279. function btOnGetXYbyAddress() {
  280. var address = document.getElementById("txtAddressStr").value;
  281. doOnGetXYbyAddress(address);
  282. }
  283. function btOnSetInitExtentByStr() {
  284. doOnSetInitExtentByStr("区县边界", "浦东新区");
  285. // doOnSetInitExtentByStr("街道乡镇","万祥镇");
  286. }
  287. function btQueryByCondition() {
  288. var str = "1=1";
  289. var layername = "废物箱(桶)";
  290. var isShow = true;
  291. var isGoTo = true;
  292. doOnQueryByCondition(str, layername, isShow, isGoTo);
  293. }
  294. function btChangeLayerStateByNameandWhere() {
  295. // doOpenFeatureLayerByNameandWhere("上水井盖",1 ,"枫林街道",false,false);
  296. // var type = 1;//街道
  297. // var name = "枫林街道";
  298. // var layername ="上水井盖";
  299. // var isOpen = true;
  300. // var isGoTo = true;
  301. // doOpenFeatureLayerByNameandWhere(layername,type ,name,isGoTo,isOpen);
  302. var type = "2";//区
  303. var name = "徐汇区";
  304. var layername = "上水井盖";
  305. var isOpen = true;
  306. var isGoTo = true;
  307. doOpenFeatureLayerByNameandWhere(layername, type, name, isGoTo, isOpen);
  308. }
  309. function btChangeLayerClose() {
  310. var type = 1;//街道
  311. var name = "枫林街道";
  312. var layername = "上水井盖";
  313. var isOpen = false;
  314. var isGoTo = false;
  315. doOpenFeatureLayerByNameandWhere(layername, type, name, isGoTo, isOpen);
  316. // var type = 1;//街道
  317. // var name = "枫林街道";
  318. // var layername ="上水井盖";
  319. // var isOpen = false;
  320. // var isGoTo = false;
  321. // doOpenFeatureLayerByNameandWhere("上水井盖",1 ,"徐家汇街道",true,true);
  322. }
  323. function btOnClickLocation() {
  324. // var x=document.getElementById("txtXStr").value;
  325. // var y=document.getElementById("txtYStr").value;
  326. var Attribute = '{ "ID": "1","名称": "测试点1" }';
  327. var ToolTip = '测试点1';
  328. var ImgUrl = 'https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png';
  329. // var ImgUrl = 'https://map.3h-weixin.com/images/location.png';
  330. var ImgWidth = '32px';
  331. var ImgHeight = '32px';
  332. doOnClickLocation(Attribute, ToolTip, ImgUrl, ImgWidth, ImgHeight);
  333. }
  334. function btOnresizeType() {
  335. var radius = 50;
  336. var layername = "上水井盖";
  337. doOnSetResizeType(1);//地址
  338. //
  339. // var radius = 50;
  340. // // var layername = "上水井盖";
  341. // //2查地址
  342. // doOnSetResizeType(2,radius,layername);//部件
  343. // doOnSetResizeType(3,radius,layername);//查地址部件
  344. }
  345. function btOnSetCluster() {
  346. var layername = "上水井盖";
  347. doOnSetLayerCluster(layername, true);
  348. }
  349. function btOnSetClusterClose() {
  350. var layername = "上水井盖";
  351. doOnSetLayerCluster(layername, false);
  352. }
  353. function btOnShowPolygonandText() {
  354. // var type = "街道乡镇";//街道
  355. // var name = "枫林街道";
  356. // var text = "you are here1 \n you are here2";
  357. var jsonarr = [{"type": "1", "name": "香花桥街道", "text": "统计1:456\n统计2:123"},
  358. {"type": "1", "name": "徐泾镇", "text": "统计1:456\n统计2:123"}];
  359. doOnShowPolygonandText(jsonarr);
  360. }
  361. // function btTest(){
  362. // var xml='<Result>\n' +
  363. // '<Status>False</Status>\n' +
  364. // '<StatusMessage>The table was not found. [合并数据]</StatusMessage>\n' +
  365. // '<IsLocInArea>1</IsLocInArea>\n' +
  366. // '<HappenAddress>练塘镇联农村四联362号</HappenAddress>\n' +
  367. // '<PoiAddress>练塘镇联农村四联362号</PoiAddress>\n' +
  368. // '<PoiName>练塘镇联农村四联</PoiName>\n' +
  369. // '<StreetName> </StreetName>\n' +
  370. // '<StreetCode> </StreetCode>\n' +
  371. // '<District> </District>\n' +
  372. // '<Community> </Community>\n' +
  373. // '<CommunityCode> </CommunityCode>\n' +
  374. // '<GridNo> </GridNo>\n' +
  375. // '<Road> </Road>\n' +
  376. // '<X>-44338.8083793</X>\n' +
  377. // '<Y>-27297.96031892</Y>\n' +
  378. // '<ZrGridNo> </ZrGridNo>\n' +
  379. // '<BlockID> </BlockID>\n' +
  380. // '<BlockName> </BlockName>\n' +
  381. // '<CQCodes> </CQCodes>\n' +
  382. // '<RailSafetyZone> </RailSafetyZone>\n' +
  383. // '<Rivers/>\n' +
  384. // '<IsPrecise>False</IsPrecise>\n' +
  385. // '<TypeName>门牌</TypeName>\n' +
  386. // '<Time>1.258秒</Time>\n' +
  387. // '</Result>';
  388. // // var test = xmltojson(xml,'Result',true);
  389. // var test1 = $.xml2json(xml);
  390. // // console.log(test);
  391. // console.log(test1);
  392. // }On
  393. function btOnClickLocationGetLatLog() {
  394. // var Attribute = '{ "ID": "1","名称": "测试点1" }';
  395. // var ToolTip = '测试点1';
  396. // var ImgUrl = 'https://static.arcgis.com/images/Symbols/Shapes/BlackStarLargeB.png';
  397. // var ImgWidth = '32px';
  398. // var ImgHeight = '32px';
  399. doOnLocationGetLatLon("#FF0000");
  400. }
  401. function btOndrawSquare() {
  402. doOnDrawPolygonSquare();
  403. // drawSquare();
  404. }
  405. function btOndrawCircle() {
  406. doOnDrawPolygonCircle();
  407. }
  408. function btLightArea() {
  409. var colorList = [{
  410. name: "静安区",
  411. color: [255, 255, 0, 0.6],
  412. text: "静安区:\n aaaa",
  413. textColor: "blue",
  414. text2: "123",
  415. textColor2: "red",
  416. },{
  417. name: "宝山区",
  418. color: [255, 255, 0, 0.6],
  419. text2: "232",
  420. textColor2: "red",
  421. text3: "<div style='background: red'>宝山区</div>",
  422. textColor3: "rgba(225, 0, 0, 0.5)"
  423. }
  424. ]
  425. doOnLightArea("区县边界", "区县名称 in ('静安区','宝山区')", colorList, "区县名称");
  426. }
  427. function btShowAreaName() {
  428. var type = $("#selectLightType").val();
  429. doShowAreaName("区县边界", "区县名称", true, 14, "#FF0000")
  430. }
  431. function bt2Dor3D(where) {
  432. switch2Dor3DMap(where);
  433. }
  434. function btRouteClick() {
  435. var TestData = [
  436. [{name: 'A', xy: [100, 200]}, {name: 'B', xy: [1000, 2000], value: 95,width:10}],
  437. [{name: 'A', xy: [100, 200]}, {name: 'C', xy: [-100, -2000], value: 90,width:20}],
  438. [{name: 'A', xy: [100, 200]}, {name: 'E', xy: [1000, -3000], value: 80,width:5}],
  439. [{name: 'A', xy: [100, 200]}, {name: 'F', xy: [2000, 4000], value: 70}],
  440. [{name: 'A', xy: [100, 200]}, {name: 'G', xy: [3000, -5000], value: 60}],
  441. [{name: 'A', xy: [100, 200]}, {name: 'H', xy: [4000, 7000], value: 50}],
  442. [{name: 'A', xy: [100, 200]}, {name: 'I', xy: [5000, -2000], value: 40}],
  443. [{name: 'A', xy: [100, 200]}, {name: 'J', xy: [6000, 9000], value: 30}],
  444. [{name: 'A', xy: [100, 200]}, {name: 'K', xy: [7000, -1000], value: 20}],
  445. [{name: 'A', xy: [100, 200]}, {name: 'L', xy: [8000, 2000], value: 10}]
  446. ];
  447. doEchartsRoute(TestData, "", "", 40);
  448. }
  449. function btWaterRouteClick() {
  450. doWaterRouteClick("1=1");
  451. }
  452. function btPopupWinClick() {
  453. var x = 2600;
  454. var y = 900;
  455. var popsArray = [{
  456. //地图坐标
  457. x: x,
  458. y: y,
  459. //popup内容的文字,只是个示范,当然格式不限
  460. content: "<iframe src='red.html' style='width:300px;height:400px'></iframe>",
  461. //气泡窗口div的id唯一标识
  462. id: "info1"
  463. },
  464. {
  465. x: -1133.713,
  466. y: -2313.15,
  467. content: "<button onclick='popupClick({id:0})'>ss</button>",
  468. id: "info2"
  469. }]
  470. doPopupIn(popsArray, false);
  471. }
  472. function btClosePopupWinClick() {
  473. doClosePopupIn();
  474. }
  475. function btCorrugatedPointByOid() {
  476. var ORGANIZATION_ID_List = ["9349b6df19344947805984d4b288565d", "5b440954408a4c9c95e34ec0e8a1caf3", "cb988219c7f042a8a17eabdfedb33f8c"]
  477. doCorrugatedPointByOid(ORGANIZATION_ID_List);
  478. }
  479. function btClearCorrugatedPoint() {
  480. doClearCorrugatedPoint()
  481. }
  482. function xyToStreetId() {
  483. doXyToStreetId(1, 1);
  484. }
  485. function btGoToGraphic() {
  486. doGoToGraphic("区县边界", "区县名称='徐汇区'")
  487. // doGoToGraphic("街道乡镇","街道名称='华亭镇'")
  488. // doGoToGraphic("点",[[0,0],[1000,1000]]);
  489. }
  490. //返回方法
  491. function doXyToStreetIdReturn(streetId) {
  492. console.log(streetId)
  493. }
  494. function clickLightAreaReturn(attr) {
  495. console.log(attr)
  496. }
  497. function moveInLightAreaReturn(attr) {
  498. console.log(attr)
  499. }
  500. function clickWaterTankReturn(attr) {
  501. console.log(attr)
  502. }
  503. function moveOutLightAreaReturn(attr) {
  504. console.log(attr)
  505. }
  506. function moveOutDrawLayerReturn(attr) {
  507. console.log(attr)
  508. }
  509. function moveInDrawLayerReturn(attr) {
  510. console.log(attr)
  511. }
  512. function clickDrawLayerReturn(attr) {
  513. console.log(attr)
  514. }
  515. function doPopupClickReturn(json) {
  516. alert(json.id)
  517. }
  518. function closePopupReturn(id) {
  519. console.log(id)
  520. }
  521. function clickWZXYFeatureReturn(attr) {
  522. debugger
  523. }
  524. function clickApparitorFeatureReturn(arr) {
  525. debugger
  526. console.log(arr[0].name)
  527. }
  528. function btGoToJZ() {
  529. doGoToJZ("固定监测站", "",document.getElementById("radius").value)
  530. }
  531. function btShowBuildlayer(where){
  532. ShowBuildlayer(where);
  533. }
  534. function btShowBuildlayerSX(where){
  535. ShowBuildlayerSX(where);
  536. }
  537. function btResettingMap(){
  538. ResettingMap();
  539. }
  540. function btconsoleXYZ(){
  541. consoleXYZ();
  542. }
  543. function btClusterByJson() {
  544. var list= [{
  545. id:'1',
  546. name:'aa',
  547. cjX:4000,
  548. cjY:-2310,
  549. cameraIndexCode:'1111',
  550. latitude:4000,
  551. longitude:-2310,
  552. },{
  553. id:'2',
  554. name:'aa1',
  555. cjX:4000,
  556. cjY:4000,
  557. cameraIndexCode:'1111',
  558. latitude:4000,
  559. longitude:-2310,
  560. },{
  561. id:'3',
  562. name:'aa2',
  563. cjX:-4200,
  564. cjY:-4011,
  565. cameraIndexCode:'1111',
  566. latitude:4000,
  567. longitude:-2310,
  568. },{
  569. id:'4',
  570. name:'aa3',
  571. cjX:-4221,
  572. cjY:-4000,
  573. cameraIndexCode:'1111',
  574. latitude:4000,
  575. longitude:-2310,
  576. } ];
  577. var img=[{src:'http://10.101.35.50/zhwj/assets/image/水源.png',imgwidth:'25px',imgHeight:'25px'},
  578. {src:'http://10.101.35.50/zhwj/assets/image/水厂.png',imgwidth:'25px',imgHeight:'25px'}];
  579. doClusterByJson(list,img)
  580. }
  581. function bt2ChangerExtent() {
  582. var xmax=256584;
  583. var xmin=-263908;
  584. var ymax=81205.64627439517;
  585. var ymin=-65099.3105455185;
  586. ChangerExtent(xmax,xmin,ymax,ymin);
  587. }
  588. function btOnMapSetCenter3D() {
  589. var x = document.getElementById("txtXStr").value;
  590. var y = document.getElementById("txtYStr").value;
  591. doOnMapSetCenter3D(x, y,8,null,null);
  592. }
  593. function btHeatMap(type) {
  594. HeatMap(type);
  595. }
  596. </script>
  597. </head>
  598. <body>
  599. <div>
  600. <button onclick="xyToStreetId()">坐标转街道id</button>
  601. <!--放大范围0-13-->
  602. <button id="btZoomIn" onclick="ZoomIn(4)">放大</button>
  603. <button id="btZoomOut" onclick="ZoomOut(2)">缩小</button>
  604. <button id="btClear" onclick="Clear('all')">清空地图</button>
  605. <button id="btViewTest" onclick="ViewChange()">切换地图</button>
  606. <button id="btFullExtent" onclick="fullExtent()">全景</button>
  607. <button id="btDrawPolygon" onclick="measureSquare()">测面积</button>
  608. <button id="btDrawPolyline" onclick="measureLength()">测距离</button>
  609. <button id="btPrintPicture" onclick="downLoadPicture()">导出图片</button>
  610. <button id="btGetGraphicByJson" onclick="doGetGraphicByJson_click()">根据json撒点线面</button>
  611. <button onclick="doDeletePointById_click()">根据id删除点</button>
  612. <button id="btPointByJson" onclick="btPointByJson()">测试</button>
  613. <button id="btnCircle" onclick="drawSquare()">画圈</button>
  614. <button id="btSetExtent1" onclick="SetExtent(1);">范围一</button>
  615. <button id="btSetExtent2" onclick="SetExtent(2);">范围二</button>
  616. <button id="btSetExtent3" onclick="SetExtent(3);">范围三</button>
  617. <!-- 2019 12 by hm -->
  618. <input id="txtXStr" placeholder="经度"/>
  619. <input id="txtYStr" placeholder="纬度"/>
  620. <button onclick="btOnLocation()"> 定位</button>
  621. <button onclick="btOnLocationforGrid()"> 网格</button>
  622. <button onclick="btOnLocationforAddress()"> 地址</button>
  623. <input id="txtStartXStr" placeholder="起点经度"/>
  624. <input id="txtStartYStr" placeholder="起点纬度"/>
  625. <input id="txtEndXStr" placeholder="终点经度"/>
  626. <input id="txtEndYStr" placeholder="终点纬度"/>
  627. <button onclick="btMeasureLength()"> 两点测距</button>
  628. <input id="txtQueryStr" placeholder="关键词" value="1=1"/>
  629. <input id="txtQueryLayerName" placeholder="搜索图层名" value="路灯"/>
  630. <button onclick="btNewQuery()">图层查询</button>
  631. <input id="txtQueryGridStr" placeholder="关键词" value="1=1"/>
  632. <button onclick="btGridQuery()">网格查询</button>
  633. <input id="txtLayerStr" placeholder="图层名"/>
  634. <button onclick="btChangeLayerStateByName()">图层开关</button>
  635. <button onclick="btCloseChangeLayer()">关闭所有图层开关</button>
  636. <button onclick="btOnPointQuery()">点查询</button>
  637. <button onclick="btOnGridQuery()">网格查询</button>
  638. <button onclick="btOnMapCenter()"> 地图中心点</button>
  639. <button onclick="btOnMapLevel()"> 地图层级</button>
  640. <button onclick="btOnMapSetCenter()"> 设置地图中心点</button>
  641. <input id="txtAddressStr" placeholder="路名"/>
  642. <button onclick="btOnGetXYbyAddress()"> 地址获得XY</button>
  643. <button onclick="btOnSetInitExtentByStr()"> 四至范围</button>
  644. <button onclick="btQueryByCondition()">doOnQueryByCondition</button>
  645. <button onclick="btChangeLayerStateByNameandWhere()">条件图层开关</button>
  646. <button onclick="btChangeLayerClose()">条件图层关</button>
  647. <!--<button onclick="btTest()"> Test</button>-->
  648. <button onclick="btOnClickLocation()"> 点击绘制点并返回信息</button>
  649. <button onclick="btOnresizeType()"> 设置resizeType</button>
  650. <button onclick="btOnSetCluster()"> 聚合开关</button>
  651. <button onclick="btOnSetClusterClose()"> 聚合开关</button>
  652. <button onclick="btOnShowPolygonandText()">测试</button>
  653. <button onclick="btOnClickLocationGetLatLog()">画点(点击)</button>
  654. <button onclick="btOndrawSquare()">画方</button>
  655. <button onclick="btOndrawCircle()">画⚪</button>
  656. <span>
  657. <select id="selectLightType">
  658. <option value="区县边界">区县边界</option>
  659. <option value="街道乡镇">街道乡镇</option>
  660. <option value="居委会">居委会</option>
  661. </select>
  662. <input type="text" id="txtLightCondition" placeholder="条件">
  663. <button id="btOpenFeatureLayer3" onclick="btLightArea()">高亮区县街道</button>
  664. <button onclick="btShowAreaName()">显示区县名称</button>
  665. </span>
  666. <button id="btRoute" onclick="btRouteClick()">迁移图效果</button>
  667. <button id="btPopupWin" onclick="btPopupWinClick()">放置自定义对话框</button>
  668. <button id="btClosePopupWin" onclick="btClosePopupWinClick()">关闭自定义对话框</button>
  669. <button onclick="btCorrugatedPointByOid()">传id撒波纹点</button>
  670. <button onclick="btWaterRouteClick()">水源地溯源</button>
  671. <button onclick="btGoToGraphic()">聚焦到</button>
  672. <button onclick="btClusterByJson()">聚合</button>
  673. <button onclick="btGoToJZ()">基站</button>
  674. <input type="number" id="radius" value="1000">
  675. <button onclick="btShowBuildlayer(true)">切换3D</button>
  676. <button onclick="btShowBuildlayer(false)">切换2D</button>
  677. <button onclick="btShowBuildlayerSX(true)">水箱显示</button>
  678. <button onclick="btShowBuildlayerSX(false)">水箱隐藏</button>
  679. <button onclick="btResettingMap()">重置</button>
  680. <button onclick="btconsoleXYZ()">获取xyz</button>
  681. <button onclick="bt2Dor3D('3D')">切换3D</button>
  682. <button onclick="bt2Dor3D('2D')">切换2D</button>
  683. <button onclick="bt2ChangerExtent()" >四至范围</button>
  684. <button onclick="btOnMapSetCenter3D()"> 设置地图中心点3d</button>
  685. <button onclick="btHeatMap(0)" >热力图</button>
  686. <button onclick="btHeatMap(1)" >热力图</button>
  687. <button onclick="btHeatMap('clear')" >清空热力图</button>
  688. <div style="width: 10px;height: 10px;background: #0c80ba" onc></div>
  689. <div>
  690. <iframe id="myMap" src="GisShareApp3D2.html" width="1536px" height="988px" frameborder="no" border="0"
  691. marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"/>
  692. </div>
  693. </div>
  694. </body>
  695. </html>