Topic: OnClick event for lines

Hello, I'm currently using Online Maps Drawing API to create lines from point A to Point B (2d Map) but was wounding how to add an OnClick Event for the line just like the Marker OnClick event seen in the MarkerClickExample. Any help is greatly appreciated!!

Thanks

Re: OnClick event for lines

Hello.

In exactly the same way as for markers.
https://infinity-code.com/doxygen/onlin … 7c3bd5d9b1

Kind Regards,
Infinity Code Team.

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

Re: OnClick event for lines

Thank you, got it working smile

Re: OnClick event for lines

Hi there,

I must be doing something wrong then:

OnlineMapsDrawingElement line = OnlineMapsDrawingElementManager.AddItem(new OnlineMapsDrawingLine(points, Color, 0.75f));
line.tooltip = "Tooltip";
line.OnClick += Select_Route;

public void Select_Route(OnlineMapsDrawingElement line)
{
       Debug.Log("TEST");
}

Line is displayed correctly, but the function not triggered. Tooltip is working. Any idea would be highly appreciated!

Re: OnClick event for lines

I just tested the click on the line and it works correctly on my side.
Video:
https://www.dropbox.com/s/7gvn3d3x77frc … e.mp4?dl=0

Kind Regards,
Infinity Code Team.

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