private void OnGroundOverlayClick(object sender, GoogleMap.GroundOverlayClickEventArgs e) { GroundOverlay gover = e.GroundOverlay; if (gover.Id.Equals(_enemyOverlay.Id)) // The ID of a specific marker the user clicked on. { Toast.MakeText(this, "Moyanita pretenciosa!", ToastLength.Short).Show(); var intent = new Intent(this, typeof(FightActivity)); intent.PutExtra("Enemy", "Moyanita"); StartActivity(intent); } }
void OnGroundOverlayClick(object sender, GoogleMap.GroundOverlayClickEventArgs e) { // clicked ground overlay var nativeItem = e.GroundOverlay; // lookup overlay var targetOuterItem = GetItems(Map).FirstOrDefault( outerItem => ((NativeGroundOverlay)outerItem.NativeObject).Id == nativeItem.Id); // only consider event handled if a handler is present. // Else allow default behavior of displaying an info window. targetOuterItem?.SendTap(); }