Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a method to override map.removeLayer #43

Closed
jscastro76 opened this issue Sep 9, 2020 · 2 comments
Closed

Create a method to override map.removeLayer #43

jscastro76 opened this issue Sep 9, 2020 · 2 comments
Assignees
Labels
🍏 feature New feature or request 🙏 suggestion Suggestion to consider
Milestone

Comments

@jscastro76
Copy link
Owner

As mentioned in #39 here map.removeLayer should also be able to remove the objects in the layer, but that´s not happening as the 3D objects are in tb.world.

@jscastro76 jscastro76 added 🍏 feature New feature or request 🙏 suggestion Suggestion to consider labels Sep 9, 2020
@jscastro76 jscastro76 modified the milestones: v2.0.5., v2.0.6. Sep 9, 2020
@jscastro76 jscastro76 self-assigned this Sep 15, 2020
@dianaow
Copy link

dianaow commented Oct 6, 2020

Could one possible way be this?

      map.removeLayer = function(id) { 
        this.tb.clear(true).then(d=>{
          console.log(d)
          map.style.removeLayer(id);
        })
      }

P.S How do i create a fork of your fork? (I have updated the code locally and am thinking of creating a PR for this)

@jscastro76
Copy link
Owner Author

Could one possible way be this?

      map.removeLayer = function(id) { 
        this.tb.clear(true).then(d=>{
          console.log(d)
          map.style.removeLayer(id);
        })
      }

P.S How do i create a fork of your fork? (I have updated the code locally and am thinking of creating a PR for this)

This will clear completely all the threebox objects in any layer, my approach for this is to consider there would be always multiple layers. I already have a draft for this method I’m working on other project.

Regarding the fork, you can do it from the main page of this repo, feel free to fork it.

jscastro76 added a commit that referenced this issue Oct 25, 2020
…e 3D objects of a layer, apart from removing the layer itself with `map.removeLayer`

- [**#56**](#56) Objects cache at `tb.loadObj`
  - `tb.loadObj` now is 100% async and in the first call to an object load by url, then caches the returned object for the sucessive calls to return a clone of the object through `obj.duplicate()`
  - Closes [**#51**](#51), [**#55**](#55)
- [**#57**](#57) Add a new sample to measure performance
  - Added new example to demonstrate add thousands of objects and measure performance [Threebox Performance](https://github.com/jscastro76/threebox/blob/master/examples/15-performance.html).
- [**#58**](#58) Refactor `tb.remove`
- [**#59**](#59) Refactor `tb.clear` to add `layerId`.
- [**#60**](#58) Refactor `tb.dispose`
- All the examples reviewed and updated and added to the [Examples list](https://github.com/jscastro76/threebox/blob/master/examples/readme.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍏 feature New feature or request 🙏 suggestion Suggestion to consider
Projects
None yet
Development

No branches or pull requests

2 participants