MapSuiteGisEditor/WpfDesktopExtension/GisEditorWpfMap.cs
/// <summary>
/// Just fix Bing maps and world map kit
/// </summary>
Just fix Bing maps and world map kit
Just fix Bing maps and world map kit
private void FixBaseMaps()
        {
            var oldWmkOverlay = Overlays.OfType<WorldMapKitWmsWpfOverlay>().FirstOrDefault();
            if (oldWmkOverlay != null)
            {
                var newWmkOverlay = new WorldMapKitMapOverlay(oldWmkOverlay.ClientId, oldWmkOverlay.PrivateKey);
                newWmkOverlay.TileType = oldWmkOverlay.TileType;
                newWmkOverlay.Name = oldWmkOverlay.Name;
                newWmkOverlay.DrawingExceptionMode = oldWmkOverlay.DrawingExceptionMode;
                newWmkOverlay.TileBuffer = oldWmkOverlay.TileBuffer;
                newWmkOverlay.TileCache = oldWmkOverlay.TileCache;
                newWmkOverlay.Projection = (Layers.WorldMapKitProjection)oldWmkOverlay.Projection;
                newWmkOverlay.MapArguments = oldWmkOverlay.MapArguments;
                var index = Overlays.IndexOf(oldWmkOverlay);
                Overlays.Insert(index, newWmkOverlay);
                Overlays.RemoveAt(index + 1);
            }
            var oldBingMapsTileOverlay = Overlays.OfType<BingMapsTileOverlay>().FirstOrDefault();
            if (oldBingMapsTileOverlay != null)
            {
                var newBingMapsOverlay = new BingMapsOverlay(oldBingMapsTileOverlay.ApplicationId, oldBingMapsTileOverlay.MapStyle);
                newBingMapsOverlay.Logo = null;
                newBingMapsOverlay.Name = oldBingMapsTileOverlay.Name;
                newBingMapsOverlay.TileType = oldBingMapsTileOverlay.TileType;
                newBingMapsOverlay.DrawingExceptionMode = oldBingMapsTileOverlay.DrawingExceptionMode;
                newBingMapsOverlay.TileCache = oldBingMapsTileOverlay.TileCache;
                newBingMapsOverlay.MapArguments = oldBingMapsTileOverlay.MapArguments;
                var index = Overlays.IndexOf(newBingMapsOverlay);
                Overlays.Insert(index, newBingMapsOverlay);
                Overlays.RemoveAt(index + 1);
            }
            var oldBingMapsOverlays = Overlays.OfType<BingMapsOverlay>();
            foreach (var bingMapsOverlay in oldBingMapsOverlays)
            {
                bingMapsOverlay.Logo = null;
            }
        }
private void FixBaseMaps ( ) { var oldWmkOverlay = Overlays . OfType < WorldMapKitWmsWpfOverlay > ( ) . FirstOrDefault ( ) ; if ( oldWmkOverlay != null ) { var newWmkOverlay = new WorldMapKitMapOverlay ( oldWmkOverlay . ClientId , oldWmkOverlay . PrivateKey ) ; newWmkOverlay . TileType = oldWmkOverlay . TileType ; newWmkOverlay . Name = oldWmkOverlay . Name ; newWmkOverlay . DrawingExceptionMode = oldWmkOverlay . DrawingExceptionMode ; newWmkOverlay . TileBuffer = oldWmkOverlay . TileBuffer ; newWmkOverlay . TileCache = oldWmkOverlay . TileCache ; newWmkOverlay . Projection = ( Layers . WorldMapKitProjection ) oldWmkOverlay . Projection ; newWmkOverlay . MapArguments = oldWmkOverlay . MapArguments ; var index = Overlays . IndexOf ( oldWmkOverlay ) ; Overlays . Insert ( index , newWmkOverlay ) ; Overlays . RemoveAt ( index + 1 ) ; } var oldBingMapsTileOverlay = Overlays . OfType < BingMapsTileOverlay > ( ) . FirstOrDefault ( ) ; if ( oldBingMapsTileOverlay != null ) { var newBingMapsOverlay = new BingMapsOverlay ( oldBingMapsTileOverlay . ApplicationId , oldBingMapsTileOverlay . MapStyle ) ; newBingMapsOverlay . Logo = null ; newBingMapsOverlay . Name = oldBingMapsTileOverlay . Name ; newBingMapsOverlay . TileType = oldBingMapsTileOverlay . TileType ; newBingMapsOverlay . DrawingExceptionMode = oldBingMapsTileOverlay . DrawingExceptionMode ; newBingMapsOverlay . TileCache = oldBingMapsTileOverlay . TileCache ; newBingMapsOverlay . MapArguments = oldBingMapsTileOverlay . MapArguments ; var index = Overlays . IndexOf ( newBingMapsOverlay ) ; Overlays . Insert ( index , newBingMapsOverlay ) ; Overlays . RemoveAt ( index + 1 ) ; } var oldBingMapsOverlays = Overlays . OfType < BingMapsOverlay > ( ) ; foreach ( var bingMapsOverlay in oldBingMapsOverlays ) { bingMapsOverlay . Logo = null ; } }
Just fix Bing maps and world map kit
Just fix Bing maps and world map kit