From 3d8e2c20511bb1ec1e0b249f2110704cb8d147b3 Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 5 Nov 2021 11:13:38 +0800 Subject: [PATCH] fix: Marker.iconPath error log --- src/platforms/h5/view/components/map/map-marker.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platforms/h5/view/components/map/map-marker.js b/src/platforms/h5/view/components/map/map-marker.js index 63e35e282..c63387249 100644 --- a/src/platforms/h5/view/components/map/map-marker.js +++ b/src/platforms/h5/view/components/map/map-marker.js @@ -232,7 +232,11 @@ export default { } } } - img.src = getRealPath(option.iconPath) + if (option.iconPath) { + img.src = getRealPath(option.iconPath) + } else { + console.error('Marker.iconPath is required.') + } }, removeMarker () { const marker = this._marker -- GitLab