Topic: Adding 3D Models, Not Markers, To The Map

I am sure this is discussed somewhere, I just haven't been able to locate it.
I was wondering if there was an example of adding a 3D object to the map at a set lat/long and altitude/height off map, but not have it scale with zoom. I see the example for the 3D markers, but I do not want the 3D object to scale as I zoom, but I do want it locked to the proper place (lat/long) on the map as I translate the map. Some example uses for this would be showing a real scale drone/airplane flying in an area, and the second use I want this for is for displaying custom 3D models of buildings. If there is some other approach I am missing for this please let me know. 

Again thank you.

Re: Adding 3D Models, Not Markers, To The Map

Hello.

Example with markers:
http://infinity-code.com/atlas/online-m … ample.html

I saw that you do not want to use markers.
But in this example, you can see the way to implement what you want to do.

Kind Regards,
Infinity Code Team.

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

Re: Adding 3D Models, Not Markers, To The Map

Alex Vertax, in your example I see no way to add the marker at the required geopositional coordinated. Do I need to do the follow to add 2D marker on the point with longitude lon and latitude lat?
map.AddMarker(new Vector2 (lat, lon));

One more question. What do I need to do for adding my 3D-model at (lon, lat) to the map?

Re: Adding 3D Models, Not Markers, To The Map

Unfortunately, I did not understand your first question.
Please rephrase it.

If your model can be a marker, then use OnlineMapsControlBase3D.AddMarker3D:
http://infinity-code.com/doxygen/online … 772d217de3
If your model for some reason can not be a marker, then you need to position it manually by converting coordinates to Unity World Position using OnlineMapsTileSetControl.GetWorldPosition:
http://infinity-code.com/doxygen/online … 2992c6e097

Kind Regards,
Infinity Code Team.

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

5 (edited by adri2111 2018-06-08 07:20:42)

Re: Adding 3D Models, Not Markers, To The Map

I try to "special building" on a particular position (long and lat). My first step was to make a Marker3D but it had been scale with the zoom feature and I want to keep a the map scale equals to the buildings behaviour.
I don't undestand how can I do with your last post. How can I use the OnlineMapsTileSetControl.GetWorldPosition? Some other idea?

Thanks

Re: Adding 3D Models, Not Markers, To The Map

Example:

using UnityEngine;

public class MyAwesomeBuilding: MonoBehaviour
{
    public double longitude;
    public double latitude;

    /// <summary>
    /// Zoom, when the scale = 1.
    /// </summary>
    public int defaultZoom = 15;

    private void Update()
    {
        transform.position = OnlineMapsTileSetControl.instance.GetWorldPosition(longitude, latitude);

        float originalScale = 1 << defaultZoom;
        float currentScale = 1 << OnlineMaps.instance.zoom;
        float scale = currentScale / originalScale;
        transform.localScale = new Vector3(scale, scale, scale);
    }
}
Kind Regards,
Infinity Code Team.

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

Re: Adding 3D Models, Not Markers, To The Map

Thanks!!!
It fixed my problem

Kind Regards