Topic: Is it possible to "lock" elevation data?

Hello, I'd have a couple of question about map elevation:

1) I've noticed that zooming on a map, each time that load a new elevation level not yet cached there's a quite unpleasant effect due to the elevation update.
I've seen an unpleasant effect also panning when the map is quite zoomed.
Would be possible to load the elevation data for a specific area, at a specific zoom level, and "lock" it so to use only these data to avoid this weird effect?

2) Is it possible wait on startup for the tile creation until the elevation data is downloaded?
I've read about the action OnElevationUpdated, but I don't know if is possible not to create the map on startup.

Thanks!

Re: Is it possible to "lock" elevation data?

Hello.

1. Yes, you can do this with OnlineMapsElevationManagerBase.OnGetElevation.
2. Yes, disable the hidden component of the map - MeshRenderer, and enable it again when elevations is downloaded (OnlineMapsElevationManagerBase.OnElevationUpdated).

P.S. To minimize this effect, use Camera Orbit / Adjust To - Center Point Elevation.
In the new version, I optimized the code to minimize this effect, and added Camera Orbit / Adjust To - Average Center, which also helps a little.

P.P.S. Here is the old script for v2.x. This smooths out elevations changes.
http://forum.infinity-code.com/viewtopi … 2757#p2757
It is easy to modify for v3.

Kind Regards,
Infinity Code Team.

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

3 (edited by danielesuppo 2019-05-02 12:14:37)

Re: Is it possible to "lock" elevation data?

Thank-you for your reply, but it seem to me that with "OnGetElevation" I can just intercept the request for elevation.
What I'd like to do is to load always the same elevation, independently from the zoom level of the map.
So, let's say that the map is zoom 12, I'd like to load the elevation as the map was zoom 16.
Next, when I zoom in or out, the elevation would be always loaded at zoom 16, regardless of the real map zoom level.
Is it possible?

Re: Is it possible to "lock" elevation data?

Yes, this is possible using OnGetElevation.

Kind Regards,
Infinity Code Team.

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

Re: Is it possible to "lock" elevation data?

Ok, I think to understand that I should disable the BingMapsElevationManager and call an elevation request with my preferred zoom level, but honestly I can't understand which function should I call...

I've looked BingMapsElevationManager, on RequestNewElevationData() there's a map.zoom, but if I use a specific value it only load the elevation for that specific zoom level

Maybe could you give me one more advice?..

Re: Is it possible to "lock" elevation data?

No, BingMapsElevationManager must be enabled.
When the map needs new elevation data, OnGetElevation will be invoked.
You must process the request, and pass to BingMapsElevationManager your elevation data.

Kind Regards,
Infinity Code Team.

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

7 (edited by danielesuppo 2019-05-02 13:48:01)

Re: Is it possible to "lock" elevation data?

I'm sorry to bother you so much with this but I'm not so skilled...
Yes, I understood that I should do

void OnGetElevation(double leftLongitude, double topLatitude, double rightLongitude, double bottomLatitude)
        {
            short[,] elevation = new short[32, 32];

            // Process the request -- how?

            OnlineMapsBingMapsElevationManager.instance.SetElevationData(elevation);
        }

but how to process the request?
Should I use OnlineMapsElevationManagerBase.instance.RequestNewElevationData() ?
I don't think so, because it does not return the elevation, and I can't pass in this method the preferred zoom level...

Re: Is it possible to "lock" elevation data?

The coordinates of the area for which elevation data is needed are passed to this method.
You need to fill the array with elevation values.

http://forum.infinity-code.com/viewtopi … 2892#p2892
http://forum.infinity-code.com/viewtopi … 1420#p1420

Kind Regards,
Infinity Code Team.

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