提交 4817e1b0 编写于 作者: Q qiang

fix: map -> marker -> callout style (question/133590)

上级 6815e67f
......@@ -131,7 +131,7 @@ export default {
w = img.width / 2
h = img.height / 2
}
const top = h - (h - y)
const top = h - (h - y * h)
if ('MarkerImage' in maps) {
icon = new maps.MarkerImage(
img.src,
......@@ -189,6 +189,7 @@ export default {
let callout = marker.callout
let calloutStyle
if (calloutOpt.content || title) {
const boxShadow = '0px 0px 3px 1px rgba(0,0,0,0.5)'
calloutStyle = calloutOpt.content
? {
position,
......@@ -200,7 +201,7 @@ export default {
borderRadius: calloutOpt.borderRadius,
bgColor: calloutOpt.bgColor,
padding: calloutOpt.padding,
boxShadow: calloutOpt.boxShadow,
boxShadow: calloutOpt.boxShadow || boxShadow,
display: calloutOpt.display
}
: {
......@@ -208,7 +209,7 @@ export default {
map,
top,
content: title,
boxShadow: '0px 0px 3px 1px rgba(0,0,0,0.5)'
boxShadow: boxShadow
}
if (callout) {
callout.setOption(calloutStyle)
......
......@@ -107,6 +107,11 @@ export function createCallout (maps) {
destroy = onRemove
}
Callout.prototype = overlay
const prototype = Callout.prototype
for (const key in overlay) {
if (!(key in prototype)) {
prototype[key] = overlay[key]
}
}
return Callout
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册