Topic: Find needed zoom

Hi!
How I can find needed zoom for the map, that list of points would be visible in the screen. I have, for example,  some area, that could be represented by points with geo coordinates. So I need to predict needed map zoom, that this area would be visible in the screen with all these points.
I have tried OnlineMapsUtils.GetCenterPointAndZoom function, but it doesn't suitable in my case because my map tileset gameobject is bigger than the screen size.
Thanks!

Re: Find needed zoom

Hello.

You can solve this in two ways:
1. Simply reduce the zoom by 1 or 2 points, depending on the size of the map.
2. After GetCenterPointAndZoom, get the screen coordinates of the markers and make sure they are in the visible area. If at least one of the markers is hidden, reduce the zoom and check again.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Find needed zoom

Thanks for the reply.
But it doesn't help me. I have to zoom in/out in coroutine in given time, so I need to know target zoom on coroutine starting.
I'm using beta online maps version with float zoom.
Thanks!

Re: Find needed zoom

Why does not suit you the first way?
You can calculate this before coroutine.

Maybe I did not clearly set out the idea?!
I'll try to clarify a bit:
You use GetCenterPointAndZoom.
Subtract from the resulting zoom 1 or 2 points.
Next, use this value in your coroutine.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Find needed zoom

Thanks for helping.
Will try this variant.