private void mapControl1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { MapControl mapControl = sender as MapControl; MapHitInfo hitInfo = mapControl.CalcHitInfo(e.Location); XtraMessageBox.Show(String.Format("hitInfo.InMapPolygon = {0}", hitInfo.InMapPolygon)); }
public static MapOverlayItemBase GetClickedOverlayItem(MapHitInfo hitInfo) { if (hitInfo.InUIElement) { MapOverlayHitInfo overlayHitInfo = hitInfo.UiHitInfo as MapOverlayHitInfo; if (overlayHitInfo != null) { return(overlayHitInfo.OverlayItem); } } return(null); }
private void MapControl_MouseDown(object sender, MouseEventArgs e) { MapHitInfo info = this.MapControl.CalcHitInfo(e.Location); if (info.InMapPushpin) { MapControl.EnableScrolling = false; foreach (object obj in info.HitObjects) { if (obj.GetType() == typeof(MapPushpin)) { _pin = (MapPushpin)obj; } } } }
void Default_DragDrop(object sender, PhotoDragDropEventArgs e) { if (e.Control != MapControl) { return; } MapHitInfo hitInfo = MapControl.CalcHitInfo(e.Location); GeoPoint point = (GeoPoint)MapControl.ScreenPointToCoordPoint(hitInfo.HitPoint); HitPoint = point; SplashScreenManager.ShowForm(FindForm(), typeof(WaitForm), true, true); SplashScreenManager.Default.SendCommand(DmWaitFormCommand.SetCaption, "Map"); SplashScreenManager.Default.SendCommand(DmWaitFormCommand.SetDescription, "Retreiving geo location info ..."); SplashScreenManager.Default.SendCommand(DmWaitFormCommand.SetUndefined, true); GeoCode.RequestLocationInformation(point, PhotoDragDpopHelper.Default.Photos); }
private void mapControl1_Click(object sender, EventArgs e) { MapHitInfo hitInfo = MapControl.CalcHitInfo(PointToClient(Control.MousePosition)); if (hitInfo.HitObjects == null || hitInfo.HitObjects.Length == 0 || !(hitInfo.HitObjects[0] is PhotoMapItem)) { HidePopupViewer(false); } else { HidePopupViewer(true); PhotoMapItem item = ((PhotoMapItem)hitInfo.HitObjects[0]); MapPoint point = MapControl.CoordPointToScreenPoint(item.Location); PopupViewer.Files = item.Files; this.flyoutPanel1.ShowBeakForm(MapControl.PointToScreen(new Point((int)point.X, (int)point.Y)), false, this, new Point(0, 40)); PopupViewer.Focus(); } }
void mapControl1_MouseUp(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return; } MapHitInfo hitInfo = MapControl.CalcHitInfo(e.Location); MapOverlayItemBase clickedItem = MapOverlayUtils.GetClickedOverlayItem(hitInfo); if (clickedItem == null) { return; } ClickedAction action = OverlayManager.GetClickedAction(clickedItem); switch (action) { case ClickedAction.NewGame: MapInteractiveEnabling(false); OverlayManager.ShowNewGameOverlay(); break; case ClickedAction.StartGame: GameInit(OverlayManager.GetSelectedLevel()); break; case ClickedAction.FinishGame: this.gameCore.FinishGame(); break; case ClickedAction.ShowCountry: this.gameCore.ShowCountry(); break; case ClickedAction.SkipCountry: this.gameCore.SkipCountry(); break; } }