AddLayer on Map

4/22/2014 2:38:59 AM
Total Posts 28

AddLayer on Map

My Application Code is:

 

        Layer layer = Layer.Open(MapPath("App_Data/shapes/") + "file1.shp");      
        layer.Visible = true;
        layer.Name = "aaaaa";
        layer.Description = "bbbbbb";
        layer.LabelField = "ccccc";
        layer.ShowLabels = true;
        layer.LabelFont.Size = 12;
        layer.Symbol.FillStyle = FillStyle.Invisible;
        layer.Symbol.LineColor = Color.Red;
        layer.Symbol.Size = 2;

        Session["MapLayer"] = layer;

       //layer extract from session
        Layer dbLayer = (Layer) Session["MapLayer"];       

 

My Question is how to add dbLayer on Map?

4/22/2014 12:34:52 PM
MVP
Total Posts 323

Re: AddLayer on Map

Shapefile layers can be added as files via the Map.AddLayer method.
There is no way to add Layer instances to the Map directly.