mapboxgl-tools 0.0.1
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/.editorconfig +14 -0
- package/.env +8 -0
- package/.env.development +23 -0
- package/.eslintcache +1 -0
- package/.eslintrc.cjs +24 -0
- package/.prettierrc.json +23 -0
- package/LICENSE +22 -0
- package/README.md +69 -0
- package/dist/sfmap.min.js +65 -0
- package/dist/style.css +1 -0
- package/dist/ui.es.js +80717 -0
- package/dist/ui.umd.js +1 -0
- package/index.html +16 -0
- package/jsconfig.json +9 -0
- package/package.json +55 -0
- package/postcss.config.cjs +5 -0
- package/publish.sh +26 -0
- package/vite.config.js +119 -0
package/.editorconfig
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# http://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
end_of_line = auto
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
trim_trailing_whitespace = true
|
|
11
|
+
|
|
12
|
+
[*.md]
|
|
13
|
+
insert_final_newline = false
|
|
14
|
+
trim_trailing_whitespace = false
|
package/.env
ADDED
package/.env.development
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# just a flag
|
|
2
|
+
ENV = 'development'
|
|
3
|
+
|
|
4
|
+
# 代理的后端的路径
|
|
5
|
+
VITE_APP_DEV_PROXY_URL='http://localhost:9070'
|
|
6
|
+
VITE_APP_PUBLIC_STATIC_PATH=''
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# 前端端口
|
|
10
|
+
VITE_APP_PORT=7000
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 数管平台地址
|
|
14
|
+
VITE_APP_STDMS_URL='http://10.233.32.155:8585'
|
|
15
|
+
VITE_APP_STDMS_TREE_ID=20
|
|
16
|
+
VITE_APP_STDMS_ENV='local' # 可选值: gov | local
|
|
17
|
+
VITE_APP_STDMS_DATACENTER_URL='http://10.233.32.155:8585/stdms/service/local/directory-content/tree?rootId=20'
|
|
18
|
+
|
|
19
|
+
# sf3d地址
|
|
20
|
+
VITE_APP_SF3D_URL='http://10.99.24.11:8091/sf3d-ba/'
|
|
21
|
+
|
|
22
|
+
# search地址
|
|
23
|
+
VITE_APP_SEARCH_SERVICE_URL='http://10.233.32.39:8677'
|
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"G:\\fengtu\\admin-ui\\src\\main.js":"1","G:\\fengtu\\admin-ui\\src\\App.vue":"2","G:\\fengtu\\admin-ui\\src\\Helloworld.vue":"3","G:\\fengtu\\mapboxgl-ui\\src\\main.js":"4","G:\\fengtu\\mapboxgl-ui\\src\\App.vue":"5","G:\\fengtu\\mapboxgl-ui\\src\\Helloworld.vue":"6"},{"size":207,"mtime":1705629488877,"results":"7","hashOfConfig":"8"},{"size":418,"mtime":1705629382904,"results":"9","hashOfConfig":"8"},{"size":510,"mtime":1705915018041,"results":"10","hashOfConfig":"8"},{"size":207,"mtime":1705629488877,"results":"11","hashOfConfig":"12"},{"size":418,"mtime":1705629382904,"results":"13","hashOfConfig":"12"},{"size":3724,"mtime":1708392903337,"results":"14","hashOfConfig":"12"},{"filePath":"15","messages":"16","suppressedMessages":"17","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"15ou60z",{"filePath":"18","messages":"19","suppressedMessages":"20","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"21","messages":"22","suppressedMessages":"23","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","suppressedMessages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1uibmbb",{"filePath":"27","messages":"28","suppressedMessages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":1,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":1,"fixableWarningCount":1,"source":null},"G:\\fengtu\\admin-ui\\src\\main.js",[],[],"G:\\fengtu\\admin-ui\\src\\App.vue",[],[],"G:\\fengtu\\admin-ui\\src\\Helloworld.vue",[],[],"G:\\fengtu\\mapboxgl-ui\\src\\main.js",[],[],"G:\\fengtu\\mapboxgl-ui\\src\\App.vue",[],[],"G:\\fengtu\\mapboxgl-ui\\src\\Helloworld.vue",["33","34"],[],{"ruleId":"35","severity":1,"message":"36","line":4,"column":52,"nodeType":"37","endLine":4,"endColumn":60,"fix":"38"},{"ruleId":"39","severity":2,"message":"40","line":28,"column":37,"nodeType":null,"messageId":"41","endLine":28,"endColumn":37,"fix":"42"},"vue/attributes-order","Attribute \"id\" should go before \"style\".","VAttribute",{"range":"43","text":"44"},"prettier/prettier","Insert `·`","insert",{"range":"45","text":"46"},[87,129],"id=\"map\" style=\"width: 90%; height: 700px\"",[1113,1113]," "]
|
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true,
|
|
5
|
+
},
|
|
6
|
+
extends: ['plugin:vue/recommended', 'plugin:prettier/recommended'],
|
|
7
|
+
plugins: ['vue', 'prettier'],
|
|
8
|
+
// add your custom rules here
|
|
9
|
+
rules: {
|
|
10
|
+
indent: 'off',
|
|
11
|
+
// allow async-await
|
|
12
|
+
'generator-star-spacing': 'off',
|
|
13
|
+
// allow debugger during development
|
|
14
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
15
|
+
'prettier/prettier': ['error', { tabWidth: 4 }],
|
|
16
|
+
'vue/no-unused-vars': 'warn',
|
|
17
|
+
'vue/max-attributes-per-line': 'off',
|
|
18
|
+
'vue/singleline-html-element-content-newline': 0,
|
|
19
|
+
'vue/html-self-closing': 0,
|
|
20
|
+
'vue/attribute-hyphenation': 0,
|
|
21
|
+
'vue/multi-word-component-names': 'off',
|
|
22
|
+
},
|
|
23
|
+
parser: 'vue-eslint-parser',
|
|
24
|
+
}
|
package/.prettierrc.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"?printWidth": "每行最长长度",
|
|
3
|
+
"printWidth": 120,
|
|
4
|
+
"?tabWidth": "缩进",
|
|
5
|
+
"tabWidth": 4,
|
|
6
|
+
"?semi": "是否加分号",
|
|
7
|
+
"semi": false,
|
|
8
|
+
"?singleQuote": "格式化以单引号为主",
|
|
9
|
+
"singleQuote": true,
|
|
10
|
+
"?trailingComma": "最后一个对象加逗号 <es5|none|all> es5:在ES5中有效的尾部逗号(对象、数组等)",
|
|
11
|
+
"trailingComma": "all",
|
|
12
|
+
"?bracketSpacing": "对象,数组加空格",
|
|
13
|
+
"bracketSpacing": true,
|
|
14
|
+
"?jsxBracketSameLine": "jsx > 是否另起一行",
|
|
15
|
+
"jsxBracketSameLine": false,
|
|
16
|
+
"?arrowParens": "(x) => {} 是否要有小括号 <always|avoid> always:总是包括括号 avoid:可能时省略括号",
|
|
17
|
+
"arrowParens": "always",
|
|
18
|
+
"?requirePragma": "是否要注释来决定是否格式化代码",
|
|
19
|
+
"requirePragma": false,
|
|
20
|
+
"?proseWrap": "默认情况下,Prettier 将按原样包含 markdown 文本,因为某些服务使用对行敏感的渲染器,例如 GitHub 注释和 BitBucket。 <always|never|preserve> preserve:原样不变 never:不要换行 always:如果超过打印宽度,请换行",
|
|
21
|
+
"proseWrap": "preserve",
|
|
22
|
+
"endOfLine": "auto"
|
|
23
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Wbiokr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# mapboxgl-tools
|
|
2
|
+
> 基于mapboxgl的一些工具组件
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install mapboxgl-tools
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Modules
|
|
11
|
+
```js
|
|
12
|
+
Geoserver
|
|
13
|
+
```
|
|
14
|
+
### Geoserver
|
|
15
|
+
> 自定义栅格瓦片,记忆缓存
|
|
16
|
+
|
|
17
|
+
| Property | Type | 默认值 | Description |
|
|
18
|
+
| ----- | ------------- | ------------- | ------------------------ |
|
|
19
|
+
| map | Object | null | mapboxgl实例对象 |
|
|
20
|
+
| itemClass | String | | 单个geoserver展示class |
|
|
21
|
+
| addClass | String | | 添加按钮class |
|
|
22
|
+
| addBtnProps | Object | { type: 'primary', ghost: false, size: 'small', text: '新增图层' } | 添加按钮属性 |
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
<template>
|
|
26
|
+
<div>
|
|
27
|
+
<section style="width: 90%; height: 700px" id="map"></section>
|
|
28
|
+
<Geoservers v-if="map" :map="map" itemClass="geo-item" addClass="add-btn" />
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
import { Geoserver } from 'mapboxgl-tools'
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
components: {
|
|
37
|
+
Geoserver,
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
map: null,
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
mounted() {
|
|
45
|
+
this.map = new mapboxgl.Map({
|
|
46
|
+
container: 'map',
|
|
47
|
+
zoom: 15,
|
|
48
|
+
center: [114.26697720786854,30.63091896813168],
|
|
49
|
+
transformRequest: (url) => {
|
|
50
|
+
if (
|
|
51
|
+
url.includes('4326')
|
|
52
|
+
) {
|
|
53
|
+
url = url.toLowerCase().replace(/(bbox=)([^&]+)/, ($0, $1, $2) => {
|
|
54
|
+
let points = $2.split(',')
|
|
55
|
+
let leftLngLat = onMercatorToLnglat(points[0], points[1])
|
|
56
|
+
let rightLngLat = onMercatorToLnglat(points[2], points[3])
|
|
57
|
+
return `${$1}${leftLngLat[0]},${leftLngLat[1]},${rightLngLat[0]},${rightLngLat[1]}`
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
url,
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
</script>
|
|
69
|
+
``
|