Skip to content

Commit

Permalink
#### 🪲 Bug fixes
Browse files Browse the repository at this point in the history
- #255 tb.updateSunGround raises an error if value is higher than
  • Loading branch information
jscastro76 committed Jan 11, 2022
1 parent 14f07dc commit ec3234d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements
- THREE.MeshPhongMaterial({ color: 0x660000, side: THREE.DoubleSide }) added as default material to extrusions

#### :beetle: Bug fixes
- #255 tb.updateSunGround raises an error if value is higher than 1.
- Multiplied also the raster-opacity by 4 to make it more realistic with the light hours
- #319 dat.gui.module has changed in threejs
- #320 Cannot read properties of undefined (reading 'appendChild')

Expand Down
2 changes: 1 addition & 1 deletion dist/threebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ Threebox.prototype = {
updateSunGround: function (sunPos) {
if (this.terrainLayerName != '') {
// update the raster layer paint property with the position of the sun based on the selected time
this.map.setPaintProperty(this.terrainLayerName, 'raster-opacity', Math.max(sunPos.altitude, 0.25));
this.map.setPaintProperty(this.terrainLayerName, 'raster-opacity', Math.max(Math.min(1, sunPos.altitude * 4), 0.25));
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/Threebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ Threebox.prototype = {
updateSunGround: function (sunPos) {
if (this.terrainLayerName != '') {
// update the raster layer paint property with the position of the sun based on the selected time
this.map.setPaintProperty(this.terrainLayerName, 'raster-opacity', Math.max(sunPos.altitude, 0.25));
this.map.setPaintProperty(this.terrainLayerName, 'raster-opacity', Math.max(Math.min(1, sunPos.altitude * 4), 0.25));
}
},

Expand Down

0 comments on commit ec3234d

Please sign in to comment.