1 (edited by codemogen 2022-08-27 22:05:57)

Topic: [SOLVED] Anchor 3D object to the map.

Hello. As can be seen from the picture I shared, I want to fix a 3D object to a specific region on the map in this way. The goal is to mark the borders. the size ratio needs to be maintained automatically when zooming in and out. Is this possible? How can I do that? I would be very glad if you could help.

Post's attachments

Attachment icon Screen Shot 2022-08-25 at 18.05.50.png 292.55 kb, 47 downloads since 2022-08-26 

Re: [SOLVED] Anchor 3D object to the map.

Hello.

Your post does not contain a picture, which looks like an important part of the question.
Please reattach this.

Kind Regards,
Infinity Code Team.

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

3 (edited by codemogen 2022-08-26 10:48:57)

Re: [SOLVED] Anchor 3D object to the map.

I just updated the topic. When I change the zoom I want to rescale the green borders object. It is the 3D marker. I use Marker_3DExample. When I zoom in to map It has to rescale as bigger. But it saves the scale. How can I modify it? (like stick it)

Re: [SOLVED] Anchor 3D object to the map.

The easiest way is to set Marker 3D Manager / Marker [N] / Size Type - Real World in the inspector.
If you're creating a marker using the API, use marker3D.sizeType = SizeType.realWorld.
https://infinity-code.com/doxygen/onlin … 88ac04bdca

Kind Regards,
Infinity Code Team.

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

Re: [SOLVED] Anchor 3D object to the map.

Hello Alex, thank you for your attention. I also tried change the sizeType as realworld but it doesnt keep the actual scale of the prefab. It turns it to like very small value such as 0.058f. The 3d marker has OnlineMaps3DMarkerInstance component.

Re: [SOLVED] Anchor 3D object to the map.

You need to adjust the scale of the marker.
https://infinity-code.com/doxygen/onlin … c559bcf537

Kind Regards,
Infinity Code Team.

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

Re: [SOLVED] Anchor 3D object to the map.

In the marker have this component = "OnlineMapsMarker3DInstance"
And when I review the code inside this component ;
private void UpdateScale(OnlineMapsMarker3D marker3D)
    {
        if (marker3D.sizeType == OnlineMapsMarker3D.SizeType.scene) transform.localScale = new Vector3(_scale, _scale, _scale);
        else if (marker3D.sizeType == OnlineMapsMarker3D.SizeType.realWorld)
        {
            float coof = (1 << (OnlineMaps.MAXZOOM - _marker.manager.map.zoom)) * _marker.manager.map.zoomCoof;
            float s = _scale / coof;
            transform.localScale = new Vector3(s, s, s);
        }

        lastZoom = _marker.manager.map.floatZoom;
    }

scale update process working here. But even if I modify it doesn't work. It keeps the same scale for the marker object during the zoom change. I want the increase or decrease the scale depending zoom value. Because border size goes up when zooming in and my object scale has to be increasing. I would appreciate it If we can fix this.

Re: [SOLVED] Anchor 3D object to the map.

Why would you want to modify this?!
You need to specify marker3D.scale = SOMETHING in your script.

Kind Regards,
Infinity Code Team.

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

Re: [SOLVED] Anchor 3D object to the map.

But I can't give some static value because I try to explain that It has to change during the zoom change. For example If I set scale 600 It just save it as 600. I want to change the scale saving the aspect ratio during the zoom change. Is that possible?

Re: [SOLVED] Anchor 3D object to the map.

Yes, I summarize what I wrote above:

var marker3D = OnlineMapsMarker3DManager.CreateItem(borderPosition, borderPrefab); // Create 3D marker
marker3D.sizeType = SizeType.realWorld; // Set Size Type - Real World
marker3D.scale = SOMEVALUE; // Set a scale. You need to adjust this value.
Kind Regards,
Infinity Code Team.

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

Re: [SOLVED] Anchor 3D object to the map.

Hello Alex, thank you for your help!