web-component-gallery 0.1.22 → 0.1.23
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 +9 -4
package/package.json
CHANGED
package/plugins/method/AMap.js
CHANGED
|
@@ -42,6 +42,7 @@ export default {
|
|
|
42
42
|
|
|
43
43
|
/** 常用覆盖物 */
|
|
44
44
|
Vue.prototype.$amapLayers = {
|
|
45
|
+
setIcon,
|
|
45
46
|
setMarker,
|
|
46
47
|
setInfoWindow,
|
|
47
48
|
// setPolygon
|
|
@@ -64,19 +65,23 @@ export default {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
// 常用覆盖物形式方法
|
|
67
|
-
/**
|
|
68
|
-
function
|
|
68
|
+
/** 生成ICON */
|
|
69
|
+
function setIcon(IconUrl) {
|
|
69
70
|
let image = new Image()
|
|
70
71
|
image.src = IconUrl
|
|
71
72
|
const size = new AMap.Size( image.width, image.height )
|
|
72
|
-
|
|
73
|
+
return new AMap.Icon({
|
|
73
74
|
size,
|
|
74
75
|
image: IconUrl,
|
|
75
76
|
imageSize: size,
|
|
76
77
|
imageOffset: new AMap.Pixel( 0,0 )
|
|
77
78
|
})
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** 地图标点 */
|
|
82
|
+
function setMarker(IconUrl, MarkerOptions) {
|
|
78
83
|
return new AMap.Marker({
|
|
79
|
-
icon,
|
|
84
|
+
icon: setIcon(IconUrl),
|
|
80
85
|
offset: new AMap.Pixel(0, 0),
|
|
81
86
|
anchor: 'bottom-center',
|
|
82
87
|
...MarkerOptions
|