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

wrong tile coordinates using react-fiber and fiber/drei #47

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

wrong tile coordinates using react-fiber and fiber/drei #47

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

Comments

@ji-podhead
Copy link

ji-podhead commented Nov 17, 2022

hi, im trying to set this package up with react and fiber, but the tiles that are fetched have wrong coordinates (totally of grid like: "https://a.tile.openstreetmap.org/14/8193/8189.png". i really dont know what im doing wrong here.
maybe the wrong tiles are getting loaded due to zoomlevel, or the scale of the map which is ({"x":40030223.8575236,"y":1,"z":40030223.8575236})
the first tiles that are fetched are actually valid, but i guess they get overwritten. -> you can find a complete console log of the fetched tiles below.

Ive tried multiple aproaches:

A) using basic MapControls

https://pastesite.org/view/8628e33c


B) using cubeCamera and OrbitControls, without using mapControls

https://pastesite.org/view/6b900f11


console log of fetched tiles without zooming or panning:

https://pastesite.org/view/fc0e90de


Are there any discord servers where i can ask about such topics? I find it quite hard to get infos about threejs in combination with react...
also: osm is creating that weird tile with red text, not sure what its saying...
Screenshot 2022-11-17 183130

Thanks in advance <3 ,
leo

@ji-podhead ji-podhead changed the title wrong tile coordinates using react-fibre and fibre/drei wrong tile coordinates using react-fiber and fiber/drei Nov 17, 2022
@ji-podhead
Copy link
Author

ji-podhead commented Nov 17, 2022

ok im quite sure that the problem comes from the scaling of the plane/sphere.... where is it set? when set the geometry to sphere, its not showing up in viewspace at, all, because the camera is inside the sphere i guess....

@ji-podhead
Copy link
Author

ji-podhead commented Nov 17, 2022

ok i solved this by setting the scale of the plane with map.scale.set method. would be awesome if you would add this to the manual, or add a default value of (100,1,100), since the scale-method is not called in your demo and took me 1 day to figure this out :(

@tentone
Copy link
Owner

tentone commented Nov 17, 2022

Hello

By default the system uses world scale coordinates in meters.

Might be a bit confusing for low scale scenes. Glad that you were able to figure it out.

Might improve later on documentation.

@tentone tentone added the help wanted Extra attention is needed label Nov 17, 2022
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