1 (edited by bartosz.wolski 2018-05-14 13:27:45)

Topic: OnlineMaps Smooth Zoom problem

I am using OnlineMaps 2.5.36.1 version with your smoothZoom script :
infinity-code.com/viewtopic.php?pid=3165#p3165
I modified Demo example to fit my needs.
I am doing all this on Android Device and performing any actions with gestures (pinch to zoom etc).

I need the map to displayed in Portrait mode on full hd device,  55 inches screen.
I noticed that even when doing max zoom out possible I am not able to view whole world, and I am not able to move the map up/down.

After that I saw that its because in Scene view whole map is rendered but Camera Orthographic size was set in example to 250, so I did set it to 50% of the screen height, which results in beautiful whole map shown, so far everything works good.

But when trying to zoom in/out and when map scale is below 1.00, while x/y offset is applied to map so zoom looks natural, the texture is sometimes having offset and its rendered on about 85-95% of the screen.

Here is google drive link with project and video with problem recorded:
Link to video featuring the problem : https://drive.google.com/file/d/1dwFDc_ … 0-LAU/view


Edit: I tried using Smooth Zoom with option : Zoom Mode - Center
But it doesn't work and behave exactly the same as Zoom Mode - Target.

Re: OnlineMaps Smooth Zoom problem

Hello.

Your camera is not correctly centered.
You need to modify the script AdjustTilesetMapToScreen:

mainCamera.transform.position = new Vector3(-mapWidth * 0.5f, 1024, mapHeight * 0.5f);

In addition, you can slightly reduce the orthographic size to hide this border.

Kind Regards,
Infinity Code Team

3 (edited by bartosz.wolski 2018-05-15 08:20:49)

Re: OnlineMaps Smooth Zoom problem

Thanks for your reply, I tried out beta build and actually it works much much better and without any modifications all runs well.
This is probably thanks to your float zoom change.