@mapgis/webclient-mapboxgl-plugin 17.0.0 → 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.
- package/README.md +243 -89
- package/dist/es5/webclient-common.min.js +4 -4
- package/dist/es5/webclient-mapboxgl-plugin.min.js +1 -1
- package/dist/webclient-mapboxgl-plugin-es6.min.js +1 -1
- package/documention/EchartsLayer.html +8 -177
- package/documention/MapViewMapboxgl.html +77 -193
- package/documention/Popup.html +40 -189
- package/documention/Screenshot.html +19 -185
- package/documention/SketchEditorMapboxgl.html +57 -195
- package/documention/global.html +7 -178
- package/documention/index.html +6 -6
- package/documention/module-%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%8F%AF%E8%A7%86%E5%8C%96.MapvLayer.html +10 -178
- package/documention/scripts/sideBar.js +98 -0
- package/documention/styles/app.min.css +1 -1
- package/documention/tutorial-1./345/277/253/351/200/237/345/205/245/351/227/250.html +7 -155
- package/package.json +1 -1
|
@@ -9,3 +9,101 @@ function toggleLinkDetail(id) {
|
|
|
9
9
|
_arrow.style.transform = _dom.style.display === 'block' ? 'rotate(360deg)' : 'rotate(180deg)'
|
|
10
10
|
_dom.style.display = _dom.style.display === 'block' ? 'none' : 'block'
|
|
11
11
|
}
|
|
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
|
+
|
|
38
|
+
function getBaseUrl(url) {
|
|
39
|
+
const regex1 = /^(http:|https:)\/\/[0-9a-zA-Z.]+:[0-9]+/
|
|
40
|
+
const regex2 = /^(http:|https:)\/\/[0-9a-zA-Z.]+/
|
|
41
|
+
let match = url.match(regex1)
|
|
42
|
+
if (match && match[0]) {
|
|
43
|
+
return match[0]
|
|
44
|
+
} else {
|
|
45
|
+
match = url.match(regex2)
|
|
46
|
+
if (match && match[0]) {
|
|
47
|
+
return match[0]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return ''
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
(function() {
|
|
54
|
+
const targets = [ ...document.querySelectorAll('#sidebarNav li.mapgis-link a')]
|
|
55
|
+
targets.forEach(function (_target) {
|
|
56
|
+
_target.addEventListener('click', function (e) {
|
|
57
|
+
const _baseUrl = getBaseUrl(window.location.href)
|
|
58
|
+
fetch(_baseUrl + e.target.attributes[1].value, {
|
|
59
|
+
method: 'GET',
|
|
60
|
+
})
|
|
61
|
+
.then(response => response.text())
|
|
62
|
+
.then(data => {
|
|
63
|
+
const _contentDom = document.getElementById('main-content')
|
|
64
|
+
if (_contentDom) {
|
|
65
|
+
_contentDom.innerHTML = data
|
|
66
|
+
gotoTop()
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
.catch(error => console.error('Error:', error))
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
const targets2 = [ ...document.querySelectorAll('#sidebarNav div div a#api-fold')]
|
|
73
|
+
targets2.forEach(function (_target) {
|
|
74
|
+
_target.addEventListener('click', function (e) {
|
|
75
|
+
const _baseUrl = getBaseUrl(window.location.href)
|
|
76
|
+
fetch(_baseUrl + e.target.attributes[1].value, {
|
|
77
|
+
method: 'GET',
|
|
78
|
+
})
|
|
79
|
+
.then(response => response.text())
|
|
80
|
+
.then(data => {
|
|
81
|
+
const _contentDom = document.getElementById('main-content')
|
|
82
|
+
if (_contentDom) {
|
|
83
|
+
_contentDom.innerHTML = data
|
|
84
|
+
gotoTop()
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.catch(error => console.error('Error:', error))
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const targets3 = [ ...document.querySelectorAll('#sidebarNav div div ul li a#api-member')]
|
|
92
|
+
targets3.forEach(function (_target) {
|
|
93
|
+
_target.addEventListener('click', function (e) {
|
|
94
|
+
const _baseUrl = getBaseUrl(window.location.href)
|
|
95
|
+
fetch(_baseUrl + e.target.attributes[1].value, {
|
|
96
|
+
method: 'GET',
|
|
97
|
+
})
|
|
98
|
+
.then(response => response.text())
|
|
99
|
+
.then(data => {
|
|
100
|
+
const _contentDom = document.getElementById('main-content')
|
|
101
|
+
if (_contentDom) {
|
|
102
|
+
_contentDom.innerHTML = data
|
|
103
|
+
gotoTop()
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
.catch(error => console.error('Error:', error))
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
})()
|