Scott,
I wrote a simple example, see below.
And run it with eval 4.5 + daily build from around 6/6
And run it with full version with WpfDesktopEditionFull5.0.42.0DllPackage from today
On each version I grab the marker originally in Poland to Russia, then it is supposed return to Poland, then I grab it from Poland and move it to Spain
In 4.5 It disappears from each of those places after each drag and re-appears in Poland
In 5.0 it correctly reappears in Poland but each time one stays in Russia and Spain, basically the marker gets copied. But when you pan the map those two copies do not move with the map, as if they are on a different overlay
I attached screenshots
Take care
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.WpfDesktopEdition;
namespace CDMProtoGui
{
///
/// Interaction logic for Window1.xaml
///
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Set the Map Unit. The reason for setting it to DecimalDegrees is that is what the shapefile’s unit of measure is inherently in.
wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
// We create a new Layer and pass the path to a Shapefile into its constructor.
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Wpf Desktop Evaluation Edition 4.5\Samples\CSharp Samples\SampleData\Data\Countries02.shp");
// Set the worldLayer with a preset Style, as AreaStyles.Country1 has YellowGreen background and black border, our worldLayer will have the same render style.
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
// This setting will apply from ZoonLevel01 to ZoomLevel20, that means we can see the world the same style with ZoomLevel01 all the time no matter how far we zoom out/in.
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Create a new Layer Overlay to hold the layer we just created
LayerOverlay layerOverlay = new LayerOverlay();
// Add a background Layer
layerOverlay.Layers.Add(new BackgroundLayer(new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)));
// Add the shapefile layer to the layer overlay
layerOverlay.Layers.Add(worldLayer);
// We need to add the layerOverlay to map.
wpfMap1.Overlays.Add(layerOverlay);
// Set a proper extent for the Map.
wpfMap1.CurrentExtent = new RectangleShape(0, 78, 30, 26);
// marker
DoMarker();
// We now need to call the Refresh() method of the Map control so that the Map can redraw based on the data that has been provided.
wpfMap1.Refresh();
}
void DoMarker()
{
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay();
markerOverlay.DragMode = MarkerDragMode.Drag;
Marker marker = new Marker(new PointShape(18.6, 53.0333333));
markerOverlay.Markers.Add("m", marker);
wpfMap1.Overlays.Add("MarkerOverlay", markerOverlay);
markerOverlay.MarkerDragged += new EventHandler<markerdraggedsimplemarkeroverlayeventargs>(markerOverlay_MarkerDragged);
}
void markerOverlay_MarkerDragged(object sender, MarkerDraggedSimpleMarkerOverlayEventArgs e)
{
SimpleMarkerOverlay sm = (SimpleMarkerOverlay)wpfMap1.Overlays["MarkerOverlay"];
sm.Markers.Remove("m");
sm.Markers.Clear();
wpfMap1.Overlays.Remove("MarkerOverlay");
DoMarker();
wpfMap1.Refresh();
}
private void Window_Loaded()
{
}
}
}
</markerdraggedsimplemarkeroverlayeventargs>
4.5 after dragging twice to Russia and Spain
<markerdraggedsimplemarkeroverlayeventargs>
5.0 after dragging twice to Russia and Spain
</markerdraggedsimplemarkeroverlayeventargs>