Fix crash when viewState does not contain pitch or bearing (#671)

This commit is contained in:
Xiaoji Chen 2018-12-04 15:39:50 -08:00 committed by GitHub
parent 556e63bb83
commit fadff6a3e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -385,8 +385,8 @@ export default class Mapbox {
longitude,
latitude,
zoom,
pitch,
bearing,
pitch = 0,
bearing = 0,
altitude = 1.5
} = props.viewState || props;
return {longitude, latitude, zoom, pitch, bearing, altitude};