mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
721 stars 214 forks source link

Dynamic zoom iteration 4 #347

Open wilhelmberg opened 6 years ago

wilhelmberg commented 6 years ago

continuation from https://github.com/mapbox/mapbox-unity-sdk/pull/321


fixes

panning

Feels just a tad too slow at lower zoom levels and a tad too fast at higher zoom levels (+16):

ideas

zooming

Current DynamicZoom/QuadTreeLoader examples use center of view port when zooming in/out.

Next iteration should zoom in/out at the position under the mouse/gesture. Then it would feel more intuitive and similar to other slippy map implementations.

tilting

Additionally to a straight top down view next iteration (or iteration after next 😏) should allow for tilting, rotating camera. Depends on a quadtree(?) tile provider that supports loading lower zoom levels for areas that are further away.

abhishektrip commented 6 years ago

fixes

panning

Feels just a tad too slow at lower zoom levels and a tad too fast at higher zoom levels (+16):

After some investigation, this issue seems to be caused by the stretching that Web Mercator does at higher latitudes. Also, out while panning we are using the center of the viewport to compute the distance moved, which leads to inaccurate calculations and hence drift. To fix this issue, we should use the location under the mouse click for calculations.

wilhelmberg commented 6 years ago

@atripathi-mb

fixes panning

This worked in v2, see videos below. Tiles weren't moved on the fly but the exact same location was under the mouse after drag as before drag.

We should check if it is possible to apply the old logic to your new implementation.

v2 merge commit: f71b38ea7fe0bde7c55806fe6d7966ea88d9160c

EDIT DynamicZoom example still works as expected with latest develop as of today. But doesn't in v3 PR: https://github.com/mapbox/mapbox-unity-sdk/pull/321 EDIT

nolwenn-bigoin commented 6 years ago

Hello,

I would like to have a rotating camera on your zoomable map, and just saw on this discussion that you are (maybe) working on it. How is it going, will it be available soon ? Thanks.

abhishektrip commented 6 years ago

@nolwenn-bigoin Check out #527 , should have the rotating camera working.

nolwenn-bigoin commented 6 years ago

I've just tried it, and it's working great when rotating the camera on the yaw axis, thank you. But what about pitch ? Is there a way to limit the number of tiles, decrease the quality of those far away, ... to keep good performance while seeing large maps ?

abhishektrip commented 6 years ago

@nolwenn-bigoin Unfortunately, the current implementation does not limit the tiles or use different LOD tiles based on camera distance. We have plans to add this feature to our SDK in the future.

sonalranjit commented 6 years ago

Is this under active development?

abhishektrip commented 6 years ago

@sonalranjit It is available in current version of the SDK as an example. Anything specific you were looking for?

sonalranjit commented 6 years ago

@atripathi-mb i was noticing some delay when panning and I couldn't figure it out. By delay i mean the map doesn't follow the touch position that is panning. As mentioned above, it is really noticeable when it is further from the center of the screen. This is really evident on Android devices and Higher Zoom Levels ( > 16). For iOS its bearable, but it is more pronounced on Higher Zoom levels, I can make the pan speed variable with zoom, but I guess the transformation is based on the center of the screen rather than the touch position. I was just wondering if the fix you proposed above about the mouse/touch position for map updates is on the roadmap soon. I am on the latest 1.4.4 version of the SDK