Topic: Elevation

Hello,

I just started to work with onlinemaps so all the code is rather overwhelming. Right now i want to start out with knowing the height of the terrain. So mouse position raycast, the point where the ray hits that part of the terrain i would like to know the height / elevation. So what should i be looking for using the height from google api? Or the bing elevation map? And im guessing most of the code is already in the assets but i haven't found it yet.

Sorry for the newbie question, sadly i only have a few hours a week to work on this so any help would be appreciated!

Re: Elevation

Hello.

Do you use a map with elevations?
How do you want to use this value?
I mean: to show on UI, to use in the further calculations (for example for positioning GameObjects), or somehow else?

Online Maps has many ways to get this value.
To give you the right way for your case, I need to know this.

Kind Regards,
Infinity Code Team.

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

Re: Elevation

Hi,

You can try this fragment of code that suitable for my needs.

private OnlineMapsControlBase3D cb3d;
private OnlineMaps om;
private float elevation;

private void Start()
{
    om = OnlineMaps.instance;
    cb3d = OnlineMapsControlBase3D.instance;
}
private void Update()
{
    RaycastHit hit = new RaycastHit();
    if(Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
    {
        elevation = cb3d.GetElevationValue(hit.point.x, hit.point.z, 1f, om.topLeftPosition, om.bottomRightPosition);
    }
}

Re: Elevation

Hello Alex,

Im working on a project where you can look around you with an augmented reality, we wanted to add an map mode to it so that is how we got to online maps. So we where placing objects in the augmented reality but we ran into an issue we where on a higher point in the area but we didn't know how high, we tried placing something on the other side of a lake but we didn't know the distance so the object had the wrong size for its area. So to make it easier to build our scene we though it would be nice to place the game objects using the map, we will get our location data because we are going to add a gps so when we know our position + map data we can place things perfectly, now have i been experimenting with the 3d markers and when elevation is active i will get an altitude but if i zoom in the altitude gives a different value. So yeah im looking for an accurate height in meters basically.

Any help will be appreciated
Thanks in advance

Sincerely Sander.

P.S i will check out and see if the code leviniarened posted works for me, i will update here on my status.

Re: Elevation

You can use the way that gave you leviniarened
+
Online Maps Tileset Control / Bottom - Zero.

Kind Regards,
Infinity Code Team.

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