diff --git a/src/layer/render/heatmap/heatmap.js b/src/layer/render/heatmap/heatmap.js index 2a5bf555d5..86511d34af 100644 --- a/src/layer/render/heatmap/heatmap.js +++ b/src/layer/render/heatmap/heatmap.js @@ -68,7 +68,7 @@ function copyPass(layer) { const style = layer.get('styleOptions'); const material = new HeatmapColorizeMaterial({ u_rampColors: layer.rampColors, - u_opacity: style.opacity + u_opacity: style.opacity || 1.0 }, {}); const copyPass = new ShaderPass(material, 'u_texture'); return copyPass; diff --git a/src/map/AMap.js b/src/map/AMap.js index d5bf7aae89..aa7a1a1719 100644 --- a/src/map/AMap.js +++ b/src/map/AMap.js @@ -38,15 +38,17 @@ export default class GaodeMap extends Base { initMap() { const mapStyle = this.get('mapStyle'); - switch (mapStyle) { - case 'dark': - this.set('mapStyle', Theme.DarkTheme.mapStyle); - break; - case 'light': - this.set('mapStyle', Theme.LightTheme.mapStyle); - break; - default: - this.set('mapStyle', mapStyle); + if (mapStyle) { + switch (mapStyle) { + case 'dark': + this.set('mapStyle', Theme.DarkTheme.mapStyle); + break; + case 'light': + this.set('mapStyle', Theme.LightTheme.mapStyle); + break; + default: + this.set('mapStyle', mapStyle); + } } this.set('zooms', [ this.get('minZoom'), this.get('maxZoom') ]); const map = this.get('map');