Topic: Troubles when zooming

Hi

I have a lineRenderer. It does redraw when the event OnlineMapsTileSetControl.OnMeshUpdated occurs, which allow me to keep it in the correct position when moving the map.

But, when i'm zooming "too much" (when i'm beyong the max zoom level -> i use an android tablet so as long as i don't release my finger when zooming i can go beyong the max zoom level) the lineRenderer is in an incorrect position.

As i don't want to wait for the user to release his finger to draw my lines in the correct position, i tried to use OnlineMapsTileSetControl.OnSmoothZoomProcess to update the lineRenderer constantly when zooming.

But it doesn't solve my problem.

OnlineMapsTileSetControl.OnSmoothZoomProcess is working though. (i can see my Debug.Log messages as long as i don't release my fingers).

Here is a GIF for a better understanding of the situation:

https://gph.is/2AmbZBs

What am i missing ?

Post's attachments

Attachment icon DronePathRenderer.cs 2.81 kb, 85 downloads since 2018-10-22 

Re: Troubles when zooming

Hello.

If you are working with a smooth zoom, I highly recommend you try Online Maps v3 beta.
Online Maps v3 has a built-in float zoom, and it will be MUCH easier to solve your problem.

To make it work in Online Maps v2, you need in GetWorldPositionWithAltitude to multiply p and transform.localScale.x of the map.

Kind Regards,
Infinity Code Team.

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

Re: Troubles when zooming

So after a deeper investigation, i noticed that there is no problem when my LineRenderer points have an altitude of 0.

The unwanted behaviour must be the result of this particular line in the GetWorldPositionWithAltitude function:

float yScale = control.GetBestElevationYScale(tlx, tly, brx, bry);

With tlx,tly,brx and bry beeing the result of map.GetCorners(out tlx, out tly, out brx, out bry);

I supposed that the corner of the map are not updated when the zoom is "in progress" between two levels so i tried to call "OnlineMaps.instance.UpdateCorners();" before trying to call "map.GetCorners" but it didn't solve my problem hmm

Re: Troubles when zooming

In Online Maps v2 only smooth zoom emulation, which is achieved by scaling the map GameObject.
This means that in fact it does not change the corners of the map.

Kind Regards,
Infinity Code Team.

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

Re: Troubles when zooming

p.y *= OnlineMaps.instance.transform.localScale.x;

It did the trick ! Thanks a lot.

I will consider using Online Maps v3 beta after my next dead-line