Topic: Elevation in 3.0

I'm coming back to OnlineMaps after a lengthy break and am upgrading from 2.0 to 3.0.

In 2.0 there was a checkbox allowing elevation to be enabled and reflected in the geometry of the map. I notice that there doesn't appear to be that in 3.0. I've checked the documentation and searched the forum but can't seem to nail down an explanation of how to enable elevation that way in 3.0.

Could you point me in the right direction?

Thanks.

Re: Elevation in 3.0

Looking around, it seems like it's been split up into several different Elevation Managers for different sources. Is there someplace where I can go to learn the costs and benefits of the different sources? If possible, I'd like to avoid using a source that requires me to set up a billing plan, but I'd also like to know if there are reasons aside from cost to use one source over another.

Re: Elevation in 3.0

It appears that you've got Bing hardcoded in there if calls are made using the old way:

    [Obsolete("Use OnlineMapsElevationManager.OnElevationRequested")]
    public Action OnElevationRequested
    {
        get { return OnlineMapsBingMapsElevationManager.instance.OnElevationRequested; }
        set { OnlineMapsBingMapsElevationManager.instance.OnElevationRequested = value; }
    }

Re: Elevation in 3.0

Hello.

The main rule in the development of Online Maps v3 was not to break the existing projects of users who updates from Online Maps v2. So all changed APIs have an Obsolete attribute explaining how to update user scripts.

Use Elevation feature moved in separate scripts Online Maps XXX Elevation Manager, where XXX is the source of data.
Online Maps v3 supports elevation data from Bing Maps, ArcGIS and Mapbox.
Bing Maps requires an API key, and has a quota.
ArcGIS does not require any keys.
Mapbox requires a key, but (at least for now) requests for elevations data are not counted in the quota.

Kind Regards,
Infinity Code Team.

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

Re: Elevation in 3.0

Thanks, that's good to know. I'll go with ArcGIS for now.

Is there any reason to go with the others? Are they superior in some way that makes having a key worthwhile? Or is it more a matter of going with a data provider you're already coding for?

Re: Elevation in 3.0

Bing Maps - no. You will not get any benefits.
Mapbox - sometimes. This has tile based elevations, and it is much more convenient if you want to make caching 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 Quidam 2019-05-10 22:43:25)

Re: Elevation in 3.0

I'm now trying to update my callback events, since OnElevationUpdated has been moved. I was trying to use the following code so I don't have to specify which Elevation Manager I'm using in the code, but it's telling me an object reference is required. The action is defined in the base class. I'm sure I'm just rusty and missing something obvious.

            OnlineMapsElevationManagerBase.OnElevationRequested += OnElevationRequested;
            OnlineMapsElevationManagerBase.OnElevationFails += OnElevationFails;
            OnlineMapsElevationManagerBase.OnElevationUpdated += OnElevationUpdated;

Re: Elevation in 3.0

Looking at how you dealt with obsolete references, it seems I needed to add a reference to the instance:

            OnlineMapsElevationManagerBase.instance.OnElevationRequested += OnElevationRequested;
            OnlineMapsElevationManagerBase.instance.OnElevationFails += OnElevationFails;
            OnlineMapsElevationManagerBase.instance.OnElevationUpdated += OnElevationUpdated;

Re: Elevation in 3.0

Yes, all non-static methods, actions, fields, and properties require an instance.

Kind Regards,
Infinity Code Team.

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