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

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

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