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

Scaling issue #83

Open
RodrigoHamuy opened this issue Sep 21, 2024 · 4 comments
Open

Scaling issue #83

RodrigoHamuy opened this issue Sep 21, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@RodrigoHamuy
Copy link
Contributor

Do we know why scaling seems to be quite off?

Sandobx: https://codesandbox.io/p/sandbox/gzl9tv

image

I took the Chaillot data points from https://rodrigohamuy.github.io/react-three-map/?source=true&story=extrude-coordinates--extrude-coordinates#ladle_loc_13

@tentone
Copy link
Owner

tentone commented Sep 26, 2024

Hello

This is expected from the deformation in the tiles projection

We could implement a strategy to fix deformation maybe by resizing the map based on where we are looking at or similar

@tentone tentone added the enhancement New feature or request label Sep 26, 2024
@RodrigoHamuy
Copy link
Contributor Author

@tentone , In the meantime we are using import { pointToTile, tileToBBOX } from "@mapbox/tilebelt"; to set the root node to fix scaling, if it helps for inspiration.

But if there is a nicer solution in the future that would be great.

Hot fix example: https://codesandbox.io/p/sandbox/geo-three-scale-hot-fix-2qnmxw

image

@tentone
Copy link
Owner

tentone commented Oct 1, 2024

This would be a good solution for the issue, scaling based on the map point.

I think that we should move this code into a separate util that can be attached to the map instance.

@cyango
Copy link

cyango commented Oct 2, 2024

I'm trying very hard to make the map work in my project with the correct scale. In my case i don't want to change the map position, but move the camera to the correct coordinates of the map instead. Is it possible?

Also the scaling and positioning seems very confusing:
setting the map to
map.scale.set(0.01, 0.01, 0.01);

map is too small, so i set the scale to 1000 and its visible

I try UnitsUtils.datumsToSpherical(lat, lng); and set the r3f MapControls to the position and target position but the vector3 values are thousands and it positions the camera very far away from the map.

@tentone can you give a bit more details on how these scaling and positions work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants