@mapgis/webclient-leaflet-plugin 17.0.2 → 17.0.5
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.
- package/README.md +25 -1
- package/dist/es5/webclient-common.min.js +2 -2
- package/dist/es5/webclient-leaflet-plugin.min.js +2 -2
- package/dist/webclient-leaflet-plugin-es6.min.js +8 -8
- package/documention/DrawControl.html +28 -13
- package/documention/L.zondy.MapvBaseLayer.html +45 -15
- package/documention/MapViewLeaflet.html +903 -263
- package/documention/Popup.html +156 -42
- package/documention/Screenshot.html +46 -21
- package/documention/SketchEditorLeaflet.html +261 -88
- package/documention/Zondy.ThemeLayer.GeoFeatureThemeLayer.html +352 -122
- package/documention/Zondy.ThemeLayer.GraphThemeLayer.html +525 -175
- package/documention/Zondy.ThemeLayer.RandomThemeLayer.html +395 -140
- package/documention/Zondy.ThemeLayer.ThemeLayer.html +253 -78
- package/documention/Zondy.ThemeLayer.ThemeStyle.html +560 -140
- package/documention/Zondy.ThemeLayer.rangeThemeLayer.html +423 -148
- package/documention/Zondy.ThemeLayer.rankSymbolThemeLayer.html +557 -187
- package/documention/Zondy.ThemeLayer.simpleThemeLayer.html +388 -138
- package/documention/Zondy.ThemeLayer.uniqueThemeLayer.html +403 -143
- package/documention/Zondy.Widget.html +45 -12
- package/documention/Zondy.view.UI.html +26 -7
- package/documention/global.html +28 -8
- package/documention/index.html +4 -4
- package/documention/scripts/sideBar.js +133 -6
- package/documention/tutorial-2.1M3D/350/246/201/347/264/240/351/200/211/345/217/226.html +1 -1
- package/documention/tutorial-2.2M3D/351/222/273/345/255/224/345/211/226/345/210/207.html +1 -1
- package/package.json +1 -1
|
@@ -3,11 +3,87 @@ function toggleSideBar(id) {
|
|
|
3
3
|
_dom.style.display = _dom.style.display === 'block' ? 'none' : 'block'
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
function showSideBar(id) {
|
|
7
|
+
var _dom = document.getElementById(id)
|
|
8
|
+
_dom.style.display = 'block'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var lastClickClassId
|
|
12
|
+
function highLightClickClass(currentId) {
|
|
13
|
+
var _dom2 = document.getElementById(currentId)
|
|
14
|
+
_dom2.style.color = '#ffa83df5'
|
|
15
|
+
_dom2.style.fontWeight="900"
|
|
16
|
+
if (lastClickClassId && lastClickClassId !== currentId) {
|
|
17
|
+
var _dom3 = document.getElementById(lastClickClassId)
|
|
18
|
+
_dom3.style.color = '#798897'
|
|
19
|
+
_dom3.style.fontWeight="400"
|
|
20
|
+
}
|
|
21
|
+
lastClickClassId = currentId
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var lastClickClassTarget
|
|
25
|
+
function highLightClickClassByTarget(target) {
|
|
26
|
+
target.style.color = '#ffa83df5'
|
|
27
|
+
target.style.fontWeight="900"
|
|
28
|
+
if (lastClickClassTarget && lastClickClassTarget.getAttribute('title') !== target.getAttribute('title')) {
|
|
29
|
+
lastClickClassTarget.style.color = '#798897'
|
|
30
|
+
lastClickClassTarget.style.fontWeight="400"
|
|
31
|
+
}
|
|
32
|
+
lastClickClassTarget = target
|
|
33
|
+
}
|
|
34
|
+
|
|
6
35
|
function toggleLinkDetail(id) {
|
|
7
36
|
var _dom = document.getElementById(id)
|
|
8
37
|
var _arrow = document.getElementById(id + '-arrow')
|
|
9
38
|
_arrow.style.transform = _dom.style.display === 'block' ? 'rotate(360deg)' : 'rotate(180deg)'
|
|
10
39
|
_dom.style.display = _dom.style.display === 'block' ? 'none' : 'block'
|
|
40
|
+
if (_dom.style.display === 'block') {
|
|
41
|
+
highLightClickClass(id.split('-')[0])
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function showLinkDetail(id) {
|
|
46
|
+
var _dom = document.getElementById(id)
|
|
47
|
+
var _arrow = document.getElementById(id + '-arrow')
|
|
48
|
+
_arrow.style.transform = 'rotate(360deg)'
|
|
49
|
+
_dom.style.display = 'block'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getTypeHTML(e) {
|
|
53
|
+
var link = e.target.getAttribute('link')
|
|
54
|
+
var goto = e.target.getAttribute('goto')
|
|
55
|
+
const attributes = e.target.attributes
|
|
56
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
57
|
+
const { name } = attributes[i]
|
|
58
|
+
if (name.indexOf('global.html') > -1) {
|
|
59
|
+
goto = link.split('.')[0]
|
|
60
|
+
link = 'global.html'
|
|
61
|
+
break
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const _baseUrl = window.location.href.split('/index.html')[0]
|
|
65
|
+
fetch(_baseUrl + '/' + link, {
|
|
66
|
+
method: 'GET',
|
|
67
|
+
})
|
|
68
|
+
.then(response => response.text())
|
|
69
|
+
.then(data => {
|
|
70
|
+
const _contentDom = document.getElementById('main-content')
|
|
71
|
+
if (_contentDom) {
|
|
72
|
+
_contentDom.innerHTML = data
|
|
73
|
+
gotoTop(goto, getLinkName(link))
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
.catch(error => console.error('Error:', error))
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function gotoTop(id, linkName) {
|
|
80
|
+
id = id || 'main-content'
|
|
81
|
+
const _aDom = document.createElement('a');
|
|
82
|
+
_aDom.href = '#' + id
|
|
83
|
+
_aDom.click()
|
|
84
|
+
if (linkName) {
|
|
85
|
+
window.location.hash = id + '?' + linkName
|
|
86
|
+
}
|
|
11
87
|
}
|
|
12
88
|
|
|
13
89
|
function getBaseUrl(url) {
|
|
@@ -25,6 +101,11 @@ function getBaseUrl(url) {
|
|
|
25
101
|
return ''
|
|
26
102
|
}
|
|
27
103
|
|
|
104
|
+
function getLinkName(url) {
|
|
105
|
+
var urlParts = url.split('/')
|
|
106
|
+
return urlParts[urlParts.length - 1].split('.')[0]
|
|
107
|
+
}
|
|
108
|
+
|
|
28
109
|
(function() {
|
|
29
110
|
const targets = [ ...document.querySelectorAll('#sidebarNav li.mapgis-link a')]
|
|
30
111
|
targets.forEach(function (_target) {
|
|
@@ -38,6 +119,9 @@ function getBaseUrl(url) {
|
|
|
38
119
|
const _contentDom = document.getElementById('main-content')
|
|
39
120
|
if (_contentDom) {
|
|
40
121
|
_contentDom.innerHTML = data
|
|
122
|
+
var linkName = getLinkName(e.target.getAttribute('link'))
|
|
123
|
+
highLightClickClass(linkName)
|
|
124
|
+
gotoTop(undefined, linkName)
|
|
41
125
|
}
|
|
42
126
|
})
|
|
43
127
|
.catch(error => console.error('Error:', error))
|
|
@@ -55,9 +139,7 @@ function getBaseUrl(url) {
|
|
|
55
139
|
const _contentDom = document.getElementById('main-content')
|
|
56
140
|
if (_contentDom) {
|
|
57
141
|
_contentDom.innerHTML = data
|
|
58
|
-
|
|
59
|
-
_aDom.href = e.target.attributes[0].value
|
|
60
|
-
_aDom.click()
|
|
142
|
+
gotoTop(e.target.getAttribute('linkto').split('#')[1], getLinkName(e.target.getAttribute('link')))
|
|
61
143
|
}
|
|
62
144
|
})
|
|
63
145
|
.catch(error => console.error('Error:', error))
|
|
@@ -67,6 +149,7 @@ function getBaseUrl(url) {
|
|
|
67
149
|
const targets3 = [ ...document.querySelectorAll('#sidebarNav div div ul li a#api-member')]
|
|
68
150
|
targets3.forEach(function (_target) {
|
|
69
151
|
_target.addEventListener('click', function (e) {
|
|
152
|
+
highLightClickClassByTarget(e.target)
|
|
70
153
|
const _baseUrl = getBaseUrl(window.location.href)
|
|
71
154
|
fetch(_baseUrl + e.target.attributes[1].value, {
|
|
72
155
|
method: 'GET',
|
|
@@ -76,12 +159,56 @@ function getBaseUrl(url) {
|
|
|
76
159
|
const _contentDom = document.getElementById('main-content')
|
|
77
160
|
if (_contentDom) {
|
|
78
161
|
_contentDom.innerHTML = data
|
|
79
|
-
|
|
80
|
-
_aDom.href = e.target.attributes[0].value
|
|
81
|
-
_aDom.click()
|
|
162
|
+
gotoTop(e.target.getAttribute('title'), getLinkName(e.target.getAttribute('link')))
|
|
82
163
|
}
|
|
83
164
|
})
|
|
84
165
|
.catch(error => console.error('Error:', error))
|
|
85
166
|
})
|
|
86
167
|
})
|
|
87
168
|
})()
|
|
169
|
+
|
|
170
|
+
window.onload = function () {
|
|
171
|
+
var urlParts = window.location.href.split('#')
|
|
172
|
+
if (urlParts.length > 1) {
|
|
173
|
+
var id = urlParts[1].split('?')[0]
|
|
174
|
+
var linkName = urlParts[1].split('?')[1]
|
|
175
|
+
if (id && linkName) {
|
|
176
|
+
const _baseUrl = window.location.href.split('/index.html')[0]
|
|
177
|
+
fetch(_baseUrl + '/' + linkName + '.html', {
|
|
178
|
+
method: 'GET',
|
|
179
|
+
})
|
|
180
|
+
.then(response => response.text())
|
|
181
|
+
.then(data => {
|
|
182
|
+
const _contentDom = document.getElementById('main-content')
|
|
183
|
+
if (_contentDom) {
|
|
184
|
+
_contentDom.innerHTML = data
|
|
185
|
+
var modules = document.getElementsByClassName('mapgis-sidebar-menus')
|
|
186
|
+
for (var i = 0; i < modules.length; i++) {
|
|
187
|
+
if (modules[i].innerHTML.indexOf('"' + linkName + '"') > -1) {
|
|
188
|
+
showSideBar(modules[i].id)
|
|
189
|
+
var classArray = document.getElementsByClassName("mapgis-link-detail")
|
|
190
|
+
for (var j = 0; j < classArray.length; j++) {
|
|
191
|
+
if (
|
|
192
|
+
classArray[j].id === linkName + '-detail'
|
|
193
|
+
) {
|
|
194
|
+
showLinkDetail(linkName + '-detail')
|
|
195
|
+
highLightClickClass(linkName)
|
|
196
|
+
var members = document.querySelectorAll('#' + linkName + '-detail' + ' a')
|
|
197
|
+
for (var k = 0; k < members.length; k++) {
|
|
198
|
+
if (members[k].title === id) {
|
|
199
|
+
highLightClickClassByTarget(members[k])
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
break
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
break
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
gotoTop(id, linkName)
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
.catch(error => console.error('Error:', error))
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -33,7 +33,7 @@ webGlobe.viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0.001);
|
|
|
33
33
|
</code></pre>
|
|
34
34
|
<h2>图层的属性</h2>
|
|
35
35
|
<p>M3D的图层属性保持Cesium的3DTIle一致
|
|
36
|
-
<a
|
|
36
|
+
<a onclick="getTypeHTML(event)" link="https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html?classFilter=3Dtile">Cesium3DTileset</a></p>
|
|
37
37
|
<pre class="prettyprint source lang-javascript"><code>{
|
|
38
38
|
url: { type: String, required: true },
|
|
39
39
|
show: { typs: Boolean, default: true },
|
|
@@ -33,7 +33,7 @@ webGlobe.viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0.001);
|
|
|
33
33
|
</code></pre>
|
|
34
34
|
<h2>图层的属性</h2>
|
|
35
35
|
<p>M3D的图层属性保持Cesium的3DTIle一致
|
|
36
|
-
<a
|
|
36
|
+
<a onclick="getTypeHTML(event)" link="https://cesium.com/docs/cesiumjs-ref-doc/Cesium3DTileset.html?classFilter=3Dtile">Cesium3DTileset</a></p>
|
|
37
37
|
<pre class="prettyprint source lang-javascript"><code>{
|
|
38
38
|
url: { type: String, required: true },
|
|
39
39
|
show: { typs: Boolean, default: true },
|