Hi,
We have problems getting the WrapDateline mode to work (panning continously both east and west of the dateline) with ShapeFileFeatureLayer in WinformsMap. Can you please guide us in the right direction?
We are using DesktopEdition.WinformsMap version 5.5
Short version of our code:
private readonly LayerOverlay _staticOverlay = new LayerOverlay { IsBase = true };
mapSuiteControl.BackgroundOverlay.BackgroundBrush = new GeoLinearGradientBrush(GeoColor.GeographicColors.ShallowOcean, GeoColor.GeographicColors.DeepOcean, GeoLinearGradientDirection.UpperLeftToLowerRight);
// add world layer
var layer = new ShapeFileFeatureLayer(Constants.MapBaseShapeFile, ShapeFileReadWriteMode.ReadOnly)
{ FeatureSource = {Projection = MapProjection.Geodetic} };
var pen = new GeoPen(GeoColor.StandardColors.OliveDrab);
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new HueFamilyAreaStyle(pen, GeoColor.StandardColors.PaleGreen, 6);
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
_staticOverlay.Layers.Add(MapLayer.BackgroundMap.ToString(), layer);
layer.Open();
ShapeFileFeatureLayer.BuildIndexFile(Constants.MapBaseShapeFile); // or layer.RequireIndex = false
layer.WrappingMode = WrappingMode.WrapDateline;
layer.WrappingExtent = layer.GetBoundingBox(); // or layer.WrappingExtent = new RectangleShape(-180,90,180,-90)
layer.Close();
Thanks
Jøran