@ohuoy/easymap 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+ <title>easymap</title>
8
+ <style>
9
+ /* 隐藏logo */
10
+ .l7-control-logo {
11
+ display: none;
12
+ }
13
+ </style>
14
+ <script defer src="./bundle.js"></script>
15
+ <script>
16
+ console.log(window.EasyMAP)
17
+ let airplane = './airplane.svg'
18
+ let alarm ='./alarm.svg'
19
+
20
+ const p1 = {
21
+ center:[116.778446,36.546235],
22
+ imgList:['http://124.133.246.59:13395/scan/image/20240612/WHXFZ_420100_03_02_20240612173813_7_2@557_90.3_500_6_0@.png',
23
+ 'http://124.133.246.59:13395/scan/image/20240612/WHXFZ_420100_03_02_20240612174645_7_2@557_90.3_500_6_0@.png',
24
+
25
+ ]
26
+ }
27
+
28
+ const p2 = {
29
+ center:[116.53824,36.550764],
30
+ imgList:['http://124.133.246.59:13395/scan/image/20240612/CQWCS_370102_04_02_20240612163054_304_2@694_90_500_6_0@.png']
31
+ }
32
+ window.onload = function(){
33
+ let target = document.getElementById('test')
34
+ let easyMap = new EasyMap(target,'http://dbcenter.gyquantum.com/easymap/styles/osm', {
35
+ callback:(emap)=>{
36
+ emap.addScale()
37
+ emap.addNav()
38
+ emap.addToorbars({
39
+ location:{
40
+ show:true,
41
+ center:[116.778446,36.546235]
42
+ }
43
+ });
44
+
45
+ let _canLayer = new EmComponents.ScanLayer('scanimage');
46
+ let _ly = emap.map.getLayer('scanimage');
47
+ if(!_ly){
48
+ emap.map.addLayer(_canLayer);
49
+ }
50
+ console.log(_canLayer)
51
+ let _index = 0
52
+ //绘图
53
+ setInterval(()=>{
54
+ emap.map.loadImage(p1.imgList[_index],(error,image)=>{
55
+ _canLayer.drawList({
56
+ id:'SD01',
57
+ image:image,
58
+ coords:EmUtils.getLayerMapPosition(6,p1.center)
59
+ })
60
+ _index = _index == 0 ? 1:0;
61
+ //_ly.render()
62
+ })
63
+ },1000)
64
+
65
+ emap.map.loadImage(p2.imgList[0],(error,image)=>{
66
+ _canLayer.drawList({
67
+ id:'SD02',
68
+ image:image,
69
+ coords:EmUtils.getLayerMapPosition(6,p2.center)
70
+ })
71
+ })
72
+
73
+ emap.updateLabels([{
74
+ name:'测试站点01显示',
75
+ icon:'mdiAtomVariant',
76
+ coords:[116.778446,36.546235]
77
+ },{
78
+ name:'测试站点02显示',
79
+ icon:'mdiAtomVariant',
80
+ coords:[116.768446,36.586235]
81
+ },{
82
+ name:'测试站点03显示',
83
+ icon:'mdiAtomVariant',
84
+ coords:[116.378446,36.546235]
85
+ }])
86
+
87
+ new EmComponents.EasyMapMarker({
88
+ id:'test',
89
+ position:[116.778446,36.546235],
90
+ map:emap.map
91
+ })
92
+ emap.addContextMenu([{
93
+ type:'title',
94
+ content:'标题'
95
+ },
96
+ {
97
+ type:'line'
98
+ },{
99
+ type:'btn',
100
+ content:'按钮1无操作'
101
+ },{
102
+ type:'btn',
103
+ content:'按钮2显示经纬度',
104
+ iconPre:airplane,//图片地址
105
+ iconApp:alarm,
106
+ event:{
107
+ type:'click',
108
+ fun:function(e,mape){
109
+ //e 点击事件 mape 地图事件
110
+ console.log(e,mape)
111
+ let lnglat = mape.lngLat
112
+ //结构与contextmenu 相同
113
+ emap.addDialog([{
114
+ type:'text',
115
+ content:'测试显示'
116
+ }],lnglat)
117
+ console.log(lnglat)
118
+
119
+ }
120
+ }
121
+ },{
122
+ type:'text',
123
+ content:'这是一段文本信息,进用来表述事情,仅仅用来展示,使用 $lng$ 来代替经度 $lat$ 代替纬度'
124
+ },{
125
+ type:'image',
126
+ width:140,
127
+ height:'100px',
128
+ content:'https://pic.netbian.com/uploads/allimg/240611/234734-171812085434af.jpg'
129
+
130
+ }])
131
+ }
132
+ })
133
+ window.easyMap = easyMap
134
+ }
135
+
136
+ function exportGif() {
137
+ let easyMap = window.easyMap
138
+ //也可以导出图片列表'flie' dataurl 结构图 'obj' 图片压缩包 'zip'
139
+ easyMap.getMapImageWithScan([116.778446,36.546235],6,p1.imgList,null,'gif')
140
+ }
141
+ </script>
142
+ </head>
143
+ <body>
144
+ <button onclick="exportGif()" style="z-index: 100;position: absolute;">导出gif</button>
145
+ <div id="test">
146
+
147
+ </div>
148
+ <!-- built files will be auto injected -->
149
+ </body>
150
+ </html>
package/index.html ADDED
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+ <title>easymap</title>
8
+ </head>
9
+ <body>
10
+ <div></div>
11
+ <!-- built files will be auto injected -->
12
+ </body>
13
+ </html>