@mapgis/webclient-leaflet-plugin 17.0.2 → 17.0.4

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.
@@ -80,6 +80,7 @@
80
80
  <span class="param-type">Object</span>
81
81
 
82
82
 
83
+
83
84
 
84
85
  </td>
85
86
 
@@ -105,6 +106,7 @@
105
106
  <span class="param-type">HTMLElement</span>
106
107
 
107
108
 
109
+
108
110
 
109
111
  </td>
110
112
 
@@ -127,6 +129,7 @@
127
129
  <span class="param-type">String</span>
128
130
 
129
131
 
132
+
130
133
 
131
134
  </td>
132
135
 
@@ -149,6 +152,7 @@
149
152
  <span class="param-type">Boolean</span>
150
153
 
151
154
 
155
+
152
156
 
153
157
  </td>
154
158
 
@@ -174,6 +178,7 @@
174
178
  <span class="param-type">SceneView</span>
175
179
 
176
180
 
181
+
177
182
 
178
183
  </td>
179
184
 
@@ -76,6 +76,7 @@
76
76
  <span class="param-type">Object</span>
77
77
 
78
78
 
79
+
79
80
 
80
81
  </td>
81
82
 
@@ -98,6 +99,7 @@
98
99
  <span class="param-type">String</span>
99
100
 
100
101
 
102
+
101
103
 
102
104
  </td>
103
105
 
@@ -123,6 +125,7 @@
123
125
  <span class="param-type">SceneView</span>
124
126
 
125
127
 
128
+
126
129
 
127
130
  </td>
128
131
 
@@ -741,6 +741,7 @@
741
741
  <span class="param-type">Object</span>
742
742
 
743
743
 
744
+
744
745
 
745
746
  </td>
746
747
 
@@ -763,6 +764,7 @@
763
764
  <span class="param-type">String</span>
764
765
 
765
766
 
767
+
766
768
 
767
769
  </td>
768
770
 
@@ -785,6 +787,7 @@
785
787
  <span class="param-type">Feature</span>
786
788
 
787
789
 
790
+
788
791
 
789
792
  </td>
790
793
 
@@ -807,6 +810,7 @@
807
810
  <span class="param-type">Object</span>
808
811
 
809
812
 
813
+
810
814
 
811
815
  </td>
812
816
 
@@ -10,6 +10,31 @@ function toggleLinkDetail(id) {
10
10
  _dom.style.display = _dom.style.display === 'block' ? 'none' : 'block'
11
11
  }
12
12
 
13
+ function getTypeHTML(e) {
14
+ var link = e.target.getAttribute('link')
15
+ var goto = e.target.getAttribute('goto')
16
+ const _baseUrl = getBaseUrl(window.location.href)
17
+ fetch(_baseUrl + '/' + link, {
18
+ method: 'GET',
19
+ })
20
+ .then(response => response.text())
21
+ .then(data => {
22
+ const _contentDom = document.getElementById('main-content')
23
+ if (_contentDom) {
24
+ _contentDom.innerHTML = data
25
+ gotoTop(goto)
26
+ }
27
+ })
28
+ .catch(error => console.error('Error:', error))
29
+ }
30
+
31
+ function gotoTop(id) {
32
+ id = id || 'main-content'
33
+ const _aDom = document.createElement('a');
34
+ _aDom.href = '#' + id
35
+ _aDom.click()
36
+ }
37
+
13
38
  function getBaseUrl(url) {
14
39
  const regex1 = /^(http:|https:)\/\/[0-9a-zA-Z.]+:[0-9]+/
15
40
  const regex2 = /^(http:|https:)\/\/[0-9a-zA-Z.]+/
@@ -38,6 +63,7 @@ function getBaseUrl(url) {
38
63
  const _contentDom = document.getElementById('main-content')
39
64
  if (_contentDom) {
40
65
  _contentDom.innerHTML = data
66
+ gotoTop()
41
67
  }
42
68
  })
43
69
  .catch(error => console.error('Error:', error))
@@ -55,9 +81,7 @@ function getBaseUrl(url) {
55
81
  const _contentDom = document.getElementById('main-content')
56
82
  if (_contentDom) {
57
83
  _contentDom.innerHTML = data
58
- const _aDom = document.createElement('a');
59
- _aDom.href = e.target.attributes[0].value
60
- _aDom.click()
84
+ gotoTop()
61
85
  }
62
86
  })
63
87
  .catch(error => console.error('Error:', error))
@@ -76,9 +100,7 @@ function getBaseUrl(url) {
76
100
  const _contentDom = document.getElementById('main-content')
77
101
  if (_contentDom) {
78
102
  _contentDom.innerHTML = data
79
- const _aDom = document.createElement('a');
80
- _aDom.href = e.target.attributes[0].value
81
- _aDom.click()
103
+ gotoTop()
82
104
  }
83
105
  })
84
106
  .catch(error => console.error('Error:', error))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapgis/webclient-leaflet-plugin",
3
- "version" : "17.0.2",
3
+ "version" : "17.0.4",
4
4
  "description": "",
5
5
  "main": "dist/webclient-leaflet-plugin-es6.min.js",
6
6
  "scripts": {},