Topic: Deleting 3D Marker On Click

I'm trying to remove a marker when it's clicked on but I'm getting OnlineMapsControlBase3D doesn't contain the definition for RemoveMarker3D.

What do I need to change?:
    public OnlineMapsControlBase3D control;
    public GameObject markerPrefab;
    public OnlineMapsMarker3D marker3D;

    void Start()
    {
     
        if (control == null) control = OnlineMapsControlBase3D.instance;

     
        if (control == null)
        {
            Debug.LogError("You must use the 3D control (Texture or Tileset).");
            return;
        }

        Vector2 markerPosition = new Vector2(-93.25494f,  44.97129f);

        marker3D = control.marker3DManager.Create(markerPosition, markerPrefab);
     
        marker3D.range = new OnlineMapsRange(1, 50);

        marker3D.OnClick += OnMarkerClick;

     
    }
    private void OnMarkerClick(OnlineMapsMarkerBase marker)
    {
        Debug.Log(marker.label);
        control.RemoveMarker3D(marker);
     
    }

Re: Deleting 3D Marker On Click

Hello.

control.marker3DManager.Remove(marker as OnlineMapsMarker3D);

https://infinity-code.com/doxygen/onlin … a678291b62

Kind Regards,
Infinity Code Team.

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

Re: Deleting 3D Marker On Click

Now I'm getting the error: Cannot convert from OnlineMapsMarkerBase to OnlineMapsMarker3D.

Thanks!

Re: Deleting 3D Marker On Click

Oops. Sorry, I wrote a reply without checking.
I'll try to be more careful in the future.

I've updated the code above so as not to keep incorrect information on the forum.

Kind Regards,
Infinity Code Team.

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

Re: Deleting 3D Marker On Click

No worries, that worked!

Thanks for the help!