web-component-gallery 0.1.25 → 0.1.27
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/package.json +1 -1
- package/plugins/method/AMap.js +13 -9
- package/plugins/utils/PostMessage.js +12 -10
package/package.json
CHANGED
package/plugins/method/AMap.js
CHANGED
|
@@ -70,15 +70,16 @@ export default {
|
|
|
70
70
|
let image = new Image()
|
|
71
71
|
image.src = IconUrl
|
|
72
72
|
image.onload = function() {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
return new AMap.Size( image.width, image.height )
|
|
74
|
+
}
|
|
75
|
+
const size = image.onload()
|
|
76
|
+
console.log(size)
|
|
77
|
+
return new AMap.Icon({
|
|
78
|
+
size,
|
|
79
|
+
image: IconUrl,
|
|
80
|
+
imageSize: size,
|
|
81
|
+
imageOffset: new AMap.Pixel( 0,0 )
|
|
82
|
+
})
|
|
82
83
|
// const size = new AMap.Size( image.width, image.height )
|
|
83
84
|
// return new AMap.Icon({
|
|
84
85
|
// size,
|
|
@@ -209,6 +210,9 @@ export default {
|
|
|
209
210
|
// 获取实时路况信息
|
|
210
211
|
}
|
|
211
212
|
|
|
213
|
+
/** 判断点及面之间的关系(例:点是否再面中 */
|
|
214
|
+
// function
|
|
215
|
+
|
|
212
216
|
/** 轨迹动画 */
|
|
213
217
|
/**
|
|
214
218
|
*
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import notification from 'ant-design-vue/es/notification'
|
|
2
2
|
|
|
3
|
+
/* 抛出401错误码 用于处理不同项目下处理方式 */
|
|
4
|
+
export function errorMessage(status, { msg }, callBack = () => {}) {
|
|
5
|
+
/* 200为正常状态码 捕捉到直接返回 */
|
|
6
|
+
if(status === 200) return
|
|
7
|
+
if(status === 401) return callBack()
|
|
8
|
+
notification.error({
|
|
9
|
+
message: '请求失败!',
|
|
10
|
+
description: msg || '服务器请求失败'
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
export default {
|
|
4
|
-
|
|
5
|
-
errorMessage(status, { msg }, callBack = () => {}) {
|
|
6
|
-
/* 200为正常状态码 捕捉到直接返回 */
|
|
7
|
-
if(status === 200) return
|
|
8
|
-
if(status === 401) return callBack()
|
|
9
|
-
notification.error({
|
|
10
|
-
message: '请求失败!',
|
|
11
|
-
description: msg || '服务器请求失败'
|
|
12
|
-
})
|
|
13
|
-
}
|
|
15
|
+
errorMessage
|
|
14
16
|
}
|