public static void AddRandomPointAnnotations(AppleMapsView map) { for (int i = 0; i <= 5; i++) { var location = new LocationCoordinate2D(i * 10, i * 10); var pointAnnotation = new PointAnnotation(location, "Title" + i, "Subtitle" + i) { PinTintColor = AppleMapsUtils.RandomColor() }; map.AddAnnotation(pointAnnotation); } }
void SetMapListeners() { // Add marker wherever user taps _map.SetOnClickListener(location => { var pointAnnotation = new PointAnnotation(location, "Yet another title", "Yet another subtitle", AppleMapsUtils.RandomColor(), Random.value > 0.5f); _map.AddAnnotation(pointAnnotation); }); // Invoked every time user selects pin annotation _map.SetOnPinSelectedListener((location, title, subtitle) => { Debug.Log(string.Format("Selected pin with location: {0}, title: {1}, subitle: {2}", location, title, subtitle)); }); }