map-easy-insert.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. // 本文件地址 http://10.110.35.104
  2. window.EASYMAP_CONFIG = {
  3. myUrl: 'http://10.110.35.104/',
  4. mapConfigName: '',
  5. poihost: '',
  6. }
  7. if (!window.SITE_CONFIG) {
  8. window.SITE_CONFIG = {}
  9. }
  10. if (window.SITE_CONFIG['mapLoadUrl']) {
  11. window.EASYMAP_CONFIG.myurl = window.SITE_CONFIG['mapLoadUrl']
  12. }
  13. if (window.SITE_CONFIG['isMapOnProduct'] === true) {
  14. window.EASYMAP_CONFIG.myUrl = './'
  15. }
  16. var mapConfig_4326 =
  17. {
  18. positionImgUrl:window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/position.png',
  19. //辖区坐标地址
  20. xq_url: "http://59.212.37.22/ime-cloud/rest/ADMI_DIVI_A/feature/0/query?where=datacode='{{datacode}}'",
  21. option: {
  22. crs: 'EPSG4326',
  23. center: { lon: 109.72898, lat: 19.183274 },
  24. zoom: 8,
  25. zoomControl: false,
  26. attributionControl: false,
  27. inertiaDeceleration: 15000,
  28. minZoom: 4, // 最小级别数
  29. maxZoom: 18, // 最大级别数
  30. },
  31. layers: [
  32. {
  33. name: '矢量',
  34. type: 'wmts',
  35. mapType: 'sl',
  36. url:'http://59.255.48.160:81/vec_c/wmts?tk=您的密钥',
  37. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/sl.png',
  38. option: {
  39. layer: "vec",
  40. style: "default",
  41. tilematrixSet: "c",
  42. format: "tiles",
  43. opacity: 1,
  44. zIndex: 1,//海图永远在底图的上一层,
  45. },
  46. subLayer: [
  47. {
  48. name: '海南矢量',
  49. crs: 'CustomEPSG4326',
  50. type: 'GXYZ',
  51. url: 'http://59.212.37.22/mapserver/vmap/hn_bigdata_2018dt/getMAP?x={x}&y={y}&l={z}&styleId=hn_bigdata_2018dtys1',
  52. option: {
  53. tileSize: 256,
  54. minZoom: 8, // 最小级别数
  55. maxZoom: 18, // 最大级别数
  56. zIndex: 4,//海图永远在底图的上一层,
  57. opacity: 0.9,
  58. transparent: true,
  59. bounds:[[18.995361328125,109.3963623046875],[19.423828125, 110.3082275390625]]
  60. // bounds:[[18.1494140625, 108.5614013671875],[20.1708984375, 111.060791015625]]
  61. }
  62. },
  63. {
  64. name: '标记',
  65. url: 'http://59.255.48.160:81/cva_c/wmts?tk=您的密钥',
  66. type: 'wmts',
  67. option: {
  68. layer: "cva",
  69. style: "default",
  70. tilematrixSet: "c",
  71. format: "tiles",
  72. zIndex: 4//海图永远在底图的上一层
  73. }
  74. }
  75. ]
  76. },
  77. {
  78. name: '海图影像',
  79. type: 'wmts',
  80. mapType: 'htyx',
  81. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/yx.png',
  82. url: 'http://59.255.48.160:81/img_c/wmts?tk=您的密钥',
  83. option: {
  84. layer: "img",
  85. style: "default",
  86. tilematrixSet: "c",
  87. format: "tiles",
  88. opacity: 0.6,
  89. zIndex: 1,//海图永远在底图的上一层,
  90. },
  91. subLayer: [
  92. {
  93. name: '影像',
  94. type: 'wmts',
  95. url: 'http://59.212.146.170:80/ime-cloud/rest/hainan_img_2018/wmts',
  96. option: {
  97. layer: "hainan_img_2018",
  98. style: "default",
  99. tilematrixSet: "default028mm",
  100. format: "image/jpgpng",
  101. minZoom: 8, // 最小级别数
  102. maxZoom: 18, // 最大级别数
  103. zIndex: 4,//海图永远在底图的上一层,
  104. bounds:[[13.257020557028,103.34794430865948],[23.46552385201528,114.30558768331025]]
  105. }
  106. },
  107. {
  108. name: '海图',
  109. url: 'http://59.212.37.22/service',
  110. type: 'wms',
  111. option: {
  112. layers: 'haitu',
  113. format: 'image/png',
  114. transparent: true,
  115. //crs: L.CRS.EPSG4326,
  116. opacity: 0.9,
  117. zIndex: 4//海图永远在底图的上一层
  118. }
  119. },{
  120. name: '标记',
  121. url: 'http://59.255.48.160:81/cia_c/wmts?tk=您的密钥',
  122. type: 'wmts',
  123. option: {
  124. layer: "cia",
  125. style: "default",
  126. tilematrixSet: "c",
  127. format: "tiles",
  128. zIndex: 4//海图永远在底图的上一层
  129. }
  130. }
  131. ]
  132. },
  133. {
  134. name: '海图矢量',
  135. type: 'wmts',
  136. mapType: 'htsl',
  137. url:'http://59.255.48.160:81/vec_c/wmts?tk=您的密钥',
  138. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/sl.png',
  139. option: {
  140. layer: "vec",
  141. style: "default",
  142. tilematrixSet: "c",
  143. format: "tiles",
  144. opacity: 1,
  145. zIndex: 1,//海图永远在底图的上一层,
  146. },
  147. subLayer: [
  148. {
  149. name: '海南矢量',
  150. crs: 'CustomEPSG4326',
  151. type: 'GXYZ',
  152. url: 'http://59.212.37.22/mapserver/vmap/hn_bigdata_2018dt/getMAP?x={x}&y={y}&l={z}&styleId=hn_bigdata_2018dtys1',
  153. option: {
  154. tileSize: 256,
  155. minZoom: 8, // 最小级别数
  156. maxZoom: 18, // 最大级别数
  157. zIndex: 4,//海图永远在底图的上一层,
  158. opacity: 0.9,
  159. transparent: true,
  160. bounds:[[18.995361328125,109.3963623046875],[19.423828125, 110.3082275390625]]
  161. // bounds:[[18.1494140625, 108.5614013671875],[20.1708984375, 111.060791015625]]
  162. }
  163. },
  164. {
  165. name: '海图',
  166. url: 'http://59.212.37.22/service',
  167. type: 'wms',
  168. option: {
  169. layers: 'haitu',
  170. format: 'image/png',
  171. transparent: true,
  172. //crs: L.CRS.EPSG4326,
  173. opacity: 0.6,
  174. zIndex: 4,//海图永远在底图的上一层,
  175. // bounds:[[18.1494140625, 108.5614013671875],[20.1708984375, 111.060791015625]]
  176. }
  177. },
  178. {
  179. name: '标记',
  180. url: 'http://59.255.48.160:81/cva_c/wmts?tk=您的密钥',
  181. type: 'wmts',
  182. option: {
  183. layer: "cva",
  184. style: "default",
  185. tilematrixSet: "c",
  186. format: "tiles",
  187. zIndex: 4//海图永远在底图的上一层
  188. }
  189. }
  190. ]
  191. },
  192. {
  193. name: '影像',
  194. type: 'wmts',
  195. mapType: 'yx',
  196. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/yx.png',
  197. url: 'http://59.255.48.160:81/img_c/wmts?tk=您的密钥',
  198. option: {
  199. layer: "img",
  200. style: "default",
  201. tilematrixSet: "c",
  202. format: "tiles",
  203. opacity: 0.6,
  204. zIndex: 1,//海图永远在底图的上一层,
  205. },
  206. subLayer: [
  207. {
  208. name: '影像',
  209. type: 'wmts',
  210. url: 'http://59.212.146.170:80/ime-cloud/rest/hainan_img_2018/wmts',
  211. option: {
  212. layer: "hainan_img_2018",
  213. style: "default",
  214. tilematrixSet: "default028mm",
  215. format: "image/jpgpng",
  216. minZoom: 8, // 最小级别数
  217. maxZoom: 18, // 最大级别数
  218. zIndex: 4,//海图永远在底图的上一层,
  219. bounds:[[13.257020557028,103.34794430865948],[23.46552385201528,114.30558768331025]]
  220. }
  221. },{
  222. name: '标记',
  223. url: 'http://59.255.48.160:81/cia_c/wmts?tk=您的密钥',
  224. type: 'wmts',
  225. option: {
  226. layer: "cia",
  227. style: "default",
  228. tilematrixSet: "c",
  229. format: "tiles",
  230. zIndex: 4//海图永远在底图的上一层
  231. }
  232. }
  233. ]
  234. },
  235. {
  236. name: '地形图',
  237. type: 'wmts',
  238. mapType: 'dxt',
  239. url: 'http://59.255.48.160:81/ter_c/wmts?tk=您的密钥',
  240. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/dx.png',
  241. option: {
  242. layer: "ter",
  243. style: "default",
  244. tilematrixSet: "c",
  245. format: "tiles",
  246. },
  247. subLayer: [
  248. {
  249. name: '海南地形图',
  250. url: 'http://59.212.146.170/ime-cloud/rest/hainan_dem/wmts',
  251. type: 'wmts',
  252. option: {
  253. layer: "hainan_dem",
  254. style: "default",
  255. tilematrixSet: "default028mm",
  256. format: "image/jpgpng",
  257. minZoom: 8, // 最小级别数
  258. maxZoom: 18, // 最大级别数
  259. zIndex: 4,//海图永远在底图的上一层,
  260. bounds:[[17.17616389817063,106.9017014531631],[21.04474386095089,113.04819115525501]]
  261. }
  262. },
  263. {
  264. name: '标记',
  265. url: 'http://59.255.48.160:81/cta_c/wmts?tk=您的密钥',
  266. type: 'wmts',
  267. option: {
  268. layer: "cta",
  269. style: "default",
  270. tilematrixSet: "c",
  271. format: "tiles",
  272. }
  273. }
  274. /* {
  275. name: '标记',
  276. url: 'http://59.212.146.170:80/ime-cloud/rest/hainan_img_zj/wmts',
  277. type: 'wmts',
  278. option: {
  279. layer: "hainan_img_zj",
  280. style: "default",
  281. tilematrixSet: "default028mm",
  282. format: "image/jpgpng",
  283. bounds:[[16.836052000000052,107.79557194900008],[20.450422649000075,112.34245500000009]]
  284. }
  285. }*/
  286. ]
  287. }
  288. ,{
  289. name: '黑元素',
  290. crs: 'CustomEPSG4326',
  291. type: 'GXYZ',
  292. mapType: 'hys',
  293. url: 'http://59.212.37.22/mapserver/vmap/hn_bigdata_2018dt/getMAP?x={x}&y={y}&l={z}&styleId=hn_bigdata_2018dtys2',
  294. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/hys.png',
  295. option: {
  296. tileSize: 512
  297. },
  298. subLayer: [
  299. {
  300. name: '标记',
  301. url: 'http://59.255.48.160:81/cta_c/wmts?tk=您的密钥',
  302. type: 'wmts',
  303. option: {
  304. layer: "cta",
  305. style: "default",
  306. tilematrixSet: "c",
  307. format: "tiles",
  308. }
  309. }
  310. ]
  311. },
  312. ],
  313. overlayMaps: [
  314. /*{
  315. name:'标记',
  316. url:'http://59.212.146.170:80/ime-cloud/rest/hainan_img_zj/wmts',
  317. type:'wmts',
  318. option:{
  319. layer: "hainan_img_zj",
  320. style: "default",
  321. tilematrixSet: "default028mm",
  322. format: "image/jpgpng",
  323. bounds:[[16.836052000000052,107.79557194900008],[20.450422649000075,112.34245500000009]]
  324. }
  325. },*/
  326. /*{
  327. name: 'bj',
  328. crs: 'CustomEPSG4326',
  329. type: 'GWVTAnno',
  330. url: 'http://59.212.37.22/mapserver/label/hn_bigdata_2018dt/getData?x={x}&y={y}&l={z}&styleId=hn_bigdata_2018dtys1',
  331. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/hys.png',
  332. option: {
  333. tileSize: 512
  334. }
  335. },
  336. {
  337. name: 'ht',
  338. url: 'http://59.212.37.22/service',
  339. type: 'wms',
  340. option: {
  341. layers: 'haitu',
  342. format: 'image/png',
  343. transparent: true,
  344. //crs: L.CRS.EPSG4326,
  345. opacity: 0.6,
  346. zIndex: 2//海图永远在底图的上一层
  347. }
  348. }*/
  349. ]
  350. };
  351. //互联网,高德地图配置
  352. var mapConfig_3857 =
  353. {
  354. //辖区坐标地址
  355. xq_url: "http://59.212.37.22/ime-cloud/rest/ADMI_DIVI_A/feature/0/query?where=datacode='{{datacode}}'",
  356. option: {
  357. crs: 'EPSG3857',
  358. center: { lon: 109.72898, lat: 19.183274 },
  359. zoom: 8,
  360. zoomControl: false,
  361. attributionControl: false,
  362. inertiaDeceleration: 15000,
  363. },
  364. layers: [
  365. {
  366. name: '矢量',
  367. crs: 'EPSG3857',
  368. type: 'gd',
  369. url: 'http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
  370. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/sl.png',
  371. option: {
  372. subdomains: ['1', '2', '3', '4'],
  373. // attribution: "地图"
  374. minZoom: 3, // 最小级别数
  375. maxZoom: 18, // 最大级别数
  376. // tileSize:512, //切片尺寸(宽度和高度的像素值,假设切片是正方形的)
  377. // opacity:0.4, //切片图层的透明度
  378. // tms:true, //如果此值为true,反转切片Y轴的编号(对于TMS服务需将此项打开)
  379. // attribution: '12', // 用来进行属性控制的字符串,描述了图层数据。
  380. reuseTiles: true
  381. }
  382. },
  383. {
  384. name: '影像',
  385. crs: 'EPSG3857',
  386. type: 'gd',
  387. url: 'http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
  388. imgUrl: window.EASYMAP_CONFIG.myUrl + 'map-easy-client/images/map/yx.png',
  389. option: {
  390. subdomains: ['1', '2', '3', '4'],
  391. // attribution: "地图"
  392. minZoom: 3, // 最小级别数
  393. maxZoom: 18, // 最大级别数
  394. // tileSize:512, //切片尺寸(宽度和高度的像素值,假设切片是正方形的)
  395. // opacity:0.4, //切片图层的透明度
  396. // tms:true, //如果此值为true,反转切片Y轴的编号(对于TMS服务需将此项打开)
  397. // attribution: '12', // 用来进行属性控制的字符串,描述了图层数据。
  398. reuseTiles: true
  399. },
  400. subLayer: [
  401. {
  402. name: '标记',
  403. url: 'http://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}',
  404. type: 'gd',
  405. option: {
  406. subdomains: ['1', '2', '3', '4'],
  407. // attribution: "地图"
  408. minZoom: 3, // 最小级别数
  409. maxZoom: 18, // 最大级别数
  410. // tileSize:512, //切片尺寸(宽度和高度的像素值,假设切片是正方形的)
  411. // opacity:0.4, //切片图层的透明度
  412. // tms:true, //如果此值为true,反转切片Y轴的编号(对于TMS服务需将此项打开)
  413. // attribution: '12', // 用来进行属性控制的字符串,描述了图层数据。
  414. reuseTiles: true
  415. }
  416. }
  417. ]
  418. },
  419. ],
  420. overlayMaps: []
  421. };
  422. // 请引入JQ
  423. //window.EASYMAP_CONFIG['mapConfigName'] = window.SITE_CONFIG['mapConfigName'] || 'mapConfig_3857'; // 高德地图
  424. window.EASYMAP_CONFIG['mapConfigName'] = window.SITE_CONFIG['mapConfigName'] || 'mapConfig_4326'; // 测绘局地图
  425. //window.EASYMAP_CONFIG['poihost'] = window.SITE_CONFIG['poihost'] || 'http://124.225.17.80:8120/sgyztapi'; // 互联网接口地址
  426. window.EASYMAP_CONFIG['poihost'] = window.SITE_CONFIG['poihost'] || 'http://10.110.35.104:80'; // 政务外网接口地址
  427. // 如需使用其他接口地址,请自行配置
  428. (function (window, document, undefined) {
  429. document.write('<link rel="stylesheet" href="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/leaflet.css" />');
  430. document.write('<link rel="stylesheet" href="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/leaflet-geoman.css" />');
  431. document.write('<link rel="stylesheet" href="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/leaflet-easy.css" />');
  432. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/map-easy-client.js"></script>');
  433. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/poi.js"></script>');
  434. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/FormatTime.js"></script>');
  435. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/leaflet-src.js"></script>');
  436. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/tileLayer.wmts.js"></script>');
  437. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/CustomWebSDK.min.js"></script>');
  438. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/hnCityTree.js"></script>');
  439. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/leaflet-omnivore.min.js"></script>');
  440. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/leaflet-geoman.min.js"></script>');
  441. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/tileLayer.wmts.poi.js"></script>');
  442. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/tileLayer.wmts.realtime.js"></script>');
  443. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/titleLayer.wmts.realtime.zt.js"></script>');
  444. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/layer.yj.js"></script>');
  445. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/MovingMarker.js"></script>');
  446. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/MovingMarker.zt.js"></script>');
  447. document.write('<script src="' + window.EASYMAP_CONFIG.myUrl + 'map-easy-client/realtime.js"></script>');
  448. }(window, document));