With a layer overlay I write the code below to warap the google map at the dateline.
googleOverlay.WrappingMode = WrappingMode.WrapDateline;
How can I do this for the MapPrinterLayer. Here is my code(I have coloured orange the code with problem.):
// Create the MapPrinterLayer and set the position
MapPrinterLayer mapPrinterLayer = new MapPrinterLayer();
//Map Printer Layer is in feet (State Plane Texas North Central Feet NAD83)
mapPrinterLayer.MapUnit = GeographyUnit.Meter;
//Set the extent of the MapPrinterLayer with world coordinates.
RectangleShape currentExtent = new RectangleShape(17897271, -1367305, 19514067, -2411741);
// mapPrinterLayer.MapExtent = currentExtent;
mapPrinterLayer.BackgroundMask = new AreaStyle(new GeoPen(GeoColor.StandardColors.Black, 1));
mapPrinterLayer.Open();
// Set the maps position slightly above the page center and 8 inches wide and 7 inches tall
RectangleShape pageBoundingbox = GetPageBoundingBox(PrintingUnit.Inch,wpfPrint);
mapPrinterLayer.SetPosition(8, 7, pageBoundingbox.GetCenterPoint().X, pageBoundingbox.GetCenterPoint().Y + 1, PrintingUnit.Inch);
// Setup the intial extent and ensure they snap to the default ZoomLevel
ZoomLevelSet zoomLevelSet = new ZoomLevelSet();
mapPrinterLayer.MapExtent = ExtentHelper.ZoomToScale(zoomLevelSet.ZoomLevel03.Scale, new RectangleShape(-10000000, 10000000, 10000000, -10000000), mapPrinterLayer.MapUnit, (float)mapPrinterLayer.GetBoundingBox().Width, (float)mapPrinterLayer.GetBoundingBox().Height);
GoogleMapsLayer googleMapLayer = new GoogleMapsLayer();
googleMapLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException;
LayerOverlay googleOverlay = new LayerOverlay();
googleOverlay.Layers.Add(googleMapLayer);
googleOverlay.WrappingMode = WrappingMode.WrapDateline;
googleMapLayer.WebProxy = System.Net.WebProxy.GetDefaultProxy();
googleMapLayer.CacheDirectory = @"C:\temp\GEMapLayerCache2";
googleMapLayer.TileMode = GoogleMapsTileMode.MultiTile;
googleMapLayer.MapType = GoogleMapsMapType.Satellite;
mapPrinterLayer.Layers.Add(googleMapLayer);
// Add the MapPrinterLayer to the PrinterInteractiveOverlay
PrinterInteractiveOverlay printerInteractiveOverlay = (PrinterInteractiveOverlay)wpfPrint.InteractiveOverlays["PrintPreviewOverlay"];
printerInteractiveOverlay.PrinterLayers.Add("MapLayer", mapPrinterLayer);