ComponentOne Maps for WinForms
Layers / Tile Layer
In This Topic
    Tile Layer
    In This Topic

    Tile layer is used to display the map tiles on a map using different tile sources. This is the first layer to be added to the map before adding any data to it. You can add the tile layer on a map using C1Map.TileLayer property. Once you add the tile layer on a map, you need to set the tile source for it using TileSource property of TileLayer class.

    Adding built-in Tile Source

    C1Map uses three built-in tile sources, VirtualEarthAerialSourceVirtualEarthRoadSource, and VirtualEarthHybridSource. You can use any of these to define the tile source for the tile layer.

    Following code illustrates the use of C1Map.TileLayer and TileSource property:

    C1Map1.TileLayer.TileSource = New VirtualEarthAerialSource()
    
    c1Map1.TileLayer.TileSource = new VirtualEarthAerialSource();
    

    Adding custom Tile Source

    In addition to the three built-in sources, C1Map supports custom tile source that can be added to the tile layer of a map. For adding a custom tile source, you need to create your own class that implements C1.FlexMap.ITileSource interface. In the following code, we have created a class named OpenStreetTileSource that is used to add custom tile source to your map and uses the OpenStreetMap service:

    ' Provide custom tile source which implements C1.FlexMap.ITileSource interface
    C1Map1.TileLayer.TileSource = New Map_Layers.OpenStreetTileSource()
    
    // Provide custom tile source which implements C1.FlexMap.ITileSource interface
    c1Map1.TileLayer.TileSource = new OpenStreetTileSource();