m30_echarts_line1.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
  6. <meta name="author" content="火星科技 http://mars3d.cn " />
  7. <meta name="apple-touch-fullscreen" content="yes" />
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  10. <meta name="format-detection" content="telephone=no" />
  11. <meta name="x5-fullscreen" content="true" />
  12. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  13. <!-- 标题及搜索关键字 -->
  14. <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
  15. <meta
  16. name="description"
  17. content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型 gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包 地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
  18. />
  19. <link rel="shortcut icon" type="image/x-icon" href="" />
  20. <title>物流运输图 | Echarts扩展支持|三维地图 </title>
  21. <!--第三方lib-->
  22. <script
  23. type="text/javascript"
  24. src="../lib/include-lib.js"
  25. libpath="../lib/"
  26. include="jquery,font-awesome,bootstrap,layer,haoutil,turf,mars3d,mars3d-echarts"
  27. ></script>
  28. <link href="css/style.css" rel="stylesheet" />
  29. </head>
  30. <body class="dark">
  31. <!--加载前进行操作提示,优化用户体验-->
  32. <div id="mask" class="signmask" onclick="removeMask()"></div>
  33. <div id="mars3dContainer" class="mars3d-container"></div>
  34. <script src="./js/common.js"></script>
  35. <script type="text/javascript">
  36. "use script"; //开发环境建议开启严格模式
  37. var map;
  38. function initMap(options) {
  39. //合并属性参数,可覆盖config.json中的对应配置
  40. var mapOptions = mars3d.Util.merge(options, {
  41. scene: {
  42. center: { lat: 14.986428, lng: 113.87451, alt: 3519007, heading: 353, pitch: -69 },
  43. },
  44. });
  45. //创建三维地球场景
  46. map = new mars3d.Map("mars3dContainer", mapOptions);
  47. //创建Echarts图层
  48. createEchartsLayer();
  49. }
  50. function createEchartsLayer() {
  51. var options = getEchartsOption();
  52. var echartsLayer = new mars3d.layer.EchartsLayer(options);
  53. map.addLayer(echartsLayer);
  54. }
  55. function getEchartsOption(data) {
  56. var allData = {
  57. citys: [
  58. {
  59. itemStyle: {
  60. normal: {
  61. color: "#58B3CC",
  62. },
  63. },
  64. name: "\u8087\u5e86",
  65. value: [112.47, 23.05, 2],
  66. symbolSize: 1,
  67. },
  68. {
  69. itemStyle: {
  70. normal: {
  71. color: "#58B3CC",
  72. },
  73. },
  74. name: "\u5fb7\u9633",
  75. value: [104.38, 31.13, 2],
  76. symbolSize: 1,
  77. },
  78. {
  79. itemStyle: {
  80. normal: {
  81. color: "#58B3CC",
  82. },
  83. },
  84. name: "\u8861\u9633",
  85. value: [112.57, 26.9, 2],
  86. symbolSize: 1,
  87. },
  88. {
  89. itemStyle: {
  90. normal: {
  91. color: "#58B3CC",
  92. },
  93. },
  94. name: "\u6069\u65bd",
  95. value: [109.47, 30.3, 2],
  96. symbolSize: 1,
  97. },
  98. {
  99. itemStyle: {
  100. normal: {
  101. color: "#58B3CC",
  102. },
  103. },
  104. name: "\u54b8\u9633",
  105. value: [108.7, 34.33, 2],
  106. symbolSize: 1.0,
  107. },
  108. {
  109. itemStyle: {
  110. normal: {
  111. color: "#58B3CC",
  112. },
  113. },
  114. name: "\u8302\u540d",
  115. value: [110.92, 21.67, 2],
  116. symbolSize: 1,
  117. },
  118. {
  119. itemStyle: {
  120. normal: {
  121. color: "#58B3CC",
  122. },
  123. },
  124. name: "\u91cd\u5e86",
  125. value: [106.55, 29.57, 2],
  126. symbolSize: 8.0,
  127. },
  128. {
  129. itemStyle: {
  130. normal: {
  131. color: "#58B3CC",
  132. },
  133. },
  134. name: "\u6b66\u6c49",
  135. value: [114.3, 30.6, 2],
  136. symbolSize: 11.0,
  137. },
  138. {
  139. itemStyle: {
  140. normal: {
  141. color: "#58B3CC",
  142. },
  143. },
  144. name: "\u6c88\u9633",
  145. value: [123.43, 41.8, 2],
  146. symbolSize: 1,
  147. },
  148. {
  149. itemStyle: {
  150. normal: {
  151. color: "#58B3CC",
  152. },
  153. },
  154. name: "\u6d77\u53e3",
  155. value: [110.32, 20.03, 2],
  156. symbolSize: 1,
  157. },
  158. {
  159. itemStyle: {
  160. normal: {
  161. color: "#58B3CC",
  162. },
  163. },
  164. name: "\u4e0a\u6d77",
  165. value: [121.47, 31.23, 2],
  166. symbolSize: 5.0,
  167. },
  168. {
  169. itemStyle: {
  170. normal: {
  171. color: "#58B3CC",
  172. },
  173. },
  174. name: "\u5e7f\u5dde",
  175. value: [113.5107, 23.2196, 2],
  176. symbolSize: 5.0,
  177. },
  178. {
  179. itemStyle: {
  180. normal: {
  181. color: "#58B3CC",
  182. },
  183. },
  184. name: "\u8346\u95e8",
  185. value: [112.2, 31.03, 2],
  186. symbolSize: 1,
  187. },
  188. ],
  189. movelines: [
  190. {
  191. toName: "\u91cd\u5e86",
  192. fromName: "\u54b8\u9633",
  193. coords: [
  194. [108.7, 34.33],
  195. [106.55, 29.57],
  196. ],
  197. },
  198. {
  199. toName: "\u4e0a\u6d77",
  200. fromName: "\u91cd\u5e86",
  201. coords: [
  202. [106.55, 29.57],
  203. [121.47, 31.23],
  204. ],
  205. },
  206. {
  207. toName: "\u91cd\u5e86",
  208. fromName: "\u6b66\u6c49",
  209. coords: [
  210. [114.3, 30.6],
  211. [106.55, 29.57],
  212. ],
  213. },
  214. {
  215. toName: "\u5fb7\u9633",
  216. fromName: "\u6b66\u6c49",
  217. coords: [
  218. [114.3, 30.6],
  219. [104.38, 31.13],
  220. ],
  221. },
  222. {
  223. toName: "\u4e0a\u6d77",
  224. fromName: "\u6b66\u6c49",
  225. coords: [
  226. [114.3, 30.6],
  227. [121.47, 31.23],
  228. ],
  229. },
  230. {
  231. toName: "\u8087\u5e86",
  232. fromName: "\u4e0a\u6d77",
  233. coords: [
  234. [121.47, 31.23],
  235. [112.47, 23.05],
  236. ],
  237. },
  238. {
  239. toName: "\u8861\u9633",
  240. fromName: "\u4e0a\u6d77",
  241. coords: [
  242. [121.47, 31.23],
  243. [112.57, 26.9],
  244. ],
  245. },
  246. {
  247. toName: "\u6069\u65bd",
  248. fromName: "\u4e0a\u6d77",
  249. coords: [
  250. [121.47, 31.23],
  251. [109.47, 30.3],
  252. ],
  253. },
  254. {
  255. toName: "\u8302\u540d",
  256. fromName: "\u4e0a\u6d77",
  257. coords: [
  258. [121.47, 31.23],
  259. [110.92, 21.67],
  260. ],
  261. },
  262. {
  263. toName: "\u6b66\u6c49",
  264. fromName: "\u4e0a\u6d77",
  265. coords: [
  266. [121.47, 31.23],
  267. [114.3, 30.6],
  268. ],
  269. },
  270. {
  271. toName: "\u6d77\u53e3",
  272. fromName: "\u4e0a\u6d77",
  273. coords: [
  274. [121.47, 31.23],
  275. [110.32, 20.03],
  276. ],
  277. },
  278. {
  279. toName: "\u5e7f\u5dde",
  280. fromName: "\u4e0a\u6d77",
  281. coords: [
  282. [121.47, 31.23],
  283. [113.5107, 23.2196],
  284. ],
  285. },
  286. {
  287. toName: "\u8346\u95e8",
  288. fromName: "\u4e0a\u6d77",
  289. coords: [
  290. [121.47, 31.23],
  291. [112.2, 31.03],
  292. ],
  293. },
  294. {
  295. toName: "\u4e0a\u6d77",
  296. fromName: "\u5e7f\u5dde",
  297. coords: [
  298. [113.5107, 23.2196],
  299. [121.47, 31.23],
  300. ],
  301. },
  302. {
  303. toName: "\u6c88\u9633",
  304. fromName: "\u5e7f\u5dde",
  305. coords: [
  306. [113.5107, 23.2196],
  307. [123.43, 41.8],
  308. ],
  309. },
  310. ],
  311. };
  312. var option = {
  313. animation: false,
  314. backgroundColor: "rgba(17, 19, 42, 0.4)",
  315. title: {
  316. text: "火星科技物流运输图",
  317. left: "center",
  318. textStyle: {
  319. color: "#fff",
  320. },
  321. },
  322. legend: {
  323. show: false,
  324. orient: "vertical",
  325. top: "bottom",
  326. left: "right",
  327. data: ["地点", "线路"],
  328. textStyle: {
  329. color: "#fff",
  330. },
  331. },
  332. series: [
  333. {
  334. name: "地点",
  335. type: "effectScatter",
  336. coordinateSystem: "mars3dMap",
  337. zlevel: 2,
  338. rippleEffect: {
  339. brushType: "stroke",
  340. },
  341. label: {
  342. emphasis: {
  343. show: true,
  344. position: "right",
  345. formatter: "{b}",
  346. },
  347. },
  348. symbolSize: 2,
  349. showEffectOn: "render",
  350. itemStyle: {
  351. normal: {
  352. color: "#46bee9",
  353. },
  354. },
  355. data: allData.citys,
  356. },
  357. {
  358. name: "线路",
  359. type: "lines",
  360. coordinateSystem: "mars3dMap",
  361. zlevel: 2,
  362. large: true,
  363. effect: {
  364. show: true,
  365. constantSpeed: 30,
  366. symbol: "pin",
  367. symbolSize: 4,
  368. trailLength: 0,
  369. },
  370. lineStyle: {
  371. normal: {
  372. color: new echarts.graphic.LinearGradient(
  373. 0,
  374. 0,
  375. 0,
  376. 1,
  377. [
  378. {
  379. offset: 0,
  380. color: "#58B3CC",
  381. },
  382. {
  383. offset: 1,
  384. color: "#F58158",
  385. },
  386. ],
  387. false
  388. ),
  389. width: 1.5,
  390. opacity: 0.4,
  391. curveness: 0.1,
  392. },
  393. },
  394. data: allData.movelines,
  395. },
  396. ],
  397. };
  398. return option;
  399. }
  400. </script>
  401. </body>
  402. </html>