Display and transparency Issues

Editor
May 22, 2013 at 9: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;
        mapBox1.Map.VariableLayers.Add(MyLayer2);

        var osmTileSource = new TileSource(new WebTileProvider(
new TmsRequest(new Uri("http://b.tile.openstreetmap.org"), "png"), new FileCache(@"c:\temp\BruTile", "png"))
, new SphericalMercatorInvertedWorldSchema());

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

        mapBox1.Map.ZoomToBox(MyLayer2.Envelope);
        mapBox1.Refresh();
        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?

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