From e5344e37d43af9862fbd6b608512fb42b380a88c Mon Sep 17 00:00:00 2001 From: qiang Date: Fri, 5 Nov 2021 11:15:10 +0800 Subject: [PATCH] fix: Marker.iconPath error log --- packages/uni-h5/dist/uni-h5.cjs.js | 6 +++++- packages/uni-h5/dist/uni-h5.es.js | 6 +++++- packages/uni-h5/src/view/components/map/MapMarker.tsx | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/uni-h5/dist/uni-h5.cjs.js b/packages/uni-h5/dist/uni-h5.cjs.js index 9af022318..f0f33a63c 100644 --- a/packages/uni-h5/dist/uni-h5.cjs.js +++ b/packages/uni-h5/dist/uni-h5.cjs.js @@ -7919,7 +7919,11 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({ } } }; - img.src = getRealPath(option.iconPath); + if (option.iconPath) { + img.src = getRealPath(option.iconPath); + } else { + console.error("Marker.iconPath is required."); + } } function addMarker(props3) { marker = new maps.Marker({ diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index a80ca6bfa..ba6b17287 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -15332,7 +15332,11 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({ } } }; - img.src = getRealPath(option.iconPath); + if (option.iconPath) { + img.src = getRealPath(option.iconPath); + } else { + console.error("Marker.iconPath is required."); + } } function addMarker(props3) { marker = new maps2.Marker({ diff --git a/packages/uni-h5/src/view/components/map/MapMarker.tsx b/packages/uni-h5/src/view/components/map/MapMarker.tsx index 9a5915f63..35312b45f 100644 --- a/packages/uni-h5/src/view/components/map/MapMarker.tsx +++ b/packages/uni-h5/src/view/components/map/MapMarker.tsx @@ -254,7 +254,11 @@ export default /*#__PURE__*/ defineSystemComponent({ } } } - img.src = getRealPath(option.iconPath) + if (option.iconPath) { + img.src = getRealPath(option.iconPath) + } else { + console.error('Marker.iconPath is required.') + } } function addMarker(props: Props) { marker = new maps.Marker({ -- GitLab