viewport-mercator-project
Advanced tools
Comparing version 4.2.0-alpha.2 to 5.0.0-alpha.1
// Classic web-mercator-project | ||
export { default } from './flat-mercator-viewport'; | ||
export { default as FlatMercatorViewport } from './flat-mercator-viewport'; | ||
export { default as PerspectiveMercatorViewport } from './perspective-mercator-viewport'; | ||
export { default } from './web-mercator-viewport'; | ||
export { default as WebMercatorViewport } from './web-mercator-viewport'; | ||
// Legacy class name | ||
export { default as PerspectiveMercatorViewport } from './web-mercator-viewport'; | ||
export { projectFlat } from './web-mercator-utils'; | ||
export { unprojectFlat } from './web-mercator-utils'; | ||
export { getMercatorMeterZoom } from './web-mercator-utils'; | ||
export { getMercatorDistanceScales } from './web-mercator-utils'; | ||
export { getMercatorWorldPosition } from './web-mercator-utils'; | ||
export { makeViewMatricesFromMercatorParams } from './web-mercator-utils'; | ||
export { makeUncenteredViewMatrixFromMercatorParams } from './web-mercator-utils'; | ||
export { makeProjectionMatrixFromMercatorParams } from './web-mercator-utils'; | ||
export { getFov } from './web-mercator-utils'; | ||
export { getClippingPlanes } from './web-mercator-utils'; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0IiwiRmxhdE1lcmNhdG9yVmlld3BvcnQiLCJQZXJzcGVjdGl2ZU1lcmNhdG9yVmlld3BvcnQiLCJwcm9qZWN0RmxhdCIsInVucHJvamVjdEZsYXQiLCJnZXRNZXJjYXRvck1ldGVyWm9vbSIsImdldE1lcmNhdG9yRGlzdGFuY2VTY2FsZXMiLCJnZXRNZXJjYXRvcldvcmxkUG9zaXRpb24iLCJtYWtlVmlld01hdHJpY2VzRnJvbU1lcmNhdG9yUGFyYW1zIiwibWFrZVVuY2VudGVyZWRWaWV3TWF0cml4RnJvbU1lcmNhdG9yUGFyYW1zIiwibWFrZVByb2plY3Rpb25NYXRyaXhGcm9tTWVyY2F0b3JQYXJhbX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cmNhdG9yLXV0aWxzJztcbmV4cG9ydCB7dW5wcm9qZWN0RmxhdH0gZnJvbSAnLi93ZWItbWVyY2F0b3ItdXRpbHMnO1xuZXhwb3J0IHtnZXRNZXJjYXRvck1ldGVyWm9vbX0gZnJvbSAnLi93ZWItbWVyY2F0b3ItdXRpbHMnO1xuZXhwb3J0IHtnZXRNZXJjYXRvckRpc3RhbmNlU2NhbGVzfSBmcm9tICcuL3dlYi1tZXJjYXRvci11dGlscyc7XG5leHBvcnQge2dldE1lcmNhdG9yV29ybGRQb3NpdGlvbn0gZnJvbSAnLi93ZWItbWVyY2F0b3ItdXRpbHMnO1xuZXhwb3J0IHttYWtlVmlld01hdHJpY2VzRnJvbU1lcmNhdG9yUGFyYW1zfSBmcm9tICcuL3dlYi1tZXJjYXRvci11dGlscyc7XG5leHBvcnQge21ha2VVbmNlbnRlcmVkVmlld01hdHJpeEZyb21NZXJjYXRvclBhcmFtc30gZnJvbSAnLi93ZWItbWVyY2F0b3ItdXRpbHMnO1xuZXhwb3J0IHttYWtlUHJvamVjdGlvbk1hdHJpeEZyb21NZXJjYXRvclBhcmFtc30gZnJvbSAnLi93ZWItbWVyY2F0b3ItdXRpbHMnO1xuZXhwb3J0IHtnZXRGb3Z9IGZyb20gJy4vd2ViLW1lcmNhdG9yLXV0aWxzJztcbmV4cG9ydCB7Z2V0Q2xpcHBpbmdQbGFuZXN9IGZyb20gJy4vd2ViLW1lcmNhdG9yLXV0aWxzJztcbiJdfQ== | ||
export { fitBounds } from './web-mercator-viewport'; | ||
export { projectFlat, unprojectFlat, getMeterZoom, getDistanceScales, getWorldPosition, getViewMatrix, getUncenteredViewMatrix, getProjectionMatrix } from './web-mercator-utils'; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0IiwiV2ViTWVyY2F0b3JWaWV3cG9ydCIsIlBlc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yLXZpZXdwb3J0JztcblxuZXhwb3J0IHtcbiAgcHJvamVjdEZsYXQsXG4gIHVucHJvamVjdEZsYXQsXG4gIGdldE1ldGVyWm9vbSxcbiAgZ2V0RGlzdGFuY2VTY2FsZXMsXG4gIGdldFdvcmxkUG9zaXRpb24sXG4gIGdldFZpZXdNYXRyaXgsXG4gIGdldFVuY2VudGVyZWRWaWV3TWF0cml4LFxuICBnZXRQcm9qZWN0aW9uTWF0cml4XG59IGZyb20gJy4vd2ViLW1lcmNhdG9yLXV0aWxzJztcbiJdfQ== |
@@ -6,2 +6,4 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
import { Vector3 } from 'math.gl'; | ||
import { createMat4 } from './math-utils'; | ||
import mat4_perspective from 'gl-mat4/perspective'; | ||
@@ -22,10 +24,5 @@ import mat4_scale from 'gl-mat4/scale'; | ||
var WORLD_SCALE = TILE_SIZE; | ||
var EARTH_CIRCUMFERENCE = 40.075e6; | ||
// const METERS_PER_DEGREE_AT_EQUATOR = 111000; // Approximately 111km per degree at equator | ||
// Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create() | ||
function createMat4() { | ||
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; | ||
} | ||
/** | ||
@@ -76,7 +73,6 @@ * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile. | ||
// S=C*cos(y)/2^(z+8) | ||
export function getMercatorMeterZoom(_ref5) { | ||
export function getMeterZoom(_ref5) { | ||
var latitude = _ref5.latitude; | ||
assert(latitude); | ||
var EARTH_CIRCUMFERENCE = 40.075e6; | ||
var radians = function radians(degrees) { | ||
@@ -94,3 +90,3 @@ return degrees / 180 * Math.PI; | ||
*/ | ||
export function getMercatorDistanceScales(_ref6) { | ||
export function getDistanceScales(_ref6) { | ||
var latitude = _ref6.latitude, | ||
@@ -139,3 +135,3 @@ longitude = _ref6.longitude, | ||
*/ | ||
export function getMercatorWorldPosition(_ref7) { | ||
export function getWorldPosition(_ref7) { | ||
var longitude = _ref7.longitude, | ||
@@ -150,5 +146,2 @@ latitude = _ref7.latitude, | ||
// Calculate distance scales if lng/lat/zoom are provided | ||
distanceScales = distanceScales || getMercatorDistanceScales({ latitude: latitude, longitude: longitude, scale: scale }); | ||
// Make a centered version of the matrix for projection modes without an offset | ||
@@ -159,2 +152,5 @@ var center2d = projectFlat([longitude, latitude], scale); | ||
if (meterOffset) { | ||
// Calculate distance scales if lng/lat/zoom are provided | ||
distanceScales = distanceScales || getDistanceScales({ latitude: latitude, longitude: longitude, scale: scale }); | ||
var pixelPosition = new Vector3(meterOffset) | ||
@@ -178,3 +174,3 @@ // Convert to pixels in current zoom | ||
// Variable fov (in radians) | ||
export function getFov(_ref8) { | ||
function getFov(_ref8) { | ||
var height = _ref8.height, | ||
@@ -186,3 +182,3 @@ altitude = _ref8.altitude; | ||
export function getClippingPlanes(_ref9) { | ||
function getClippingPlanes(_ref9) { | ||
var altitude = _ref9.altitude, | ||
@@ -204,12 +200,7 @@ pitch = _ref9.pitch; | ||
// TODO - rename this matrix | ||
export function makeUncenteredViewMatrixFromMercatorParams(_ref10) { | ||
var width = _ref10.width, | ||
height = _ref10.height, | ||
longitude = _ref10.longitude, | ||
latitude = _ref10.latitude, | ||
zoom = _ref10.zoom, | ||
export function getUncenteredViewMatrix(_ref10) { | ||
var height = _ref10.height, | ||
pitch = _ref10.pitch, | ||
bearing = _ref10.bearing, | ||
altitude = _ref10.altitude, | ||
center = _ref10.center; | ||
altitude = _ref10.altitude; | ||
@@ -237,3 +228,3 @@ // VIEW MATRIX: PROJECTS MERCATOR WORLD COORDINATES | ||
export function makeViewMatricesFromMercatorParams(_ref11) { | ||
export function getViewMatrix(_ref11) { | ||
var width = _ref11.width, | ||
@@ -247,7 +238,16 @@ height = _ref11.height, | ||
altitude = _ref11.altitude, | ||
centerLngLat = _ref11.centerLngLat, | ||
_ref11$distanceScales = _ref11.distanceScales, | ||
distanceScales = _ref11$distanceScales === undefined ? null : _ref11$distanceScales, | ||
_ref11$center = _ref11.center, | ||
center = _ref11$center === undefined ? null : _ref11$center, | ||
_ref11$viewMatrixUnce = _ref11.viewMatrixUncentered, | ||
viewMatrixUncentered = _ref11$viewMatrixUnce === undefined ? null : _ref11$viewMatrixUnce, | ||
_ref11$meterOffset = _ref11.meterOffset, | ||
meterOffset = _ref11$meterOffset === undefined ? null : _ref11$meterOffset; | ||
meterOffset = _ref11$meterOffset === undefined ? null : _ref11$meterOffset, | ||
_ref11$flipY = _ref11.flipY, | ||
flipY = _ref11$flipY === undefined ? true : _ref11$flipY; | ||
var center = getMercatorWorldPosition({ longitude: longitude, latitude: latitude, zoom: zoom, meterOffset: meterOffset }); | ||
if (!center) { | ||
center = getWorldPosition({ longitude: longitude, latitude: latitude, zoom: zoom, distanceScales: distanceScales, meterOffset: meterOffset }); | ||
} | ||
@@ -257,22 +257,15 @@ // VIEW MATRIX: PROJECTS FROM VIRTUAL PIXELS TO CAMERA SPACE | ||
// since vectors will be multiplied from the right during transformation | ||
var viewMatrixUncentered = makeUncenteredViewMatrixFromMercatorParams({ | ||
width: width, | ||
height: height, | ||
longitude: longitude, | ||
latitude: latitude, | ||
zoom: zoom, | ||
pitch: pitch, | ||
bearing: bearing, | ||
altitude: altitude | ||
}); | ||
if (!viewMatrixUncentered) { | ||
viewMatrixUncentered = getUncenteredViewMatrix({ height: height, pitch: pitch, bearing: bearing, altitude: altitude }); | ||
} | ||
var vm = createMat4(); | ||
mat4_scale(vm, viewMatrixUncentered, [1, -1, 1]); | ||
if (flipY) { | ||
mat4_scale(vm, viewMatrixUncentered, [1, -1, 1]); | ||
} | ||
var viewMatrixCentered = mat4_translate(vm, vm, new Vector3(center).negate()); | ||
return { | ||
viewMatrixCentered: viewMatrixCentered, | ||
viewMatrixUncentered: viewMatrixUncentered, | ||
center: center | ||
}; | ||
return viewMatrixCentered; | ||
} | ||
@@ -282,3 +275,3 @@ | ||
// This is a "Mapbox" projection matrix - matches mapbox exactly if farZMultiplier === 1 | ||
export function makeProjectionMatrixFromMercatorParams(_ref12) { | ||
export function getProjectionMatrix(_ref12) { | ||
var width = _ref12.width, | ||
@@ -297,3 +290,3 @@ height = _ref12.height, | ||
var projectionMatrix = mat4_perspective(createMat4(), fov, // fov in radians | ||
var projectionMatrix = mat4_perspective([], fov, // fov in radians | ||
width / height, // aspect ratio | ||
@@ -306,2 +299,2 @@ nearZ, // near plane | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93ZWItbWVyY2F0b3ItdXRpbHMuanMiXSwibmFtZXMiOlsiVmVjdG9yMyIsIm1hdDRfcGVyc3BlY3RpdmUiLCJtYXQ0X3NjYWxlIiwibWF0NF90cmFuc2xhdGUiLCJtYXQ0X3JvdGF0ZVgiLCJtYXQ0X3JvdGF0ZVoiLCJ2ZWMyX2Rpc3RhbmNlIiwiYXNzZXJ0IiwiUEkiLCJNYXRoIiwiUElfNCIsIkRFR1JFRVNfVE9fUkFESUFOUyIsIlJBRElBTlNfVE9fREVHUkVFUyIsIlRJTEVfU0laRSIsIldPUkxEX1NDQUxFIiwiY3JlYXRlTWF0NCIsInByb2plY3RGbGF0Iiwic2NhbGUiLCJsbmciLCJsYXQiLCJsYW1iZGEyIiwicGhpMiIsIngiLCJ5IiwibG9nIiwidGFuIiwidW5wcm9qZWN0RmxhdCIsImF0YW4iLCJleHAiLCJnZXRNZXJjYXRv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5jdGlvbiBnZXRQcm9qZWN0aW9uTWF0cml4KHtcbiAgd2lkdGgsXG4gIGhlaWdodCxcbiAgcGl0Y2gsXG4gIGFsdGl0dWRlLFxuICBmYXJaTXVsdGlwbGllciA9IDEwXG59KSB7XG4gIGNvbnN0IHtuZWFyWiwgZmFyWn0gPSBnZXRDbGlwcGluZ1BsYW5lcyh7YWx0aXR1ZGUsIHBpdGNofSk7XG4gIGNvbnN0IGZvdiA9IGdldEZvdih7aGVpZ2h0LCBhbHRpdHVkZX0pO1xuXG4gIGNvbnN0IHByb2plY3Rpb25NYXRyaXggPSBtYXQ0X3BlcnNwZWN0aXZlKFxuICAgIFtdLFxuICAgIGZvdiwgICAgICAgICAgICAgIC8vIGZvdiBpbiByYWRpYW5zXG4gICAgd2lkdGggLyBoZWlnaHQsICAgLy8gYXNwZWN0IHJhdGlvXG4gICAgbmVhclosICAgICAgICAgICAgLy8gbmVhciBwbGFuZVxuICAgIGZhclogKiBmYXJaTXVsdGlwbGllciAvLyBmYXIgcGxhbmVcbiAgKTtcblxuICByZXR1cm4gcHJvamVjdGlvbk1hdHJpeDtcbn1cbiJdfQ== |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _flatMercatorViewport = require('./flat-mercator-viewport'); | ||
var _webMercatorViewport = require('./web-mercator-viewport'); | ||
@@ -13,20 +13,23 @@ Object.defineProperty(exports, 'default', { | ||
get: function get() { | ||
return _interopRequireDefault(_flatMercatorViewport).default; | ||
return _interopRequireDefault(_webMercatorViewport).default; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'FlatMercatorViewport', { | ||
Object.defineProperty(exports, 'WebMercatorViewport', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_flatMercatorViewport).default; | ||
return _interopRequireDefault(_webMercatorViewport).default; | ||
} | ||
}); | ||
var _perspectiveMercatorViewport = require('./perspective-mercator-viewport'); | ||
Object.defineProperty(exports, 'PerspectiveMercatorViewport', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_perspectiveMercatorViewport).default; | ||
return _interopRequireDefault(_webMercatorViewport).default; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'fitBounds', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorViewport.fitBounds; | ||
} | ||
}); | ||
@@ -47,52 +50,40 @@ var _webMercatorUtils = require('./web-mercator-utils'); | ||
}); | ||
Object.defineProperty(exports, 'getMercatorMeterZoom', { | ||
Object.defineProperty(exports, 'getMeterZoom', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.getMercatorMeterZoom; | ||
return _webMercatorUtils.getMeterZoom; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'getMercatorDistanceScales', { | ||
Object.defineProperty(exports, 'getDistanceScales', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.getMercatorDistanceScales; | ||
return _webMercatorUtils.getDistanceScales; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'getMercatorWorldPosition', { | ||
Object.defineProperty(exports, 'getWorldPosition', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.getMercatorWorldPosition; | ||
return _webMercatorUtils.getWorldPosition; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'makeViewMatricesFromMercatorParams', { | ||
Object.defineProperty(exports, 'getViewMatrix', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.makeViewMatricesFromMercatorParams; | ||
return _webMercatorUtils.getViewMatrix; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'makeUncenteredViewMatrixFromMercatorParams', { | ||
Object.defineProperty(exports, 'getUncenteredViewMatrix', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.makeUncenteredViewMatrixFromMercatorParams; | ||
return _webMercatorUtils.getUncenteredViewMatrix; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'makeProjectionMatrixFromMercatorParams', { | ||
Object.defineProperty(exports, 'getProjectionMatrix', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.makeProjectionMatrixFromMercatorParams; | ||
return _webMercatorUtils.getProjectionMatrix; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'getFov', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.getFov; | ||
} | ||
}); | ||
Object.defineProperty(exports, 'getClippingPlanes', { | ||
enumerable: true, | ||
get: function get() { | ||
return _webMercatorUtils.getClippingPlanes; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0IiwicHJvamVjdEZsYXQiLCJ1bnByb2plY3RGbGF0IiwiZ2V0TWVyY2F0b3JNZXRlclpvb20iLCJnZXRNZXJjYXRvckRpc3RhbmNlU2NhbGVzIiwiZ2V0TWVyY2F0b3JXb3JsZFBvc2l0aW9uIiwibWFrZVZpZXdNYXRyaWNlc0Zyb21NZXJjYXRvclBhcmFtcyIsIm1ha2VVbmNlbnRlcmVkVmlld01hdHJpeEZyb21NZXJjYXRvclBhcmFtcyIsIm1ha2VQcm9qZWN0aW9uTWF0cml4RnJvbU1lcmNhdG9yUGFyYW1zIiwiZ2V0Rm92IiwiZ2V0Q2xpcHBpbmdQbGFuZXMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O3lEQUNRQSxPOzs7Ozs7eURBQ0FBLE87Ozs7Ozs7OztnRUFDQUEsTzs7Ozs7Ozs7OzZCQUVBQyxXOzs7Ozs7NkJBQ0FDLGE7Ozs7Ozs2QkFDQUMsb0I7Ozs7Ozs2QkFDQUMseUI7Ozs7Ozs2QkFDQUMsd0I7Ozs7Ozs2QkFDQUMsa0M7Ozs7Ozs2QkFDQUMsMEM7Ozs7Ozs2QkFDQUMsc0M7Ozs7Ozs2QkFDQUMsTTs7Ozs7OzZCQUNBQyx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mlld3BvcnQnO1xuLy8gTGVnYWN5IGNsYXNzIG5hbWVcbmV4cG9ydCB7ZGVmYXVsdCBhcyBQZXJzcGVjdGl2ZU1lcmNhdG9yVmlld3BvcnR9IGZyb20gJy4vd2ViLW1lcmNhdG9yLXZpZXdwb3J0JztcblxuZXhwb3J0IHtmaXRCb3VuZHN9IGZyb20gJy4vd2ViLW1lcmNhdG9yLXZpZXdwb3J0JztcblxuZXhwb3J0IHtcbiAgcHJvamVjdEZsYXQsXG4gIHVucHJvamVjdEZsYXQsXG4gIGdldE1ldGVyWm9vbSxcbiAgZ2V0RGlzdGFuY2VTY2FsZXMsXG4gIGdldFdvcmxkUG9zaXRpb24sXG4gIGdldFZpZXdNYXRyaXgsXG4gIGdldFVuY2VudGVyZWRWaWV3TWF0cml4LFxuICBnZXRQcm9qZWN0aW9uTWF0cml4XG59IGZyb20gJy4vd2ViLW1lcmNhdG9yLXV0aWxzJztcbiJdfQ== |
@@ -11,13 +11,13 @@ 'use strict'; | ||
exports.unprojectFlat = unprojectFlat; | ||
exports.getMercatorMeterZoom = getMercatorMeterZoom; | ||
exports.getMercatorDistanceScales = getMercatorDistanceScales; | ||
exports.getMercatorWorldPosition = getMercatorWorldPosition; | ||
exports.getFov = getFov; | ||
exports.getClippingPlanes = getClippingPlanes; | ||
exports.makeUncenteredViewMatrixFromMercatorParams = makeUncenteredViewMatrixFromMercatorParams; | ||
exports.makeViewMatricesFromMercatorParams = makeViewMatricesFromMercatorParams; | ||
exports.makeProjectionMatrixFromMercatorParams = makeProjectionMatrixFromMercatorParams; | ||
exports.getMeterZoom = getMeterZoom; | ||
exports.getDistanceScales = getDistanceScales; | ||
exports.getWorldPosition = getWorldPosition; | ||
exports.getUncenteredViewMatrix = getUncenteredViewMatrix; | ||
exports.getViewMatrix = getViewMatrix; | ||
exports.getProjectionMatrix = getProjectionMatrix; | ||
var _math = require('math.gl'); | ||
var _mathUtils = require('./math-utils'); | ||
var _perspective = require('gl-mat4/perspective'); | ||
@@ -60,10 +60,5 @@ | ||
var WORLD_SCALE = TILE_SIZE; | ||
var EARTH_CIRCUMFERENCE = 40.075e6; | ||
// const METERS_PER_DEGREE_AT_EQUATOR = 111000; // Approximately 111km per degree at equator | ||
// Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create() | ||
function createMat4() { | ||
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; | ||
} | ||
/** | ||
@@ -114,7 +109,6 @@ * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile. | ||
// S=C*cos(y)/2^(z+8) | ||
function getMercatorMeterZoom(_ref5) { | ||
function getMeterZoom(_ref5) { | ||
var latitude = _ref5.latitude; | ||
(0, _assert2.default)(latitude); | ||
var EARTH_CIRCUMFERENCE = 40.075e6; | ||
var radians = function radians(degrees) { | ||
@@ -132,3 +126,3 @@ return degrees / 180 * Math.PI; | ||
*/ | ||
function getMercatorDistanceScales(_ref6) { | ||
function getDistanceScales(_ref6) { | ||
var latitude = _ref6.latitude, | ||
@@ -177,3 +171,3 @@ longitude = _ref6.longitude, | ||
*/ | ||
function getMercatorWorldPosition(_ref7) { | ||
function getWorldPosition(_ref7) { | ||
var longitude = _ref7.longitude, | ||
@@ -188,5 +182,2 @@ latitude = _ref7.latitude, | ||
// Calculate distance scales if lng/lat/zoom are provided | ||
distanceScales = distanceScales || getMercatorDistanceScales({ latitude: latitude, longitude: longitude, scale: scale }); | ||
// Make a centered version of the matrix for projection modes without an offset | ||
@@ -197,2 +188,5 @@ var center2d = projectFlat([longitude, latitude], scale); | ||
if (meterOffset) { | ||
// Calculate distance scales if lng/lat/zoom are provided | ||
distanceScales = distanceScales || getDistanceScales({ latitude: latitude, longitude: longitude, scale: scale }); | ||
var pixelPosition = new _math.Vector3(meterOffset) | ||
@@ -240,12 +234,7 @@ // Convert to pixels in current zoom | ||
// TODO - rename this matrix | ||
function makeUncenteredViewMatrixFromMercatorParams(_ref10) { | ||
var width = _ref10.width, | ||
height = _ref10.height, | ||
longitude = _ref10.longitude, | ||
latitude = _ref10.latitude, | ||
zoom = _ref10.zoom, | ||
function getUncenteredViewMatrix(_ref10) { | ||
var height = _ref10.height, | ||
pitch = _ref10.pitch, | ||
bearing = _ref10.bearing, | ||
altitude = _ref10.altitude, | ||
center = _ref10.center; | ||
altitude = _ref10.altitude; | ||
@@ -257,3 +246,3 @@ // VIEW MATRIX: PROJECTS MERCATOR WORLD COORDINATES | ||
// since vectors will be multiplied from the right during transformation | ||
var vm = createMat4(); | ||
var vm = (0, _mathUtils.createMat4)(); | ||
@@ -274,3 +263,3 @@ // Move camera to altitude (along the pitch & bearing direction) | ||
function makeViewMatricesFromMercatorParams(_ref11) { | ||
function getViewMatrix(_ref11) { | ||
var width = _ref11.width, | ||
@@ -284,7 +273,16 @@ height = _ref11.height, | ||
altitude = _ref11.altitude, | ||
centerLngLat = _ref11.centerLngLat, | ||
_ref11$distanceScales = _ref11.distanceScales, | ||
distanceScales = _ref11$distanceScales === undefined ? null : _ref11$distanceScales, | ||
_ref11$center = _ref11.center, | ||
center = _ref11$center === undefined ? null : _ref11$center, | ||
_ref11$viewMatrixUnce = _ref11.viewMatrixUncentered, | ||
viewMatrixUncentered = _ref11$viewMatrixUnce === undefined ? null : _ref11$viewMatrixUnce, | ||
_ref11$meterOffset = _ref11.meterOffset, | ||
meterOffset = _ref11$meterOffset === undefined ? null : _ref11$meterOffset; | ||
meterOffset = _ref11$meterOffset === undefined ? null : _ref11$meterOffset, | ||
_ref11$flipY = _ref11.flipY, | ||
flipY = _ref11$flipY === undefined ? true : _ref11$flipY; | ||
var center = getMercatorWorldPosition({ longitude: longitude, latitude: latitude, zoom: zoom, meterOffset: meterOffset }); | ||
if (!center) { | ||
center = getWorldPosition({ longitude: longitude, latitude: latitude, zoom: zoom, distanceScales: distanceScales, meterOffset: meterOffset }); | ||
} | ||
@@ -294,22 +292,15 @@ // VIEW MATRIX: PROJECTS FROM VIRTUAL PIXELS TO CAMERA SPACE | ||
// since vectors will be multiplied from the right during transformation | ||
var viewMatrixUncentered = makeUncenteredViewMatrixFromMercatorParams({ | ||
width: width, | ||
height: height, | ||
longitude: longitude, | ||
latitude: latitude, | ||
zoom: zoom, | ||
pitch: pitch, | ||
bearing: bearing, | ||
altitude: altitude | ||
}); | ||
if (!viewMatrixUncentered) { | ||
viewMatrixUncentered = getUncenteredViewMatrix({ height: height, pitch: pitch, bearing: bearing, altitude: altitude }); | ||
} | ||
var vm = createMat4(); | ||
(0, _scale2.default)(vm, viewMatrixUncentered, [1, -1, 1]); | ||
var vm = (0, _mathUtils.createMat4)(); | ||
if (flipY) { | ||
(0, _scale2.default)(vm, viewMatrixUncentered, [1, -1, 1]); | ||
} | ||
var viewMatrixCentered = (0, _translate2.default)(vm, vm, new _math.Vector3(center).negate()); | ||
return { | ||
viewMatrixCentered: viewMatrixCentered, | ||
viewMatrixUncentered: viewMatrixUncentered, | ||
center: center | ||
}; | ||
return viewMatrixCentered; | ||
} | ||
@@ -319,3 +310,3 @@ | ||
// This is a "Mapbox" projection matrix - matches mapbox exactly if farZMultiplier === 1 | ||
function makeProjectionMatrixFromMercatorParams(_ref12) { | ||
function getProjectionMatrix(_ref12) { | ||
var width = _ref12.width, | ||
@@ -334,3 +325,3 @@ height = _ref12.height, | ||
var projectionMatrix = (0, _perspective2.default)(createMat4(), fov, // fov in radians | ||
var projectionMatrix = (0, _perspective2.default)([], fov, // fov in radians | ||
width / height, // aspect ratio | ||
@@ -343,2 +334,2 @@ nearZ, // near plane | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93ZWItbWVyY2F0b3ItdXRpbHMuanMiXSwibmFtZXMiOlsicHJvamVjdEZsYXQiLCJ1bnByb2plY3RGbGF0IiwiZ2V0TWVyY2F0b3JNZXRlclpvb20iLCJnZXRNZXJjYXRvckRpc3RhbmNlU2NhbGVzIiwiZ2V0TWVyY2F0b3JXb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NvbnN0IGZvdiA9IGdldEZvdih7aGVpZ2h0LCBhbHRpdHVkZX0pO1xuXG4gIGNvbnN0IHByb2plY3Rpb25NYXRyaXggPSBtYXQ0X3BlcnNwZWN0aXZlKFxuICAgIFtdLFxuICAgIGZvdiwgICAgICAgICAgICAgIC8vIGZvdiBpbiByYWRpYW5zXG4gICAgd2lkdGggLyBoZWlnaHQsICAgLy8gYXNwZWN0IHJhdGlvXG4gICAgbmVhclosICAgICAgICAgICAgLy8gbmVhciBwbGFuZVxuICAgIGZhclogKiBmYXJaTXVsdGlwbGllciAvLyBmYXIgcGxhbmVcbiAgKTtcblxuICByZXR1cm4gcHJvamVjdGlvbk1hdHJpeDtcbn1cbiJdfQ== |
{ | ||
"name": "viewport-mercator-project", | ||
"version": "4.2.0-alpha.2", | ||
"version": "5.0.0-alpha.1", | ||
"description": "Utilities for perspective-enabled Web Mercator projections", | ||
@@ -38,2 +38,3 @@ "author": "Uber Technologies, Inc.", | ||
"devDependencies": { | ||
"@turf/distance": "^5.0.4", | ||
"babel-cli": "^6.22.2", | ||
@@ -49,3 +50,4 @@ "babel-core": "^6.22.1", | ||
"jsdom": "~9.9.1", | ||
"mapbox-gl": "0.26.0", | ||
"mapbox-gl": "0.41.0", | ||
"mock-browser": "^0.92.14", | ||
"module-alias": "^2.0.0", | ||
@@ -52,0 +54,0 @@ "pre-commit": "^1.2.2", |
@@ -16,24 +16,38 @@ <p align="right"> | ||
<h1 align="center">viewport-mercator-project</h1> | ||
# viewport-mercator-project | [Docs](https://uber-common.github.io/viewport-mercator-project/#/) | ||
Documentation is available in the [**website**](https://uber-common.github.io/viewport-mercator-project/#/) or in the [docs](./docs) folder). | ||
Projection and camera utilities supporting the Web Mercator Projection. At its core this is a utility for converting to and from map coordinates (i.e. latitude, longitude) to screen coordinates and back. | ||
## Installation | ||
<h5 align="center">Utility to convert map or world coordinates to screen coordinates back and forth</h5> | ||
```bash | ||
npm install viewport-mercator-project --save | ||
``` | ||
npm install viewport-mercator-project --save | ||
## Overview | ||
Projection and camera utilities supporting the Web Mercator Projection. At its core this is a utility for converting to and from map coordinates (i.e. latitude, longitude) to screen coordinates and back. | ||
The `WebMercatorViewport` class offers the equivalent of a 3D matrix "camera" class of the type you would find in any 3D/WebGL/OpenGL library. | ||
* `FlatMercatorViewport` - For 2D applications, a simple, fast utility is provided that supports the basic flat Web Mercator projection and unprojection between geo coordinates and pixels. | ||
```js | ||
import WebMercatorViewport from 'viewport-mercator-project'; | ||
* `PerspectiveMercatorViewport` - For 3D applications, a subclass of a generic `Viewport` class (which is essentially a 3D matrix "camera" class of the type you would find in any 3D/WebGL/OpenGL library). | ||
// A viewport looking at San Francisco city area | ||
const viewport = WebMercatorViewport({ | ||
width: 800, | ||
height: 600, | ||
longitude: -122.45, | ||
latitude: 37.78, | ||
zoom: 12, | ||
pitch: 60, | ||
bearing: 30 | ||
}); | ||
The constructor of this "advanced" perspective-enabled viewport also takes the same typical map view parameters as the `FlatMercatorViewport`, however it offers perspective enabled/project unproject functions, and generates general 4x4 view matrices that correspond to the parameters. | ||
viewport.project([-122.45, 37.78]); | ||
// returns pixel coordinates [400, 300] | ||
viewport.unproject([400, 300]); | ||
// returns map coordinates [-122.45, 37.78] | ||
``` | ||
## Who is this for? | ||
### Who is this for? | ||
Specifically built for use with [deck.gl](https://github.com/uber/deck-gl) and [react-map-gl](https://github.com/uber/react-map-gl), but could be useful for any web mapping application that wants to support perspective enabled Web Mercator Projections with floating point zoom levels. |
// Classic web-mercator-project | ||
export {default as default} from './flat-mercator-viewport'; | ||
export {default as FlatMercatorViewport} from './flat-mercator-viewport'; | ||
export {default as PerspectiveMercatorViewport} from './perspective-mercator-viewport'; | ||
export {default as default} from './web-mercator-viewport'; | ||
export {default as WebMercatorViewport} from './web-mercator-viewport'; | ||
// Legacy class name | ||
export {default as PerspectiveMercatorViewport} from './web-mercator-viewport'; | ||
export {projectFlat} from './web-mercator-utils'; | ||
export {unprojectFlat} from './web-mercator-utils'; | ||
export {getMercatorMeterZoom} from './web-mercator-utils'; | ||
export {getMercatorDistanceScales} from './web-mercator-utils'; | ||
export {getMercatorWorldPosition} from './web-mercator-utils'; | ||
export {makeViewMatricesFromMercatorParams} from './web-mercator-utils'; | ||
export {makeUncenteredViewMatrixFromMercatorParams} from './web-mercator-utils'; | ||
export {makeProjectionMatrixFromMercatorParams} from './web-mercator-utils'; | ||
export {getFov} from './web-mercator-utils'; | ||
export {getClippingPlanes} from './web-mercator-utils'; | ||
export {fitBounds} from './web-mercator-viewport'; | ||
export { | ||
projectFlat, | ||
unprojectFlat, | ||
getMeterZoom, | ||
getDistanceScales, | ||
getWorldPosition, | ||
getViewMatrix, | ||
getUncenteredViewMatrix, | ||
getProjectionMatrix | ||
} from './web-mercator-utils'; |
// TODO - THE UTILITIES IN THIS FILE SHOULD BE IMPORTED FROM WEB-MERCATOR-VIEWPORT MODULE | ||
import {Vector3} from 'math.gl'; | ||
import {createMat4} from './math-utils'; | ||
import mat4_perspective from 'gl-mat4/perspective'; | ||
@@ -19,10 +21,5 @@ import mat4_scale from 'gl-mat4/scale'; | ||
const WORLD_SCALE = TILE_SIZE; | ||
const EARTH_CIRCUMFERENCE = 40.075e6; | ||
// const METERS_PER_DEGREE_AT_EQUATOR = 111000; // Approximately 111km per degree at equator | ||
// Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create() | ||
function createMat4() { | ||
return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; | ||
} | ||
/** | ||
@@ -65,5 +62,4 @@ * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile. | ||
// S=C*cos(y)/2^(z+8) | ||
export function getMercatorMeterZoom({latitude}) { | ||
export function getMeterZoom({latitude}) { | ||
assert(latitude); | ||
const EARTH_CIRCUMFERENCE = 40.075e6; | ||
const radians = degrees => degrees / 180 * Math.PI; | ||
@@ -79,3 +75,3 @@ return Math.log2(EARTH_CIRCUMFERENCE * Math.cos(radians(latitude))) - 8; | ||
*/ | ||
export function getMercatorDistanceScales({latitude, longitude, zoom, scale}) { | ||
export function getDistanceScales({latitude, longitude, zoom, scale}) { | ||
// Calculate scale from zoom if not provided | ||
@@ -125,3 +121,3 @@ scale = scale !== undefined ? scale : Math.pow(2, zoom); | ||
*/ | ||
export function getMercatorWorldPosition({ | ||
export function getWorldPosition({ | ||
longitude, | ||
@@ -135,5 +131,2 @@ latitude, | ||
// Calculate distance scales if lng/lat/zoom are provided | ||
distanceScales = distanceScales || getMercatorDistanceScales({latitude, longitude, scale}); | ||
// Make a centered version of the matrix for projection modes without an offset | ||
@@ -144,2 +137,5 @@ const center2d = projectFlat([longitude, latitude], scale); | ||
if (meterOffset) { | ||
// Calculate distance scales if lng/lat/zoom are provided | ||
distanceScales = distanceScales || getDistanceScales({latitude, longitude, scale}); | ||
const pixelPosition = new Vector3(meterOffset) | ||
@@ -163,7 +159,7 @@ // Convert to pixels in current zoom | ||
// Variable fov (in radians) | ||
export function getFov({height, altitude}) { | ||
function getFov({height, altitude}) { | ||
return 2 * Math.atan((height / 2) / altitude); | ||
} | ||
export function getClippingPlanes({altitude, pitch}) { | ||
function getClippingPlanes({altitude, pitch}) { | ||
// Find the distance from the center point to the center top | ||
@@ -183,12 +179,7 @@ // in altitude units using law of sines. | ||
// TODO - rename this matrix | ||
export function makeUncenteredViewMatrixFromMercatorParams({ | ||
width, | ||
export function getUncenteredViewMatrix({ | ||
height, | ||
longitude, | ||
latitude, | ||
zoom, | ||
pitch, | ||
bearing, | ||
altitude, | ||
center | ||
altitude | ||
}) { | ||
@@ -216,3 +207,4 @@ // VIEW MATRIX: PROJECTS MERCATOR WORLD COORDINATES | ||
export function makeViewMatricesFromMercatorParams({ | ||
export function getViewMatrix({ | ||
// Viewport props | ||
width, | ||
@@ -226,6 +218,13 @@ height, | ||
altitude, | ||
centerLngLat, | ||
meterOffset = null | ||
// Pre-calculated parameters | ||
distanceScales = null, | ||
center = null, | ||
viewMatrixUncentered = null, | ||
// Options | ||
meterOffset = null, | ||
flipY = true | ||
}) { | ||
const center = getMercatorWorldPosition({longitude, latitude, zoom, meterOffset}); | ||
if (!center) { | ||
center = getWorldPosition({longitude, latitude, zoom, distanceScales, meterOffset}); | ||
} | ||
@@ -235,22 +234,15 @@ // VIEW MATRIX: PROJECTS FROM VIRTUAL PIXELS TO CAMERA SPACE | ||
// since vectors will be multiplied from the right during transformation | ||
const viewMatrixUncentered = makeUncenteredViewMatrixFromMercatorParams({ | ||
width, | ||
height, | ||
longitude, | ||
latitude, | ||
zoom, | ||
pitch, | ||
bearing, | ||
altitude | ||
}); | ||
if (!viewMatrixUncentered) { | ||
viewMatrixUncentered = getUncenteredViewMatrix({height, pitch, bearing, altitude}); | ||
} | ||
const vm = createMat4(); | ||
mat4_scale(vm, viewMatrixUncentered, [1, -1, 1]); | ||
if (flipY) { | ||
mat4_scale(vm, viewMatrixUncentered, [1, -1, 1]); | ||
} | ||
const viewMatrixCentered = mat4_translate(vm, vm, new Vector3(center).negate()); | ||
return { | ||
viewMatrixCentered, | ||
viewMatrixUncentered, | ||
center | ||
}; | ||
return viewMatrixCentered; | ||
} | ||
@@ -260,3 +252,3 @@ | ||
// This is a "Mapbox" projection matrix - matches mapbox exactly if farZMultiplier === 1 | ||
export function makeProjectionMatrixFromMercatorParams({ | ||
export function getProjectionMatrix({ | ||
width, | ||
@@ -272,3 +264,3 @@ height, | ||
const projectionMatrix = mat4_perspective( | ||
createMat4(), | ||
[], | ||
fov, // fov in radians | ||
@@ -275,0 +267,0 @@ width / height, // aspect ratio |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53
217146
23
19
2143
1