/// <summary> /// Constructor of WorldMapKitMapOverlay class. /// </summary> /// <param name="webProxy">Proxy to use for the WMS Server.</param> /// <param name="clientId">The clientId for the WMS Server.</param> /// <param name="privateKey">The privateKey for the WMS Server.</param> public WorldMapKitMapOverlay(WebProxy webProxy, string clientId, string privateKey) : base() { wktLayer = new FastWorldMapKitRasterLayer(clientId, privateKey); wktLayer.SendingWebRequest += new EventHandler <SendingWebRequestEventArgs>(osmLayer_SendingWebRequest); wktLayer.SentWebRequest += new EventHandler <SentWebRequestEventArgs>(osmLayer_SentWebRequest); wktLayer.TimeoutInSecond = 10; wktLayer.TileCache = null; TileCache = new FileBitmapTileCache(GetTemporaryFolder(), GetDefaultCacheId()); TileWidth = defaultTileWidth; TileHeight = defaultTileHeight; DrawingExceptionMode = DrawingExceptionMode.DrawException; IsBase = true; Attribution = "© ThinkGeo © OpenStreetMap contributors"; }
internal static void AddBaseOverlays(WpfMap map, SimplifyMapPrinterLayer mapPrinterLayer) { var osmOverlay = map.Overlays.OfType <OpenStreetMapOverlay>().FirstOrDefault(); if (osmOverlay != null && osmOverlay.IsVisible) { OpenStreetMapLayer osmLayer = new OpenStreetMapLayer(); osmLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException; osmLayer.TimeoutInSeconds = 5; osmLayer.DrawingException += new EventHandler <DrawingExceptionLayerEventArgs>(osmLayer_DrawingException); mapPrinterLayer.Layers.Add(osmLayer); } var bingOverlay = map.Overlays.OfType <BingMapsOverlay>().FirstOrDefault(); if (bingOverlay != null && bingOverlay.IsVisible) { BingMapsLayer bingMapsLayer = new BingMapsLayer(bingOverlay.ApplicationId, (Layers.BingMapsMapType)bingOverlay.MapType); bingMapsLayer.TileCache = null; bingMapsLayer.TimeoutInSeconds = 5; bingMapsLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException; bingMapsLayer.DrawingException += new EventHandler <DrawingExceptionLayerEventArgs>(BingMapsLayer_DrawingException); mapPrinterLayer.Layers.Add(bingMapsLayer); } var wmlkOverlay = map.Overlays.OfType <WorldMapKitMapOverlay>().FirstOrDefault(); if (wmlkOverlay != null && wmlkOverlay.IsVisible) { WorldMapKitLayer worldMapKitLayer = new WorldMapKitLayer(wmlkOverlay.ClientId, wmlkOverlay.PrivateKey); worldMapKitLayer.TimeoutInSecond = 5; worldMapKitLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException; worldMapKitLayer.DrawingException += new EventHandler <DrawingExceptionLayerEventArgs>(WorldMapKitLayer_DrawingException); worldMapKitLayer.TileCache = null; worldMapKitLayer.Projection = wmlkOverlay.Projection; mapPrinterLayer.Layers.Add(worldMapKitLayer); } }