Carlos,
I have made a sample to test CenterAt, it works properly. Everytime when I double click on the map, i will set red cross to center of map. I double click on Greenland, and then the GreenLand is show upon the red cross, and then I click Brazil, Brazil show upon the red cross.
private void WpfMap_Loaded(object sender, RoutedEventArgs e)
{
Map1.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(Map1_MouseDoubleClick);
Map1.MapUnit = GeographyUnit.DecimalDegree;
Map1.CurrentExtent = new RectangleShape(-155.733, 95.60, 104.42, -81.9);
WorldMapKitWmsWpfOverlay worldOverlay = new WorldMapKitWmsWpfOverlay();
Map1.Overlays.Add("WMK", worldOverlay);
InMemoryFeatureLayer layer = new InMemoryFeatureLayer();
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(PointSymbolType.Cross, new GeoSolidBrush(GeoColor.SimpleColors.Red), 20);
LayerOverlay overlay = new LayerOverlay();
overlay.Layers.Add("CenterPointLayer", layer);
Map1.Overlays.Add("CenterPointOverlay", overlay);
Map1.Refresh();
}
void Map1_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
System.Windows.Point p = e.GetPosition(this);
Map1.CenterAt((float)p.X, (float)p.Y);
LayerOverlay overlay = Map1.Overlays["CenterPointOverlay"] as LayerOverlay;
InMemoryFeatureLayer layer = overlay.Layers["CenterPointLayer"] as InMemoryFeatureLayer;
Feature centerPoint = new Feature(Map1.CurrentExtent.GetCenterPoint());
layer.InternalFeatures.Clear();
layer.InternalFeatures.Add(centerPoint);
Map1.Refresh();
}
Thanks,
James