Topic: Markers

Hello Alex,
I work with markers.I want to get the position of marker and compare it with coordinates of world map.How can I do that so to display marker's label?
Thanks in advandance
John

Re: Markers

Hello.

Use marker.position or marker.GetPosition.
https://infinity-code.com/doxygen/onlin … 20d4968b61

Use OnlineMaps.InMapView.
https://infinity-code.com/doxygen/onlin … 3637fbe9cd

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 i_filippidis 2022-07-17 15:03:37)

Re: Markers

Hello Alex,
I use this to display label but it doesn't work.Where am I wrong? I have placed the script to gameObject.

void Update()
    {
        if (OnlineMapsControlBase.instance.GetCoords(transform.position) == marker.position)
        {
            Debug.Log(marker.label);
        }


    }

Re: Markers

1. OnlineMapsControlBase.GetCoords converts screen position to coordinates. If you want to convert world position to coordinates you need to use OnlineMapsTileSetControl.GetCoordsByWorldPosition.
https://infinity-code.com/doxygen/onlin … 1b58011257
2. This condition will never be true.
Both sides must have exactly the same coordinates for this to work, which is nearly impossible.

Please explain in detail what you want to do and I will try to explain how you can achieve it.

Kind Regards,
Infinity Code Team.

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

Re: Markers

I have a player(airplane) which moves on world map. I have placed markers in each capital of countries with label which gives information about countries. I want when player pass above the marker to display label with country information.

Re: Markers

Calculate the distance from the airplane to the marker.
If the distance is less than some threshold, you have reached the marker and need to show information.
https://infinity-code.com/atlas/online- … ample.html

Kind Regards,
Infinity Code Team.

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

Re: Markers

How can I do that?I don't understand I'm new in programming.Sorry

Re: Markers

Check out the example I sent you the link to.
Line 35 shows how to do this.

Kind Regards,
Infinity Code Team.

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

9 (edited by i_filippidis 2022-07-18 14:34:38)

Re: Markers

OK I read it again and I understand what you mean.I think I have it. Something else how can I do it for all markers?
Thanks in advantage

Re: Markers

Unfortunately, I didn't understand your question.
Please rephrase this 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: Markers

I want to do it for all markers that I placed in map.This display only one marker.How can I display for multiple markers?

Re: Markers

Iterate over all the markers and perform a distance check on each one.
How to iterate over all the markers (line 103):
https://infinity-code.com/atlas/online- … ample.html

Kind Regards,
Infinity Code Team.

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

Re: Markers

Do I need JSON FILE on this example?

Re: Markers

No. I pointed you to a specific line that you need to look at in order to understand how to iterate over all the markers.

Kind Regards,
Infinity Code Team.

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