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

get all tiles that are in viewspace #48

Open
ji-podhead opened this issue Nov 17, 2022 · 2 comments
Open

get all tiles that are in viewspace #48

ji-podhead opened this issue Nov 17, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@ji-podhead
Copy link

ji-podhead commented Nov 17, 2022

i need to get all tiles that are in viewspace. Where can i safe them to an array, if they are not already saved somewhere?
thanks in advance:
leo

@tentone
Copy link
Owner

tentone commented Nov 17, 2022

You can get all the visible tiles by traversing the map object.

Check the method https://threejs.org/docs/#api/en/core/Object3D.traverse

All visible children objects will be the visible tiles. Something like this:

let tiles = [];
map.traverse((obj) => {
	if (obj.visible) {
		tiles.push(obj);
	}
});

@tentone tentone added the help wanted Extra attention is needed label Nov 17, 2022
@ji-podhead
Copy link
Author

ji-podhead commented Nov 17, 2022

thank you bro! this is extremely helpful :) i really love this project as well as your threejs-gameengine!! i really dont know about any other repo/package/api that can create a 3d-gis-map in three.js for free with react!!! if it wasnt for this repo, the last thing that would come to my mind would be: creating a material/3d object from an svg created with openlayers/etc. this repo is awesome and im really glad i found this!!! thank you bro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants