Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@geoblocks/cesium-compass

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geoblocks/cesium-compass - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

50

cesium-compass.js

@@ -6,12 +6,6 @@ // Original code from TerriaJS

import {LitElement, css, svg, html} from 'lit-element';
import {styleMap} from 'lit-html/directives/style-map';
import {LitElement, css, svg, html} from 'lit';
import {styleMap} from 'lit/directives/style-map.js';
import Cartesian2 from 'cesium/Source/Core/Cartesian2';
import Cartesian3 from 'cesium/Source/Core/Cartesian3';
import Matrix4 from 'cesium/Source/Core/Matrix4';
import Transforms from 'cesium/Source/Core/Transforms';
import Ellipsoid from 'cesium/Source/Core/Ellipsoid';
import Ray from 'cesium/Source/Core/Ray';
import CesiumMath from 'cesium/Source/Core/Math';
import {Cartesian2, Cartesian3, Matrix4, Transforms, Ellipsoid, Ray, Math as CesiumMath} from 'cesium';

@@ -28,3 +22,3 @@ const vectorScratch = new Cartesian2();

const nominalTotalRadius = 145;
const norminalGyroRadius = 50;
const nominalGyroRadius = 50;

@@ -82,2 +76,5 @@

}
.rotation-marker, .outer-ring {
will-change: opacity, transform;
}
.rotation-marker, .outer-ring, .inner-ring {

@@ -101,3 +98,3 @@ position: absolute;

/**
* @type {import('cesium/Source/Scene/Scene').default}
* @type {import('cesium').Scene}
*/

@@ -107,3 +104,3 @@ this.scene;

/**
* @type {import('cesium/Source/Core/Clock').default}
* @type {import('cesium').Clock}
*/

@@ -162,5 +159,8 @@ this.clock = undefined;

/**
* @param {PointerEvent} event
*/
handlePointerDown(event) {
const camera = this.scene.camera;
const compassElement = event.currentTarget;
const compassElement = /** @type {HTMLDivElement} */ (event.currentTarget);
this.context.compassRectangle = compassElement.getBoundingClientRect();

@@ -190,3 +190,3 @@ this.context.compassCenter = new Cartesian2(

if (distanceFraction < norminalGyroRadius / nominalTotalRadius) {
if (distanceFraction < nominalGyroRadius / nominalTotalRadius) {
this.orbit(vector);

@@ -200,2 +200,5 @@ } else if (distanceFraction < 1) {

/**
* @param {Cartesian2} cursorVector
*/
rotate(cursorVector) {

@@ -218,2 +221,5 @@ const camera = this.scene.camera;

/**
* @param {PointerEvent} event
*/
handleRotatePointerMove(event) {

@@ -240,2 +246,5 @@ const camera = this.scene.camera;

/**
* @param {PointerEvent} event
*/
handleRotatePointerUp(event) {

@@ -277,2 +286,5 @@ document.removeEventListener('pointermove', this.handleRotatePointerMoveFunction, false);

/**
* @param {Cartesian2} cursorVector
*/
orbit(cursorVector) {

@@ -316,2 +328,6 @@ this.context.orbitIsLook = !this.context.viewCenter;

/**
* @param {Cartesian2} vector
* @param {number} compassWidth
*/
updateAngleAndOpacity(vector, compassWidth) {

@@ -327,2 +343,5 @@ const angle = Math.atan2(-vector.y, vector.x);

/**
* @param {PointerEvent} event
*/
handleOrbitPointerMove(event) {

@@ -336,2 +355,5 @@ clickLocationScratch.x = event.clientX - this.context.compassRectangle.left;

/**
* @param {PointerEvent} event
*/
handleOrbitPointerUp(event) {

@@ -338,0 +360,0 @@ document.removeEventListener('pointermove', this.handleOrbitPointerMoveFunction, false);

{
"name": "@geoblocks/cesium-compass",
"version": "0.3.0",
"version": "0.4.0",
"license": "BSD-3-Clause",

@@ -15,6 +15,5 @@ "repository": "github:geoblocks/cesium-helpers",

"dependencies": {
"lit-element": "2.x",
"lit-html": "1.x"
"lit": "2.x"
},
"gitHead": "d8c87055a8cf98d41b696b8774fc7bb503bc2855"
"gitHead": "0ee87e1503e54bfb4867b26527939cd18b2d3e0b"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc