@math.gl/web-mercator
Advanced tools
Comparing version 3.4.2 to 3.5.0-alpha.1
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = assert; | ||
exports.default = assert; | ||
@@ -9,0 +9,0 @@ function assert(condition, message) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports["default"] = fitBounds; | ||
exports.default = fitBounds; | ||
@@ -17,2 +17,4 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _mathUtils = require("./math-utils"); | ||
function fitBounds(_ref) { | ||
@@ -31,7 +33,7 @@ var width = _ref.width, | ||
var _bounds = (0, _slicedToArray2["default"])(bounds, 2), | ||
_bounds$ = (0, _slicedToArray2["default"])(_bounds[0], 2), | ||
var _bounds = (0, _slicedToArray2.default)(bounds, 2), | ||
_bounds$ = (0, _slicedToArray2.default)(_bounds[0], 2), | ||
west = _bounds$[0], | ||
south = _bounds$[1], | ||
_bounds$2 = (0, _slicedToArray2["default"])(_bounds[1], 2), | ||
_bounds$2 = (0, _slicedToArray2.default)(_bounds[1], 2), | ||
east = _bounds$2[0], | ||
@@ -49,6 +51,6 @@ north = _bounds$2[1]; | ||
} else { | ||
(0, _assert["default"])(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right)); | ||
(0, _assert.default)(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right)); | ||
} | ||
var viewport = new _webMercatorViewport["default"]({ | ||
var viewport = new _webMercatorViewport.default({ | ||
width: width, | ||
@@ -64,3 +66,3 @@ height: height, | ||
var targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2]; | ||
(0, _assert["default"])(targetSize[0] > 0 && targetSize[1] > 0); | ||
(0, _assert.default)(targetSize[0] > 0 && targetSize[1] > 0); | ||
var scaleX = targetSize[0] / size[0]; | ||
@@ -72,4 +74,4 @@ var scaleY = targetSize[1] / size[1]; | ||
var centerLngLat = viewport.unproject(center); | ||
var zoom = Math.min(maxZoom, viewport.zoom + Math.log2(Math.abs(Math.min(scaleX, scaleY)))); | ||
(0, _assert["default"])(Number.isFinite(zoom)); | ||
var zoom = Math.min(maxZoom, viewport.zoom + (0, _mathUtils.log2)(Math.abs(Math.min(scaleX, scaleY)))); | ||
(0, _assert.default)(Number.isFinite(zoom)); | ||
return { | ||
@@ -76,0 +78,0 @@ longitude: centerLngLat[0], |
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports["default"] = flyToViewport; | ||
exports.default = flyToViewport; | ||
exports.getFlyToDuration = getFlyToDuration; | ||
@@ -18,3 +18,3 @@ | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
@@ -21,0 +21,0 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } |
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports["default"] = getBounds; | ||
exports.default = getBounds; | ||
@@ -11,0 +11,0 @@ var _webMercatorUtils = require("./web-mercator-utils"); |
@@ -13,3 +13,3 @@ "use strict"; | ||
get: function get() { | ||
return _webMercatorViewport["default"]; | ||
return _webMercatorViewport.default; | ||
} | ||
@@ -20,3 +20,3 @@ }); | ||
get: function get() { | ||
return _webMercatorViewport["default"]; | ||
return _webMercatorViewport.default; | ||
} | ||
@@ -27,3 +27,3 @@ }); | ||
get: function get() { | ||
return _getBounds["default"]; | ||
return _getBounds.default; | ||
} | ||
@@ -34,3 +34,3 @@ }); | ||
get: function get() { | ||
return _fitBounds["default"]; | ||
return _fitBounds.default; | ||
} | ||
@@ -41,3 +41,3 @@ }); | ||
get: function get() { | ||
return _normalizeViewportProps["default"]; | ||
return _normalizeViewportProps.default; | ||
} | ||
@@ -48,3 +48,3 @@ }); | ||
get: function get() { | ||
return _flyToViewport["default"]; | ||
return _flyToViewport.default; | ||
} | ||
@@ -51,0 +51,0 @@ }); |
@@ -12,2 +12,3 @@ "use strict"; | ||
exports.lerp = lerp; | ||
exports.log2 = void 0; | ||
@@ -34,2 +35,9 @@ var vec4 = _interopRequireWildcard(require("gl-matrix/vec4")); | ||
} | ||
function ieLog2(x) { | ||
return Math.log(x) * Math.LOG2E; | ||
} | ||
var log2 = Math.log2 || ieLog2; | ||
exports.log2 = log2; | ||
//# sourceMappingURL=math-utils.js.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports["default"] = normalizeViewportProps; | ||
exports.default = normalizeViewportProps; | ||
@@ -37,3 +37,3 @@ var _webMercatorViewport = _interopRequireDefault(require("./web-mercator-viewport")); | ||
var flatViewport = new _webMercatorViewport["default"]({ | ||
var flatViewport = new _webMercatorViewport.default({ | ||
width: width, | ||
@@ -50,4 +50,4 @@ height: height, | ||
if (bottomY - topY < height) { | ||
zoom += Math.log2(height / (bottomY - topY)); | ||
flatViewport = new _webMercatorViewport["default"]({ | ||
zoom += (0, _mathUtils.log2)(height / (bottomY - topY)); | ||
flatViewport = new _webMercatorViewport.default({ | ||
width: width, | ||
@@ -54,0 +54,0 @@ height: height, |
@@ -48,12 +48,12 @@ "use strict"; | ||
function scaleToZoom(scale) { | ||
return Math.log2(scale); | ||
return (0, _mathUtils.log2)(scale); | ||
} | ||
function lngLatToWorld(_ref) { | ||
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2), | ||
var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | ||
lng = _ref2[0], | ||
lat = _ref2[1]; | ||
(0, _assert["default"])(Number.isFinite(lng)); | ||
(0, _assert["default"])(Number.isFinite(lat) && lat >= -90 && lat <= 90, 'invalid latitude'); | ||
(0, _assert.default)(Number.isFinite(lng)); | ||
(0, _assert.default)(Number.isFinite(lat) && lat >= -90 && lat <= 90, 'invalid latitude'); | ||
var lambda2 = lng * DEGREES_TO_RADIANS; | ||
@@ -67,3 +67,3 @@ var phi2 = lat * DEGREES_TO_RADIANS; | ||
function worldToLngLat(_ref3) { | ||
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2), | ||
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), | ||
x = _ref4[0], | ||
@@ -79,3 +79,3 @@ y = _ref4[1]; | ||
var latitude = _ref5.latitude; | ||
(0, _assert["default"])(Number.isFinite(latitude)); | ||
(0, _assert.default)(Number.isFinite(latitude)); | ||
var latCosine = Math.cos(latitude * DEGREES_TO_RADIANS); | ||
@@ -90,3 +90,3 @@ return scaleToZoom(EARTH_CIRCUMFERENCE * latCosine) - 9; | ||
highPrecision = _ref6$highPrecision === void 0 ? false : _ref6$highPrecision; | ||
(0, _assert["default"])(Number.isFinite(latitude) && Number.isFinite(longitude)); | ||
(0, _assert.default)(Number.isFinite(latitude) && Number.isFinite(longitude)); | ||
var result = {}; | ||
@@ -116,3 +116,3 @@ var worldSize = TILE_SIZE; | ||
function addMetersToLngLat(lngLatZ, xyz) { | ||
var _lngLatZ = (0, _slicedToArray2["default"])(lngLatZ, 3), | ||
var _lngLatZ = (0, _slicedToArray2.default)(lngLatZ, 3), | ||
longitude = _lngLatZ[0], | ||
@@ -122,3 +122,3 @@ latitude = _lngLatZ[1], | ||
var _xyz = (0, _slicedToArray2["default"])(xyz, 3), | ||
var _xyz = (0, _slicedToArray2.default)(xyz, 3), | ||
x = _xyz[0], | ||
@@ -216,3 +216,3 @@ y = _xyz[1], | ||
function worldToPixels(xyz, pixelProjectionMatrix) { | ||
var _xyz2 = (0, _slicedToArray2["default"])(xyz, 3), | ||
var _xyz2 = (0, _slicedToArray2.default)(xyz, 3), | ||
x = _xyz2[0], | ||
@@ -223,3 +223,3 @@ y = _xyz2[1], | ||
(0, _assert["default"])(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z)); | ||
(0, _assert.default)(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z)); | ||
return (0, _mathUtils.transformVector)(pixelProjectionMatrix, [x, y, z, 1]); | ||
@@ -231,3 +231,3 @@ } | ||
var _xyz3 = (0, _slicedToArray2["default"])(xyz, 3), | ||
var _xyz3 = (0, _slicedToArray2.default)(xyz, 3), | ||
x = _xyz3[0], | ||
@@ -237,3 +237,3 @@ y = _xyz3[1], | ||
(0, _assert["default"])(Number.isFinite(x) && Number.isFinite(y), 'invalid pixel coordinate'); | ||
(0, _assert.default)(Number.isFinite(x) && Number.isFinite(y), 'invalid pixel coordinate'); | ||
@@ -240,0 +240,0 @@ if (Number.isFinite(z)) { |
@@ -149,3 +149,3 @@ import { Bounds, FitBoundsOptions } from "./fit-bounds"; | ||
/** @deprecated Legacy method name */ | ||
getLocationAtPoint({lngLat, pos}): number[]; | ||
getLocationAtPoint({lngLat, pos}: {lngLat: number[], pos: number[]}): number[]; | ||
@@ -152,0 +152,0 @@ /** |
@@ -10,3 +10,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
@@ -58,3 +58,3 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
(0, _classCallCheck2["default"])(this, WebMercatorViewport); | ||
(0, _classCallCheck2.default)(this, WebMercatorViewport); | ||
width = width || 1; | ||
@@ -104,3 +104,3 @@ height = height || 1; | ||
(0, _createClass2["default"])(WebMercatorViewport, [{ | ||
(0, _createClass2.default)(WebMercatorViewport, [{ | ||
key: "_initMatrices", | ||
@@ -148,3 +148,3 @@ value: function _initMatrices() { | ||
var _coord = (0, _slicedToArray2["default"])(coord, 2), | ||
var _coord = (0, _slicedToArray2.default)(coord, 2), | ||
x = _coord[0], | ||
@@ -165,3 +165,3 @@ y = _coord[1]; | ||
var _xyz = (0, _slicedToArray2["default"])(xyz, 3), | ||
var _xyz = (0, _slicedToArray2.default)(xyz, 3), | ||
x = _xyz[0], | ||
@@ -176,3 +176,3 @@ y = _xyz[1], | ||
var _this$unprojectPositi = this.unprojectPosition(coord), | ||
_this$unprojectPositi2 = (0, _slicedToArray2["default"])(_this$unprojectPositi, 3), | ||
_this$unprojectPositi2 = (0, _slicedToArray2.default)(_this$unprojectPositi, 3), | ||
X = _this$unprojectPositi2[0], | ||
@@ -192,3 +192,3 @@ Y = _this$unprojectPositi2[1], | ||
var _lngLatToWorld = (0, _webMercatorUtils.lngLatToWorld)(xyz), | ||
_lngLatToWorld2 = (0, _slicedToArray2["default"])(_lngLatToWorld, 2), | ||
_lngLatToWorld2 = (0, _slicedToArray2.default)(_lngLatToWorld, 2), | ||
X = _lngLatToWorld2[0], | ||
@@ -204,3 +204,3 @@ Y = _lngLatToWorld2[1]; | ||
var _worldToLngLat = (0, _webMercatorUtils.worldToLngLat)(xyz), | ||
_worldToLngLat2 = (0, _slicedToArray2["default"])(_worldToLngLat, 2), | ||
_worldToLngLat2 = (0, _slicedToArray2.default)(_worldToLngLat, 2), | ||
X = _worldToLngLat2[0], | ||
@@ -250,3 +250,3 @@ Y = _worldToLngLat2[1]; | ||
var _fitBounds2 = (0, _fitBounds3["default"])(Object.assign({ | ||
var _fitBounds2 = (0, _fitBounds3.default)(Object.assign({ | ||
width: width, | ||
@@ -272,12 +272,12 @@ height: height, | ||
var corners = this.getBoundingRegion(options); | ||
var west = Math.min.apply(Math, (0, _toConsumableArray2["default"])(corners.map(function (p) { | ||
var west = Math.min.apply(Math, (0, _toConsumableArray2.default)(corners.map(function (p) { | ||
return p[0]; | ||
}))); | ||
var east = Math.max.apply(Math, (0, _toConsumableArray2["default"])(corners.map(function (p) { | ||
var east = Math.max.apply(Math, (0, _toConsumableArray2.default)(corners.map(function (p) { | ||
return p[0]; | ||
}))); | ||
var south = Math.min.apply(Math, (0, _toConsumableArray2["default"])(corners.map(function (p) { | ||
var south = Math.min.apply(Math, (0, _toConsumableArray2.default)(corners.map(function (p) { | ||
return p[1]; | ||
}))); | ||
var north = Math.max.apply(Math, (0, _toConsumableArray2["default"])(corners.map(function (p) { | ||
var north = Math.max.apply(Math, (0, _toConsumableArray2.default)(corners.map(function (p) { | ||
return p[1]; | ||
@@ -291,3 +291,3 @@ }))); | ||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return (0, _getBounds["default"])(this, options.z || 0); | ||
return (0, _getBounds.default)(this, options.z || 0); | ||
} | ||
@@ -298,3 +298,3 @@ }]); | ||
exports["default"] = WebMercatorViewport; | ||
exports.default = WebMercatorViewport; | ||
//# sourceMappingURL=web-mercator-viewport.js.map |
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import WebMercatorViewport from './web-mercator-viewport'; | ||
import assert from './assert'; | ||
import { log2 } from './math-utils'; | ||
export default function fitBounds(_ref) { | ||
@@ -55,3 +56,3 @@ var width = _ref.width, | ||
var centerLngLat = viewport.unproject(center); | ||
var zoom = Math.min(maxZoom, viewport.zoom + Math.log2(Math.abs(Math.min(scaleX, scaleY)))); | ||
var zoom = Math.min(maxZoom, viewport.zoom + log2(Math.abs(Math.min(scaleX, scaleY)))); | ||
assert(Number.isFinite(zoom)); | ||
@@ -58,0 +59,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } | ||
@@ -3,0 +3,0 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } |
@@ -17,2 +17,8 @@ import * as vec4 from 'gl-matrix/vec4'; | ||
} | ||
function ieLog2(x) { | ||
return Math.log(x) * Math.LOG2E; | ||
} | ||
export var log2 = Math.log2 || ieLog2; | ||
//# sourceMappingURL=math-utils.js.map |
import WebMercatorViewport from './web-mercator-viewport'; | ||
import { mod } from './math-utils'; | ||
import { mod, log2 } from './math-utils'; | ||
var MAX_LATITUDE = 85.05113; | ||
@@ -36,3 +36,3 @@ var MIN_LATITUDE = -85.05113; | ||
if (bottomY - topY < height) { | ||
zoom += Math.log2(height / (bottomY - topY)); | ||
zoom += log2(height / (bottomY - topY)); | ||
flatViewport = new WebMercatorViewport({ | ||
@@ -39,0 +39,0 @@ width: width, |
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
import { createMat4, transformVector } from './math-utils'; | ||
import { createMat4, transformVector, log2 } from './math-utils'; | ||
import * as mat4 from 'gl-matrix/mat4'; | ||
@@ -18,3 +18,3 @@ import * as vec2 from 'gl-matrix/vec2'; | ||
export function scaleToZoom(scale) { | ||
return Math.log2(scale); | ||
return log2(scale); | ||
} | ||
@@ -21,0 +21,0 @@ export function lngLatToWorld(_ref) { |
@@ -149,3 +149,3 @@ import { Bounds, FitBoundsOptions } from "./fit-bounds"; | ||
/** @deprecated Legacy method name */ | ||
getLocationAtPoint({lngLat, pos}): number[]; | ||
getLocationAtPoint({lngLat, pos}: {lngLat: number[], pos: number[]}): number[]; | ||
@@ -152,0 +152,0 @@ /** |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "3.4.2", | ||
"version": "3.5.0-alpha.1", | ||
"keywords": [ | ||
@@ -25,3 +25,2 @@ "webgl", | ||
"module": "dist/esm/index.js", | ||
"esnext": "dist/es6/index.js", | ||
"files": [ | ||
@@ -39,3 +38,3 @@ "dist", | ||
}, | ||
"gitHead": "29b92300bea8fc1b5c3fcca61302324c0bd578c7" | ||
"gitHead": "d40d72a2b16a54129c9608f2ca326b812903d856" | ||
} |
// @ts-nocheck TODO padding | ||
import WebMercatorViewport from './web-mercator-viewport'; | ||
import assert from './assert'; | ||
import {log2} from './math-utils'; | ||
@@ -74,3 +75,3 @@ // Returns map settings {latitude, longitude, zoom} | ||
const centerLngLat = viewport.unproject(center); | ||
const zoom = Math.min(maxZoom, viewport.zoom + Math.log2(Math.abs(Math.min(scaleX, scaleY)))); | ||
const zoom = Math.min(maxZoom, viewport.zoom + log2(Math.abs(Math.min(scaleX, scaleY)))); | ||
@@ -77,0 +78,0 @@ assert(Number.isFinite(zoom)); |
@@ -23,1 +23,7 @@ import * as vec4 from 'gl-matrix/vec4'; | ||
} | ||
function ieLog2(x) { | ||
return Math.log(x) * Math.LOG2E; | ||
} | ||
// Handle missing log2 in IE 11 | ||
export const log2 = Math.log2 || ieLog2; |
import WebMercatorViewport from './web-mercator-viewport'; | ||
import {mod} from './math-utils'; | ||
import {mod, log2} from './math-utils'; | ||
@@ -36,3 +36,3 @@ // defined by mapbox-gl | ||
// Zoom out map to fit map height into viewport | ||
zoom += Math.log2(height / (bottomY - topY)); | ||
zoom += log2(height / (bottomY - topY)); | ||
@@ -39,0 +39,0 @@ // Calculate top and bottom using new zoom |
// TODO - THE UTILITIES IN THIS FILE SHOULD BE IMPORTED FROM WEB-MERCATOR-VIEWPORT MODULE | ||
import {createMat4, transformVector} from './math-utils'; | ||
import {createMat4, transformVector, log2} from './math-utils'; | ||
@@ -28,3 +28,3 @@ import * as mat4 from 'gl-matrix/mat4'; | ||
export function scaleToZoom(scale) { | ||
return Math.log2(scale); | ||
return log2(scale); | ||
} | ||
@@ -31,0 +31,0 @@ |
@@ -149,3 +149,3 @@ import { Bounds, FitBoundsOptions } from "./fit-bounds"; | ||
/** @deprecated Legacy method name */ | ||
getLocationAtPoint({lngLat, pos}): number[]; | ||
getLocationAtPoint({lngLat, pos}: {lngLat: number[], pos: number[]}): number[]; | ||
@@ -152,0 +152,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
269065
69
3705
2