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);
}