Topic: Set marker altitude to match 3d map height

Hey!
I'm trying to set marker.altitude to match the height of 3d map.

marker = GetComponent<OnlineMapsMarker3DInstance>().marker as OnlineMapsMarker3D;
OnlineMaps api = OnlineMaps.instance;
OnlineMapsTileSetControl control = OnlineMapsTileSetControl.instance;
OnlineMapsControlBase3D tscb = OnlineMapsControlBase3D.instance;
double tlx, tly, brx, bry;
api.GetCorners(out tlx, out tly, out brx, out bry);
float bestYScale = tscb.GetBestElevationYScale(tlx, tly, brx, bry);
var h = tscb.GetElevationValue(transform.position.x, transform.position.z, bestYScale, api.topLeftPosition, api.bottomRightPosition);
marker.altitude = h;

But the marker is below of ground level. Is there a way to do this?

Re: Set marker altitude to match 3d map height

Hello.

This is because

var h = tscb.GetElevationValue(transform.position.x, transform.position.z, bestYScale, api.topLeftPosition, api.bottomRightPosition);

automatically scales the value.
Just do not use bestYScale:

var h = tscb.GetElevationValue(transform.position.x, transform.position.z, 1, api.topLeftPosition, api.bottomRightPosition);
Kind Regards,
Infinity Code Team.

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

Re: Set marker altitude to match 3d map height

Thanks for reply. Already tested with a value of 1. My mistake was in Elevation | Bottom should be Zero instead of Min Value.

Re: Set marker altitude to match 3d map height

leviniarened wrote:

But the marker is below of ground level. Is there a way to do this?

So altitude is above sea level, or ... ?

Setting a marker with altitude 0, is well below the map (sea level).

thanks

Re: Set marker altitude to match 3d map height

If this is a question, please rephrase it in more detail.

Kind Regards,
Infinity Code Team.

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

Re: Set marker altitude to match 3d map height

if i set marker altitude = 0, i assumed marker will be at sea level.

instead, the marker is visible way below (underneath) the map.

i therefore want to know, what does altitude=0 represent ?

Re: Set marker altitude to match 3d map height

This is a bug in Online Maps when using "Use Elevation / Bottom - Min Value".
The problem is fixed, and in the next version it will work correctly.
Thank you for showing me this problem.

Kind Regards,
Infinity Code Team.

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