-
Notifications
You must be signed in to change notification settings - Fork 213
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
What is range and zoom really doing? #50
Comments
@Naphier Apologies, the documentation is sort of nested: https://www.mapbox.com/mapbox-unity-sdk/docs/03-examples.html#mesh-generation-basics (documentation is still WIP).
Regarding the calculations and conversions, the world scale factor is recorded in Alternatively, you may want to write your own implementation of Can you share more about what sort of map you're trying to build? |
That description of range helps it to make sense. So if I have a tile size of say, 100 and range of 1,1,1,1 I would expect a 300m square. But that's also dependent on zoom level. According to documentation I can request zoom level of 0 - 22 (would be good if you guys limited this with a Range attribute in the Unity inspector). If I request less than 5 all I get are black textures (sometimes ? mark textures). If I request higher than 18 then the snap y to zero doesn't seem to work properly (tiles are maybe out of range of the raycast?). If I request higher than 19 then not only does the snap to y no longer work, but I also get ? mark textures. This is using . It seems that a zoom level of 17 is close to 1:1 when I'm using:
Ultimately, I think it would be more useful to Unity devs to be able to simply define a Unity world unit to map meters ratio, overall map size in Unity units (i.e. meters for most), and pixel density for images. I'm less concerned with entering a geographic bounds than just having control over the map unit to Unity world unit ratio. Does this make sense? |
This is not quite true.
Known issue: #42, apparently due to crazy scale values.
@brnkhy can you look into this snapping issue? Please note that zoom > 19 is technically only supported in certain locations.
If you ensure the localScale of That said, it might make sense to create another implementation of |
@Naphier |
Is there any reason for specifying the size of tile? It can be quite easily computed based on zoom. Each zoom has some specific resolution in meters per pixel of heightmap. Since we know the size of tile, which is 256, then given latitude, it is easily computed as 156543.03 meters/pixel * cos(latitude) / (2 ^ zoom). |
Yes. We figure some developers will want control over the "scale" of their world. Gigantic worlds can cause all sorts of bugs. However, this is just one implementation (which is why we're in the middle of abstracting maps and tile providers). Most of these are application specific, and many developers have different needs. Also:
|
Since we have added |
I've tried a few settings for these to get an idea, but they still seem to be a bit of a mystery and I cannot find a reference for them in the documentation. Is there an explanation I'm missing (maybe the API calls it something different)?
As a Unity developer I really need 2 things:
With those 2 things I can easily design my requests to get the tiles I need.
The text was updated successfully, but these errors were encountered: