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?

Re: Remove 3D markers?

Hello.

OnlineMaps.instance.RemoveAllMarkers this is for 2D markers.
To remove all 3D markers, use OnlineMapsControlBase3D.instance.RemoveAllMarker3D.
http://infinity-code.com/doxygen/online … 2f34cb159f

To remove a specific 3D marker, use OnlineMapsControlBase3D.RemoveMarker3D.
http://infinity-code.com/doxygen/online … 46c15d2eae

Kind Regards,
Infinity Code Team.

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

Re: Remove 3D markers?

Thank you for the quick response! This works perfectly!!

Re: Remove 3D markers?

Hello again Alex,

Now we're working on getting our polygons to work again. Is there a similar way to destroy all visisble polygons at once? The polygon markers are destroyed with the above statements, but the lines stay and that lags the computer big time.

Re: Remove 3D markers?

Hello.

OnlineMaps.RemoveAllDrawingElements
http://infinity-code.com/doxygen/online … 122f152765

Kind Regards,
Infinity Code Team.

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

Re: Remove 3D markers?

Thank you once again! That works brilliantly. And thanks for the link, now I know where to search before I ask!