Topic: Remove 3D markers?
Hi there,
We've enjoyed your product for a while, and a coworker of mine has asked questions on this site in the past when we were stuck. Unfortunately she left the project so now I hope I can get some help with a problem.
We are using your map to show 3D markers, and when you click on them you can get information. You select the info you want, the markers you want, the range and the zoom and icon such in Mendix, and then we retrieve the data in Unity. It all works fine, but now we want to be able to, when we teleport, request new data from Mendix. This works, but the old set of markers are still on the map. And I can't get them destroyed properly for the life of me.
They're 3D markers, so: OnlineMaps.instance.RemoveAllMarkers(); does not work unfortunately (I tried).
Currently I'm trying:
Foreach (OnlineMapsMarker3D marker3D in OnlineMaps.instance.GetComponent<OnlineMapsControlBase3D>.markers3D)
{
Destroy(marker3D.instance)
}
StartCoroutine(GetObject(latmlon)); //(this starts making the new markers at the new location, works just fine)
This gave about 300 Nullreference exceptions, and for some reason left a set of default markers on the same location the proper markers were. When you click on them, the canvas pops up with the default "New Text" on it. Why is it reverting the proper working markers with icons and text into defaults instead of just removing them entirely?
So to make it clear:
On startup: Markers load properly where Mendix says they should, with custom loaded icons and text.
On teleport: Markers at new location load properly, markers at old location turn into default icons with default textcanvas.
What am I doing wrong?