MCPcopy Create free account
hub / github.com/microsoft/SandDance / normalizeParameters

Function normalizeParameters

docs/tests/v2/es6/js/sanddance.js:39012–39034  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

39010}
39011
39012function normalizeParameters(opts) {
39013 var normalizedParams = Object.assign({}, opts);
39014 var viewport = opts.viewport,
39015 coordinateSystem = opts.coordinateSystem,
39016 coordinateOrigin = opts.coordinateOrigin,
39017 fromCoordinateSystem = opts.fromCoordinateSystem,
39018 fromCoordinateOrigin = opts.fromCoordinateOrigin;
39019
39020 if (fromCoordinateSystem === undefined) {
39021 normalizedParams.fromCoordinateSystem = coordinateSystem;
39022 }
39023
39024 if (fromCoordinateOrigin === undefined) {
39025 normalizedParams.fromCoordinateOrigin = coordinateOrigin;
39026 }
39027
39028 if (coordinateSystem === _constants.COORDINATE_SYSTEM.LNGLAT && viewport.zoom >= _viewportUniforms.LNGLAT_AUTO_OFFSET_ZOOM_THRESHOLD) {
39029 normalizedParams.coordinateSystem = _constants.COORDINATE_SYSTEM.LNGLAT_OFFSETS;
39030 normalizedParams.coordinateOrigin = [Math.fround(viewport.longitude), Math.fround(viewport.latitude)];
39031 }
39032
39033 return normalizedParams;
39034}
39035
39036function getWorldPosition(position, _ref) {
39037 var viewport = _ref.viewport,

Callers 1

projectPositionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected