diff --git a/package.json b/package.json index 2ebe1e80..b2d12a56 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ ], "scripts": { "start": "(cd examples/main && (path-exists node_modules || npm i) && npm run start-local)", - "clean": "rm -fr dist dist-es6 && mkdir -p dist/es5 dist/esm dist/es6", "build": "./scripts/build.sh && ./scripts/collect-metrics.sh", "publish-prod": "npm run build && npm run test && npm publish", "publish-beta": "npm run build && npm run test && npm publish --tag beta", diff --git a/scripts/build.sh b/scripts/build.sh index 6045492f..834e7f32 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,8 @@ #!/bin/sh export PATH=$PATH:node_modules/.bin +rm -fr dist + BABEL_ENV=es6 babel src --out-dir dist/es6 --source-maps --ignore 'node_modules/' && BABEL_ENV=esm babel src --out-dir dist/esm --source-maps --ignore 'node_modules/' && BABEL_ENV=es5 babel src --out-dir dist/es5 --source-maps --ignore 'node_modules/' \ No newline at end of file diff --git a/src/mapbox/mapbox.js b/src/mapbox/mapbox.js index e3538841..05891634 100644 --- a/src/mapbox/mapbox.js +++ b/src/mapbox/mapbox.js @@ -171,10 +171,10 @@ export default class Mapbox { } else { const mapOptions = { container: props.container || document.body, - center: [props.longitude, props.latitude], - zoom: props.zoom, - pitch: props.pitch, - bearing: props.bearing, + center: [0, 0], + zoom: 8, + pitch: 0, + bearing: 0, style: props.mapStyle, interactive: false, attributionControl: props.attributionControl, @@ -286,7 +286,15 @@ export default class Mapbox { } _getViewState(props) { - return props.viewState || props; + const { + longitude, + latitude, + zoom, + pitch = 0, + bearing = 0, + altitude = 1.5 + } = props.viewState || props; + return {longitude, latitude, zoom, pitch, bearing, altitude}; } }