dataarts / webgl-globe

WebGL Globe is a platform for visualizing latitude longitude based information using WebGL.
https://experiments.withgoogle.com/chrome/globe
Other
3.59k stars 1.15k forks source link

Proper way to delete markers #50

Open glampr opened 8 years ago

glampr commented 8 years ago

What would be the proper way to delete old markers, so that I can add new data?

rmckeel commented 8 years ago

Hey @glampr, I don't work on this project, but here's what I did:

In createPoints() add a 'name' to the line:

  function createPoints() {
...
      this.points.name = "line";
      scene.add(this.points);
    }
  }
  function removeAllPoints() {
    scene.remove(scene.getObjectByName("line"));
  }
...
this.removeAllPoints = removeAllPoints;

Did you find this useful? If so, I may create a PR.