Topic: Connect multiple markers with a line

Hello
Is there a simple way to connect multiple 2d Markers with a line?
Thanks

Re: Connect multiple markers with a line

Hello.

OnlineMapsDrawingElementManager.AddItem(
    new OnlineMapsDrawingLine(
        OnlineMapsMarkerManager.instance.Select(m => m.position).ToArray(),
        Color.red,
        3));

But simple isn't always the best.

Kind Regards,
Infinity Code Team.

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

Re: Connect multiple markers with a line

thanks for the fast answer

Re: Connect multiple markers with a line

This looks like the solution i need but i need a bit of help implementing it.
Where do I put this script so that it connects my 2d markers in order with a line?

Re: Connect multiple markers with a line

Make your own script, and put that code in the right place.
The right place depends on your conditions and needs.
If you have created markers using the inspector, you can put this code in the Start method.

Kind Regards,
Infinity Code Team.

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

Re: Connect multiple markers with a line

That worked great, thank you!


Using the navigation script and navigation route drawer, I currently have a path set from wherever the user is when they open the app to a start point. They will then be following a predetermined trail. I have markers set in the inspector and they will follow them sequentially.

Using the code provided I have now been able to draw a line between markers, which works well. However it would be great if I could instead use google api to waypoint at each marker too.

Any suggestions how to go about this?

Re: Connect multiple markers with a line

Example: https://infinity-code.com/atlas/online- … ample.html

Kind Regards,
Infinity Code Team.

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