4.0.0-beta.4

This commit is contained in:
Xiaoji Chen 2018-10-31 18:16:07 -07:00
parent 0b127414d1
commit fb2fe2bac2
5 changed files with 16 additions and 13 deletions

View File

@ -2,6 +2,13 @@
# Version 4.0.0 Prereleases
## 4.0.0-beta.4 (Oct 31, 2018)
- Add support for Create React App access token environment variable (#633)
- Upgrade function ref to createRef (#637)
- API audit (#638)
- Do not call onResize during render (#643)
## 4.0.0-beta.3 (Oct 24, 2018)
- Fix render error when using `viewState` instead of flat props (#632)

View File

@ -1,7 +1,7 @@
{
"name": "react-map-gl",
"description": "A React wrapper for MapboxGL-js and overlay API.",
"version": "4.0.0-beta.3",
"version": "4.0.0-beta.4",
"keywords": [
"mapbox",
"mapbox-gl",
@ -44,7 +44,7 @@
"@babel/runtime": "^7.0.0",
"mapbox-gl": "~0.50.0",
"math.gl": "^2.0.0",
"mjolnir.js": "^2.0.0-alpha.2",
"mjolnir.js": "^2.0.0",
"prop-types": "^15.5.7",
"react-virtualized-auto-sizer": "^1.0.2",
"viewport-mercator-project": "^6.0.0"

View File

@ -192,8 +192,7 @@ export default class InteractiveMap extends PureComponent {
_setControllerProps(props) {
props = Object.assign({}, props, props.viewState, {
isInteractive: Boolean(props.onViewStateChange ||
props.onViewportChange || props.onChangeViewport),
isInteractive: Boolean(props.onViewStateChange || props.onViewportChange),
onViewportChange: this._onViewportChange,
onStateChange: this._onInteractionStateChange,
eventManager: this._eventManager,
@ -243,8 +242,7 @@ export default class InteractiveMap extends PureComponent {
}
_onViewportChange = (viewState, interactionState, oldViewState) => {
const onViewStateChange = this.props.onViewStateChange;
const onViewportChange = this.props.onViewportChange || this.props.onChangeViewport;
const {onViewStateChange, onViewportChange} = this.props;
if (onViewStateChange) {
onViewStateChange({viewState, interactionState, oldViewState});

View File

@ -53,9 +53,7 @@ export default class NavigationControl extends BaseControl {
this.props.onViewStateChange({viewState});
// Call old style callback
// TODO(deprecate): remove this check when `onChangeViewport` gets deprecated
const onViewportChange = this.props.onChangeViewport || this.props.onViewportChange;
onViewportChange(viewState);
this.props.onViewportChange(viewState);
}
_onZoomIn = () => {

View File

@ -6159,10 +6159,10 @@ mixin-deep@^1.2.0:
for-in "^1.0.2"
is-extendable "^1.0.1"
mjolnir.js@^2.0.0-alpha.1:
version "2.0.0-alpha.1"
resolved "https://registry.yarnpkg.com/mjolnir.js/-/mjolnir.js-2.0.0-alpha.1.tgz#5721f7864cf33d3e2aa5828659a28fcd1b2f8197"
integrity sha512-AQk4H9p8FI4R7SYtNzcYqiCPxhHjI39BRfNbF4RxZKabx1PZ5hcf1dSmu6v1jmWRI2QqY+ek1MqsGXd1qOc81Q==
mjolnir.js@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mjolnir.js/-/mjolnir.js-2.0.0.tgz#8475d2fb3b09780dbff122f245c6b3ddc46fc41e"
integrity sha512-2OfO77sNbPBlPl3ptU/EdDA/f482C/WunbDPkQyUmqkxGi88qQyvSEyxWGWV3Zw5RAHrWzLx1rH6htTFkzaOKg==
dependencies:
"@babel/runtime" "^7.0.0"
hammerjs "^2.0.8"