some annotation / map fixes

This commit is contained in:
m-schuetz 2017-06-28 11:07:15 +02:00
parent 3be2f14926
commit 8c779f32e2
2 changed files with 9 additions and 12 deletions

View File

@ -292,7 +292,6 @@ Potree.MapView = class{
};
this.onAnnotationAdded = e => {
if(!this.sceneProjection){
return;
}
@ -321,7 +320,6 @@ Potree.MapView = class{
};
this.getAnnotationsLayer().getSource().addFeature(feature);
};
this.setScene(this.viewer.scene);
@ -342,9 +340,14 @@ Potree.MapView = class{
this.scene.addEventListener("pointcloud_added", this.onPointcloudAdded);
this.scene.annotations.addEventListener("annotation_added", this.onAnnotationAdded);
for(var i = 0; i < this.viewer.scene.pointclouds.length; i++){
this.load(this.viewer.scene.pointclouds[i]);
for(let pointcloud of this.viewer.scene.pointclouds){
this.load(pointcloud);
}
console.log("map.setScene");
this.viewer.scene.annotations.traverseDescendants(annotation => {
this.onAnnotationAdded({annotation: annotation});
});
}
getExtentsLayer(){

View File

@ -511,10 +511,10 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{
};
}
this.scene.annotations.addEventListener("annotation_added", this.onAnnotationAdded);
if(oldScene){
oldScene.annotations.removeEventListener("annotation_added", this.onAnnotationAdded);
}
this.scene.annotations.addEventListener("annotation_added", this.onAnnotationAdded);
}
};
@ -1183,13 +1183,7 @@ Potree.Viewer = class PotreeViewer extends THREE.EventDispatcher{
if(!this.getShowAnnotations()){
this.scene.annotations.traverseDescendants(descendant => {
if(!descendant.__visible || !descendant.visible){
return false;
}else{
descendant.__visible = false;
//descendant.domElement[0].style.display = "none";
descendant.domElement.fadeOut(200);
}
descendant.display = false;
return;
});