diff --git a/src/platforms/h5/view/components/map/map-marker.js b/src/platforms/h5/view/components/map/map-marker.js index 63e35e282458eae3be5a8fe50a28fb6cb9c29e2a..c633872495dcc7b20686f7e0f793687ad88d97df 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