diff --git a/src/platforms/h5/view/components/map/map-marker.js b/src/platforms/h5/view/components/map/map-marker.js index 3d47d00f48a521ab6edd618c1d883c38f2e10acc..63e35e282458eae3be5a8fe50a28fb6cb9c29e2a 100644 --- a/src/platforms/h5/view/components/map/map-marker.js +++ b/src/platforms/h5/view/components/map/map-marker.js @@ -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) diff --git a/src/platforms/h5/view/components/map/maps/callout.js b/src/platforms/h5/view/components/map/maps/callout.js index 3e9f81327b62cc89aa63a1d4a071356635d6d581..5d7a8fa54e4d2ba0346b81090d55ed01b82eade6 100644 --- a/src/platforms/h5/view/components/map/maps/callout.js +++ b/src/platforms/h5/view/components/map/maps/callout.js @@ -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 }