globe.gl 2.35.0 → 2.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/globe.gl.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version 2.35.0 globe.gl - https://github.com/vasturiano/globe.gl
1
+ // Version 2.36.0 globe.gl - https://github.com/vasturiano/globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -133688,18 +133688,21 @@ var<${access}> ${name} : ${structName};`;
133688
133688
  var globeR = state.globe.getGlobeRadius();
133689
133689
  var controls = state.renderObjs.controls();
133690
133690
  state.renderObjs.camera().near = 0.05; // less will start causing depth z-fighting issues
133691
- controls.minDistance = globeR * (1 + Math.max(1e-5, state.renderObjs.camera().near * 0.012)); // just above the surface, as much as camera near plane permits
133691
+ controls.minDistance = globeR + Math.max(0.001, state.renderObjs.camera().near * 1.1); // just above the surface, as much as camera near plane permits
133692
133692
  controls.maxDistance = globeR * 100;
133693
133693
  controls.enablePan = false;
133694
133694
  controls.enableDamping = true;
133695
133695
  controls.dampingFactor = 0.1;
133696
133696
  controls.rotateSpeed = 0.3;
133697
133697
  controls.zoomSpeed = 0.3;
133698
+ controls.zoomToCursor = true;
133698
133699
  controls.addEventListener('change', function () {
133700
+ controls.target.setScalar(0); // Keep orbit target on center
133701
+
133699
133702
  // adjust controls speed based on altitude
133700
133703
  var pov = _this.pointOfView();
133701
133704
  controls.rotateSpeed = pov.altitude * 0.3;
133702
- controls.zoomSpeed = Math.sqrt(pov.altitude) * 0.4;
133705
+ controls.zoomSpeed = Math.sqrt(pov.altitude) * 0.5;
133703
133706
 
133704
133707
  // Update three-globe pov when camera moves, for proper hiding of elements
133705
133708
  state.globe.setPointOfView(state.renderObjs.camera());