MapSuiteGisEditor/WpfDesktopExtension/Overlays/WorldMapKitMapOverlay.cs
/// <summary>
/// This method overrides from its base class TileOverlay.
/// It actually requests image for the passed tile with the passed world extent.
/// </summary>
/// <param name="tile">A tile object that creating by the GetTileCore method. It's the tile which needs to be draw in this mehtod.</param>
/// <param name="targetExtent">A world extent that to draw the passed tile object.</param>
This method overrides from its base class TileOverlay.
It actually requests image for the passed tile with the passed world extent.
This method overrides from its base class TileOverlay . It actually requests image for the passed tile with the passed world extent .
protected override void DrawTileCore(Wpf.Tile tile, RectangleShape targetExtent)
        {
            LayerTile layerTile = tile as LayerTile;
            if (layerTile != null)
            {
                layerTile.TileCache = TileCache;
                layerTile.DrawingLayers.Clear();
                layerTile.DrawingLayers.Add(wktLayer);
                Bitmap nativeImage = new Bitmap((int)tile.Width, (int)tile.Height);
                PlatformGeoCanvas geoCanvas = new PlatformGeoCanvas();
                geoCanvas.BeginDrawing(nativeImage, targetExtent, MapArguments.MapUnit);
                if (tile.IsAsync)
                {
                    layerTile.DrawAsync(geoCanvas);
                }
                else
                {
                    layerTile.Draw(geoCanvas);
                    geoCanvas.EndDrawing();
                    layerTile.CommitDrawing(geoCanvas, MapUtils.GetImageSourceFromNativeImage(nativeImage));
                }
            }
        }
protected override void DrawTileCore ( Wpf . Tile tile , RectangleShape targetExtent ) { LayerTile layerTile = tile as LayerTile ; if ( layerTile != null ) { layerTile . TileCache = TileCache ; layerTile . DrawingLayers . Clear ( ) ; layerTile . DrawingLayers . Add ( wktLayer ) ; Bitmap nativeImage = new Bitmap ( ( int ) tile . Width , ( int ) tile . Height ) ; PlatformGeoCanvas geoCanvas = new PlatformGeoCanvas ( ) ; geoCanvas . BeginDrawing ( nativeImage , targetExtent , MapArguments . MapUnit ) ; if ( tile . IsAsync ) { layerTile . DrawAsync ( geoCanvas ) ; } else { layerTile . Draw ( geoCanvas ) ; geoCanvas . EndDrawing ( ) ; layerTile . CommitDrawing ( geoCanvas , MapUtils . GetImageSourceFromNativeImage ( nativeImage ) ) ; } } }
This method overrides from its base class TileOverlay.
This method overrides from its base class TileOverlay .
tile
Wpf.Tile
A tile object that creating by the GetTileCore method. It's the tile which needs to be draw in this mehtod.
A tile object that creating by the GetTileCore method . It ' s the tile which needs to be draw in this mehtod .
targetExtent
RectangleShape
A world extent that to draw the passed tile object.
A world extent that to draw the passed tile object .