Topic: Click Event for 3DMarker
Hi..
I added some 3DMarkers to the map but the OnClick events seem not to be fired.
// response comes from the OnlineMapsOSMAPIQuery
private OnComplete(string response)
{
// Some stuff which gets a node from OSM
OnlineMapsMarker3D marker3D;
OnlineMapsControlBase3D control = GetComponent<OnlineMapsControlBase3D> ();
marker3D = control.AddMarker3D (new Vector2 (node.lon, node.lat), markerPrefab);
marker3D.label = node.id;
marker3D.OnClick += OnMarkerClick;
Debug.Log ("DEBUG: " + String.Format ("Long: {0}, Lat: {1}", node.lon, node.lat));
markers.Add (marker3D);
}
}
private void OnMarkerClick (OnlineMapsMarkerBase marker)
{
Debug.Log ("DEBUG: " + marker.label);
}If I click on a marker in the editor or on my smartphone, nothing will be logged to the console.
Best, Michael