(props: MapboxProps)
| 222 | } |
| 223 | |
| 224 | setProps(props: MapboxProps) { |
| 225 | const oldProps = this.props; |
| 226 | this.props = props; |
| 227 | |
| 228 | const settingsChanged = this._updateSettings(props, oldProps); |
| 229 | const sizeChanged = this._updateSize(props); |
| 230 | const viewStateChanged = this._updateViewState(props, true); |
| 231 | this._updateStyle(props, oldProps); |
| 232 | this._updateStyleComponents(props, oldProps); |
| 233 | this._updateHandlers(props, oldProps); |
| 234 | |
| 235 | // If 1) view state has changed to match props and |
| 236 | // 2) the props change is not triggered by map events, |
| 237 | // it's driven by an external state change. Redraw immediately |
| 238 | if (settingsChanged || sizeChanged || (viewStateChanged && !this._map.isMoving())) { |
| 239 | this.redraw(); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | static reuse(props: MapboxProps, container: HTMLDivElement): Mapbox { |
| 244 | const that = Mapbox.savedMaps.pop(); |
no test coverage detected