When using WorldMapKitWmsDesktopOverlay in windows Form app as background overlay, how to draw or print view with other feature layer into pdf. Googlemap or openstreetmap has “layer” object vs “overlay” to add into sample code below for plotting purpose. However, WorldMapKitWmsDesktopOverlay does not expose corresponding layer object for drawing purpose.
I tried using WorldMapKitWmsDesktopOverlay.draw(pdfGeoCanvas). This only plot tile pieces instead of seamless background in viewing extent.
PdfGeoCanvas pdfGeoCanvas = new PdfGeoCanvas();
// This allows you to control the area in which you want the
// map to draw in. Leaving this commented out uses the whole page
//pdfGeoCanvas.DrawingArea = new Rectangle(200, 50, 400, 400);
Collection<SIMPLECANDIDATE> labelsInLayers = new Collection<SIMPLECANDIDATE>();
foreach (Layer layer in ((LayerOverlay)winformsMap1.Overlays[0]).Layers)
{
pdfGeoCanvas.BeginDrawing(page, winformsMap1.CurrentExtent, GeographyUnit.DecimalDegree);
layer.Open();
layer.Draw(pdfGeoCanvas, labelsInLayers);
layer.Close();
pdfGeoCanvas.EndDrawing();
}