This project has moved and is read-only. For the latest updates, please go here.

Display and transparency Issues

May 22, 2013 at 10:47 AM
Hi, I'm using this code to load some sample data into sharpmap:

private void Form1_Load(object sender, EventArgs e)
        SharpMap.Map myMap = mapBox1.Map;

        mapBox1.Map.BackColor = Color.WhiteSmoke; //Set background

        MyLayer2 = new SharpMap.Layers.VectorLayer("MyLayer2");

        MyLayer2.DataSource = new SharpMap.Data.Providers.ShapeFile("C:\\Users\\roberts\\Downloads\\surrey-latest\\landuse_google.shp", false, false, 900913);

        //Create the style for Land
        SharpMap.Styles.VectorStyle landStyle = new SharpMap.Styles.VectorStyle();
        Color c = Color.FromArgb(30, 100, 100, 100);
        Brush b = new SolidBrush(c);
        landStyle.Fill = b; // new SolidBrush(Color.FromArgb(20,15, 255, 15));

        MyLayer2.Style = landStyle;

        var osmTileSource = new TileSource(new WebTileProvider(
new TmsRequest(new Uri(""), "png"), new FileCache(@"c:\temp\BruTile", "png"))
, new SphericalMercatorInvertedWorldSchema());

        mapBox1.Map.BackgroundLayer.Add(new SharpMap.Layers.TileAsyncLayer(
         osmTileSource, "OSM"));

        mapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan;

If I add the vector layer to the layer collection the back ground is never drawn. If I add it too the variable layer collection, then the background is drawn in the right position but the vector layer is not transparent.

The projections are all correct.

Any thoughts? Would this likely be fixed in trunk?

May 22, 2013 at 6:09 PM
Can you post the shapefile?
May 22, 2013 at 6:39 PM
Can do, whats the best way to upload a file?
May 27, 2013 at 6:45 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.