| 468 | @returns {bool} true if anything is changed |
| 469 | */ |
| 470 | _updateSettings(nextProps: MapboxProps, currProps: MapboxProps): boolean { |
| 471 | const map = this._map; |
| 472 | let changed = false; |
| 473 | for (const propName of settingNames) { |
| 474 | const propPresent = propName in nextProps || propName in currProps; |
| 475 | |
| 476 | if (propPresent && !deepEqual(nextProps[propName], currProps[propName])) { |
| 477 | changed = true; |
| 478 | const nextValue = propName in nextProps ? nextProps[propName] : DEFAULT_SETTINGS[propName]; |
| 479 | const setter = map[`set${propName[0].toUpperCase()}${propName.slice(1)}`]; |
| 480 | setter?.call(map, nextValue); |
| 481 | } |
| 482 | } |
| 483 | return changed; |
| 484 | } |
| 485 | |
| 486 | /* Update map style to match props |
| 487 | @param {object} nextProps |