Topic: Height of map changes when zoom changed with elevation on

When I change the zoom level with elevation on, the map jumps about in 3D space a lot. I was wondering how I could keep it from moving about.

This also happens when I toggle elevation, and I have to move the map down by a fixed amount to keep it in the same position.

Any reason this is happening, and if I could stop it?

Re: Height of map changes when zoom changed with elevation on

Hello.

By default (Use Elevation / Bottom - Zero), all map points have a real height, relative to the map size.
With zoom in, the real size of the map is reduced by half in width and height, but the size in the scene stay the same. So the elevation is drawn twice as much.
When using Bottom-Min Value, the Mesh zero point corresponds to the minimum height value. Try it. Perhaps this is what you need.

If you expect / want some other behavior, let's discuss this.

Kind Regards,
Infinity Code Team

Re: Height of map changes when zoom changed with elevation on

Hi,

I tried the min value thing before and still had the error, but then i tried it again, and it seemed to work! It's still a bit jumpy, in that if I change zoom, it'll go up, then readjust back down. Do the valleys correspond with zero, or are there no valleys?

Is there a way to do a smooth elevation, so that it gradually goes up with? I was thinking of playing around with elevation scale to mimic this, but had the problem where it'd jump up and down. But I was wondering if this doesn't work, if there's another way.

Cheers!

Re: Height of map changes when zoom changed with elevation on

Yes, you can tween the elevationScale to do this.
Example:

using UnityEngine;

public class TweenElevation:MonoBehaviour
{
    public AnimationCurve animation = AnimationCurve.Linear(0, 0, 1, 1);
    public float duration = 1;
    private float progress = 0;

    private void Start()
    {
        OnlineMapsTileSetControl.instance.elevationScale = 0;
        OnlineMapsTileSetControl.instance.OnElevationUpdated += OnElevationUpdated;
    }

    private void OnElevationUpdated()
    {
        OnlineMapsTileSetControl.instance.OnElevationUpdated -= OnElevationUpdated;
        OnlineMaps.instance.OnUpdateBefore += OnUpdateBefore;
    }

    private void OnUpdateBefore()
    {
        progress += Time.deltaTime / duration;
        if (progress >= 1)
        {
            progress = 1;
            OnlineMaps.instance.OnUpdateBefore -= OnUpdateBefore;
        }
        OnlineMapsTileSetControl.instance.elevationScale = animation.Evaluate(progress);
        OnlineMaps.instance.Redraw();
    }
}

But, this will work fine only if you do not use Allow Camera Control.
If you use Allow Camera Control, disable this before starting the animation, and then turn it back on after the animation ends.

Kind Regards,
Infinity Code Team

Re: Height of map changes when zoom changed with elevation on

I noticed if Bottom-Min Value was selected and I used OnlineMapsControlBase3D.instance.GetElevationValue to check the elevation of a point, the returned elevation value seemed to be relative to Min Value rather than sea level.  I get the true elevation if  Bottom-Zero is selected. But then I get the jumpy zooms nbhandari reported. Is there away to get the true elevations when Min Value is chosen?
thanks

Re: Height of map changes when zoom changed with elevation on

No, in the current version there is no such way (of course except reflection).
We added OnlineMapsTileSetControl.GetUnscaledElevationValue method, which will be available in the next version.

Kind Regards,
Infinity Code Team

Re: Height of map changes when zoom changed with elevation on

thanks