Skip to content

Commit

Permalink
fix wfs
Browse files Browse the repository at this point in the history
  • Loading branch information
zarov committed Aug 9, 2018
1 parent 046a34c commit 244cf6f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/Core/MainLoop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EventDispatcher } from 'three';
import Layer from '../Core/Layer/Layer';
import GeometryLayer from '../Layer/GeometryLayer';
import Cache from '../Core/Scheduler/Cache';

export const RENDERING_PAUSED = 0;
Expand Down Expand Up @@ -128,9 +127,10 @@ MainLoop.prototype._update = function _update(view, updateSources, dt) {
updateSources.forEach((src) => {
const layer = src.layer || src;
if (layer instanceof Layer) {
if (!(layer instanceof GeometryLayer)) {
const parentLayer = view.getParentLayer(layer);
if (parentLayer) {
// add the parent layer to update sources
updateSources.add(view.getParentLayer(layer));
updateSources.add(parentLayer);
}
}
});
Expand Down
10 changes: 2 additions & 8 deletions src/Core/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function _preprocessLayer(view, layer, provider, parentLayer) {
}

if (!layer.whenReady) {
if (layer.type == 'debug' && !layer.object3d) {
if (parentLayer || layer.type == 'debug') {
// layer.threejsLayer *must* be assigned before preprocessing,
// because TileProvider.preprocessDataLayer function uses it.
layer.threejsLayer = view.mainLoop.gfxEngine.getUniqueThreejsLayer();
Expand Down Expand Up @@ -591,13 +591,7 @@ View.prototype.pickObjectsAt = function pickObjectsAt(mouseOrEvt, radius, ...whe
layerIdToLayer(this, source) :
source;

let parentLayer;
this.getLayers((l, p) => {
if (l.id == layer.id) {
parentLayer = p;
}
});

const parentLayer = this.getParentLayer(layer);
if (!parentLayer) {
const sp = layer.pickObjectsAt(this, mouse, radius);
// warning: sp might be very large, so we can't use '...sp' (we'll hit
Expand Down
22 changes: 10 additions & 12 deletions src/Layer/GeometryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,16 @@ class GeometryLayer extends Layer {
});

this.defineLayerProperty('opacity', 1.0, () => {
if (this.object3d) {
this.object3d.traverse((object) => {
if (object.layer !== this) {
return;
}
this.changeOpacity(object);
// 3dtiles layers store scenes in children's content property
if (object.content) {
object.content.traverse(this.changeOpacity);
}
});
}
this.object3d.traverse((object) => {
if (object.layer !== this) {
return;
}
this.changeOpacity(object);
// 3dtiles layers store scenes in children's content property
if (object.content) {
object.content.traverse(this.changeOpacity);
}
});
});

this.attachedLayers = [];
Expand Down

0 comments on commit 244cf6f

Please sign in to comment.