(props: Partial<MapProps>)
| 39 | } |
| 40 | |
| 41 | setProps(props: Partial<MapProps>) { |
| 42 | const oldProps = this.props; |
| 43 | const newProps = {...this.props, ...props}; |
| 44 | this.props = newProps; |
| 45 | |
| 46 | if (!this.map) { |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | const needsRedraw = this._update(oldProps, newProps); |
| 51 | |
| 52 | if (needsRedraw) { |
| 53 | this.redraw(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // Force redraw the map now. Typically resize() and jumpTo() is reflected in the next |
| 58 | // render cycle, which is managed by Mapbox's animation loop. |