@openglobus/og
Advanced tools
Comparing version 0.12.0 to 0.12.1
{ | ||
"name": "@openglobus/og", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "[OpenGlobus](http://www.openglobus.org/) is a javascript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers and 3d objects. It uses the WebGL technology, open source and completely free.", | ||
@@ -46,20 +46,20 @@ "directories": { | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.16.4", | ||
"@babel/preset-env": "^7.16.8", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@types/jest": "^27.0.3", | ||
"eslint": "^8.3.0", | ||
"@types/jest": "^27.4.0", | ||
"eslint": "^8.6.0", | ||
"jaguarjs-jsdoc": "^1.1.0", | ||
"jest": "^27.3.1", | ||
"jest": "^27.4.7", | ||
"jest-canvas-mock": "^2.3.1", | ||
"jest-webgl-canvas-mock": "^0.2.3", | ||
"jsdoc": "^3.6.7", | ||
"lint-staged": "^12.1.2", | ||
"lint-staged": "^12.1.7", | ||
"local-web-server": "^5.1.1", | ||
"msdf-bmfont-xml": "^2.5.4", | ||
"postcss": "^8.4.1", | ||
"prettier": "^2.5.0", | ||
"rollup": "^2.60.1", | ||
"postcss": "^8.4.5", | ||
"prettier": "^2.5.1", | ||
"rollup": "^2.63.0", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"typescript": "^4.5.2" | ||
"typescript": "^4.5.4" | ||
}, | ||
@@ -66,0 +66,0 @@ "lint-staged": { |
@@ -103,10 +103,7 @@ /** | ||
if (visibility !== this._visibility) { | ||
this._visibility = visibility; | ||
if (this._isBaseLayer && visibility) { | ||
this._planet.setBaseLayer(this); | ||
} else if (!visibility) { | ||
super.setVisibility(visibility); | ||
if (!visibility) { | ||
this.abortLoading(); | ||
} | ||
this._planet.updateVisibleLayers(); | ||
this.events.dispatch(this.events.visibilitychange, this); | ||
} | ||
@@ -132,3 +129,3 @@ } | ||
if (this._planet.layerLock.isFree()) { | ||
if (this._planet.layerLock.isFree() || material.segment.tileZoom < 2) { | ||
material.isReady = false; | ||
@@ -245,2 +242,4 @@ material.isLoading = true; | ||
while (pn.parentNode) { | ||
pn = pn.parentNode; | ||
psegm = pn.segment.materials[mId]; | ||
if (psegm && psegm.isReady) { | ||
@@ -250,4 +249,2 @@ notEmpty = true; | ||
} | ||
pn = pn.parentNode; | ||
psegm = pn.segment.materials[mId]; | ||
} | ||
@@ -254,0 +251,0 @@ |
@@ -155,3 +155,4 @@ /** | ||
if (this._planet.layerLock.isFree()) { | ||
// Q: Maybe we should change "<2" to material.segment.tileZoom < (material.layer.minZoom + 1) | ||
if (this._planet.layerLock.isFree() || material.segment.tileZoom < 2) { | ||
material.isReady = false; | ||
@@ -249,2 +250,4 @@ material.isLoading = true; | ||
while (pn.parentNode) { | ||
pn = pn.parentNode; | ||
psegm = pn.segment.materials[mId]; | ||
if (psegm && psegm.textureExists) { | ||
@@ -254,9 +257,6 @@ notEmpty = true; | ||
} | ||
pn = pn.parentNode; | ||
psegm = pn.segment.materials[mId]; | ||
} | ||
let maxNativeZoom = material.layer.maxNativeZoom; | ||
if (segment.loadTile) { | ||
if (segment.passReady) { | ||
let maxNativeZoom = material.layer.maxNativeZoom; | ||
if (pn.segment.tileZoom === maxNativeZoom) { | ||
@@ -318,3 +318,3 @@ material.textureNotExists(); | ||
material.textureExists = false; | ||
material.isLoading = false; | ||
material.isLoading = false; | ||
} | ||
@@ -321,0 +321,0 @@ |
@@ -278,3 +278,3 @@ "use strict"; | ||
if (altVis) { | ||
seg.loadTile = true; | ||
seg.passReady = true; | ||
this.renderNode(this.inFrustum, !this.inFrustum, terrainReadySegment, stopLoading); | ||
@@ -291,3 +291,3 @@ } else { | ||
} else if (altVis) { | ||
seg.loadTile = false; | ||
seg.passReady = maxZoom ? seg.terrainReady : false; | ||
this.renderNode(this.inFrustum, !this.inFrustum, terrainReadySegment, stopLoading); | ||
@@ -294,0 +294,0 @@ } else { |
@@ -818,9 +818,40 @@ /** | ||
_preRender() { | ||
// Zoom 0 | ||
this._quadTree.createChildrenNodes(); | ||
this._quadTree.segment.createPlainSegment(); | ||
this._quadTree.segment.createPlainSegment(); | ||
// Zoom 1 | ||
for (let i = 0; i < this._quadTree.nodes.length; i++) { | ||
this._quadTree.nodes[i].segment.createPlainSegment(); | ||
} | ||
// same for poles | ||
this._quadTreeNorth.createChildrenNodes(); | ||
this._quadTreeNorth.segment.createPlainSegment(); | ||
for (let i = 0; i < this._quadTreeNorth.nodes.length; i++) { | ||
this._quadTreeNorth.nodes[i].segment.createPlainSegment(); | ||
} | ||
this._quadTreeSouth.createChildrenNodes(); | ||
this._quadTreeSouth.segment.createPlainSegment(); | ||
for (let i = 0; i < this._quadTreeSouth.nodes.length; i++) { | ||
this._quadTreeSouth.nodes[i].segment.createPlainSegment(); | ||
} | ||
this._preLoad(); | ||
} | ||
_preLoad() { | ||
this._skipPreRender = false; | ||
// Zoom 0 | ||
this._quadTree.segment.passReady = true; | ||
this._quadTree.renderNode(true); | ||
this._normalMapCreator.drawSingle(this._quadTree.segment); | ||
// Zoom 1 | ||
for (let i = 0; i < this._quadTree.nodes.length; i++) { | ||
this._quadTree.nodes[i].segment.createPlainSegment(); | ||
this._quadTree.nodes[i].segment.passReady = true; | ||
this._quadTree.nodes[i].renderNode(true); | ||
@@ -830,4 +861,4 @@ this._normalMapCreator.drawSingle(this._quadTree.nodes[i].segment); | ||
this._quadTreeNorth.createChildrenNodes(); | ||
this._quadTreeNorth.segment.createPlainSegment(); | ||
// Same for poles | ||
this._quadTreeNorth.segment.passReady = true; | ||
this._quadTreeNorth.renderNode(true); | ||
@@ -837,3 +868,3 @@ this._normalMapCreator.drawSingle(this._quadTreeNorth.segment); | ||
for (let i = 0; i < this._quadTreeNorth.nodes.length; i++) { | ||
this._quadTreeNorth.nodes[i].segment.createPlainSegment(); | ||
this._quadTreeNorth.nodes[i].segment.passReady = true; | ||
this._quadTreeNorth.nodes[i].renderNode(true); | ||
@@ -843,4 +874,3 @@ this._normalMapCreator.drawSingle(this._quadTreeNorth.nodes[i].segment); | ||
this._quadTreeSouth.createChildrenNodes(); | ||
this._quadTreeSouth.segment.createPlainSegment(); | ||
this._quadTreeSouth.segment.passReady = true; | ||
this._quadTreeSouth.renderNode(true); | ||
@@ -850,3 +880,3 @@ this._normalMapCreator.drawSingle(this._quadTreeSouth.segment); | ||
for (let i = 0; i < this._quadTreeSouth.nodes.length; i++) { | ||
this._quadTreeSouth.nodes[i].segment.createPlainSegment(); | ||
this._quadTreeSouth.nodes[i].segment.passReady = true; | ||
this._quadTreeSouth.nodes[i].renderNode(true); | ||
@@ -932,2 +962,5 @@ this._normalMapCreator.drawSingle(this._quadTreeSouth.nodes[i].segment); | ||
} | ||
this._preLoad(); | ||
} else if (li._fading && li._fadingOpacity > 0) { | ||
@@ -934,0 +967,0 @@ if (li.hasImageryTiles()) { |
@@ -202,2 +202,8 @@ "use strict"; | ||
/** | ||
* Means that tree passage reach the segment, and the segment terrain is ready. | ||
* @type {boolean} | ||
*/ | ||
this.passReady = false; | ||
this.plainVertices = null; | ||
@@ -204,0 +210,0 @@ this.plainVerticesHigh = null; |
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
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
2351113
52778