You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
Is ther a way to click or touch in markers? I would like to add a listener to the markers to open a screen with the information of a place. But i don't know how do this. I add a listener, but it never get the action.
`GameObject markerGO = Instantiate(go) as GameObject;
map.CreateMarker("Point", map.CenterWGS84, markerGO);
MapInput.lat = map.CenterWGS84[0];
MapInput.lon = map.CenterWGS84[1];
double[] point = new double[2];
point[0] = map.CenterWGS84[0];
point[1] = map.CenterWGS84[1];
MapInput.sitios.Add(point);
markerGO.GetComponent().material.mainTexture = Resources.Load("green_marker") as Texture;
markerGO.GetComponent().material.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
Markers are not GUI objects, thus your approach won't work.
Clicks/taps should probably be handled in the MapInput class that would pass the events to the map, and in turn to the user or to the markers and then to the user.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello.
Is ther a way to click or touch in markers? I would like to add a listener to the markers to open a screen with the information of a place. But i don't know how do this. I add a listener, but it never get the action.
`GameObject markerGO = Instantiate(go) as GameObject;
map.CreateMarker("Point", map.CenterWGS84, markerGO);
MapInput.lat = map.CenterWGS84[0];
MapInput.lon = map.CenterWGS84[1];
double[] point = new double[2];
point[0] = map.CenterWGS84[0];
point[1] = map.CenterWGS84[1];
MapInput.sitios.Add(point);
markerGO.GetComponent().material.mainTexture = Resources.Load("green_marker") as Texture;
markerGO.GetComponent().material.color = new Color(1.0f, 1.0f, 1.0f, 1.0f);
markerGO.AddComponent().onClick.AddListener(() => OnClick());`
Thank you.
The text was updated successfully, but these errors were encountered: