private void Window_Loaded(object sender, RoutedEventArgs e) { InMemoryFeatureLayer inmemoryLayer = new InMemoryFeatureLayer(); inmemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City3; inmemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Forest1; inmemoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmemoryLayer.InternalFeatures.Add(new Feature(poupPoint)); LayerOverlay overlay = new LayerOverlay(); overlay.Layers.Add(inmemoryLayer); Map1.Overlays.Add("inMemoryOverlay", overlay); PopupOverlay popUpOverlay = new PopupOverlay(); Map1.Overlays.Add("popUpOverlay", popUpOverlay); Map1.MouseMove+=new MouseEventHandler(Map1_MouseMove); } PointShape poupPoint = new PointShape(0, 0); void Map1_MouseMove(object sender, MouseEventArgs e) { Point screenCoordinate = e.GetPosition(Map1); PointShape point = Map1.ToWorldCoordinate(screenCoordinate); PopupOverlay popupOverlay = Map1.Overlays["popUpOverlay"] as PopupOverlay; if (point.X < 180 && point.X > -180 && point.Y < 90 && point.Y > -90) { if (DecimalDegreesHelper.GetDistanceFromDecimalDegrees(point, poupPoint, DistanceUnit.Kilometer) < 1000) { if (popupOverlay.Popups.Count < 1) { Popup popUp = new Popup(poupPoint); popUp.Content = "x:0 y:0"; popupOverlay.Popups.Add(popUp); Map1.Refresh(popupOverlay); } } else { popupOverlay.Popups.Clear(); Map1.Refresh(); } } }