(nextProps: MapboxProps, currProps: MapboxProps)
| 513 | @returns {bool} true if anything is changed |
| 514 | */ |
| 515 | _updateStyleComponents(nextProps: MapboxProps, currProps: MapboxProps): boolean { |
| 516 | const map = this._map; |
| 517 | let changed = false; |
| 518 | if (map.isStyleLoaded()) { |
| 519 | if ('light' in nextProps && map.setLight && !deepEqual(nextProps.light, currProps.light)) { |
| 520 | changed = true; |
| 521 | map.setLight(nextProps.light); |
| 522 | } |
| 523 | if ('fog' in nextProps && map.setFog && !deepEqual(nextProps.fog, currProps.fog)) { |
| 524 | changed = true; |
| 525 | map.setFog(nextProps.fog); |
| 526 | } |
| 527 | if ( |
| 528 | 'terrain' in nextProps && |
| 529 | map.setTerrain && |
| 530 | !deepEqual(nextProps.terrain, currProps.terrain) |
| 531 | ) { |
| 532 | if (!nextProps.terrain || map.getSource(nextProps.terrain.source)) { |
| 533 | changed = true; |
| 534 | map.setTerrain(nextProps.terrain); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | return changed; |
| 539 | } |
| 540 | |
| 541 | /* Update interaction handlers to match props |
| 542 | @param {object} nextProps |
no test coverage detected