Topic: No way to set the visibilty of a 3DMarker

There is no way to reliably set the visibility of a 3DMarker.

The visible property, which was previously public, is now private. This makes sense, as it looks like the tool is using this to hide or show the marker based on if it is offscreen and such.

The issue is that the visible property sets the gameobject either active or inactive based on this, which means that the marker's gameobject can't be set to inactive (outside of the OnlineMaps code) to hide it either, because the visible property will change this on Update.

There should be some other property or logic that controls if the marker should be shown in general.

Re: No way to set the visibilty of a 3DMarker

Fixed this by adding a "ShowMarker" private variable and Property. Updated logic in the visible property as well:

protected bool visible
    {
        get { return _visible; }
        set
        {
            _visible = value;

            if (_visible && _showMarker)
            {
                instance.SetActive(true);
            }
            else if(_visible && !_showMarker)
            {
                instance.SetActive(false);
            }
            else if(!_visible)
            {
                instance.SetActive(false);
            }
        }
    }

    /// <summary>
    /// Adds control over the visibility of a marker without affecting the "_visible" logic
    /// that is in place.
    /// </summary>
    public bool ShowMarker
    {
        get
        {
            return _showMarker;
        }
        set
        {
            _showMarker = value;

            if(_visible && _showMarker)
            {
                instance.SetActive(_showMarker);
            }
            else if(!_showMarker)
            {
                instance.SetActive(false);
            }
        }
    }

Re: No way to set the visibilty of a 3DMarker

Hello.

Use OnlineMapsMarkerBase.enabled.
http://infinity-code.com/doxygen/online … aac7ed8d01

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!