Topic: Real world mapping

How do I have a Unity object above the map in the correct location, scale, and a chosen elevation above the locations elevation on the map?

Is there an example?

I don't see in the API a way to tell what y (height) parameters for the object should be and what in what units (meters).

Is a OnlineMapsMarker3D the only way as these seemed to be located on the surface only as they don't have elevation parameters?

Re: Real world mapping

Hello.

Example how to change the scale of markers by zoom:
http://infinity-code.com/atlas/online-m … ample.html
But scale it is not meters or units. It's just a relative value.
So you need to make a marker that, for example, when zoom=15 has size=1 unit.
In this case at zoom=14 it will have a size=0,5 units, etc.

Example how to make the altitude, see in «Assets / Infinity Code / Online Maps / Examples / Scripts / Aircraft.cs».
Altitude in meters.

Kind Regards,
Infinity Code Team.

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

Re: Real world mapping

The example keeps a marker at a constant scale despite map scale changes. What I was asking is how do i scale a marker to match the scale of the map in real world units?

Let say a marker is a one hundred meter cube. How do I scale it so that when placed on a map it is always in the correct base dimensions and height for the scale of the map?

An example of this is simply wanting to place 3D buildings on a map.

Additionally, I am trying to evaluate this Asset for purchase. I can't see the Aircraft.cs code. Can you supply a snippet or tell me what API calls allow for the aircraft to fly at the proper scale above the ground?

Re: Real world mapping

I understand it.
I'm just trying to explain that the map does not know real size of your GameObject.

Let us suppose you have GameObject with the structure:
Prefab (Scale - 1, 1, 1) / Cube (Scale - 1, 1, 1).
The real size of GameObject (1, 1, 1).
But you can have GameObject:
Prefab (Scale - 1, 1, 1) / Cube (Scale - 10, 10, 10).
GameObject have Scale (1, 1, 1), but the real size (10, 10, 10).
Map does not know it. Actually, the map does not need to know it.

To work around this problem, you use this example.

Step-by-step instruction:
1. Run the scene and find the location where building should be.
2. Create a new empty GameObject.
3. Create a an instance of the building as a child of the empty GameObject.
4. Adjust the building GameObject on the map.
5. Create a prefab from the outer GameObject.
6. Reset position of building in prefab.
7. Set position.y building so that the bottom of the building was to 0.
Otherwise, you can have part of the building below the map.
8. Use a prefab as 3d marker in the example.

In this case, you will always have the correct size of the building.

Script «Aircraft.cs» attached.

Post's attachments

Attachment icon Aircraft.cs 3.29 kb, 346 downloads since 2016-08-03 

Kind Regards,
Infinity Code Team.

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