This project is read-only.

WebLegend Parent Node problem

Dec 6, 2012 at 3:36 PM

Hi

Im using DotSpatial.Examples.DemoWEB and i try to encapsulate layers in themes, for example:

theme1

+ layer 1.A

+ layer 1.B

theme2

+ layer 2.A

+ layer 2.B

I cant create an LegenItem object with LegendSymbolMode = Group.

Can anybody help me? thanks in advance

Mauro

Dec 9, 2012 at 7:50 AM

I didn't work with web demo, but for grouping you should create new MapGroup then add layers to this group.

Dec 10, 2012 at 5:06 PM

hi Mese79

MapGroup seems dont works with WebMap. WebMap only supports AddLayer method.

WebMap.AddLayer(string fileName)

fileName is a physical path to the layer file.

Another idea?

thanks!

Mauro

Dec 11, 2012 at 8:35 AM
Edited Dec 11, 2012 at 8:36 AM

Yep! you are right.

So i think you should create your own legend control based on treeview and fill it like what you want.

For Example you could create a group object in javascript like:

 

var group = {
  id: 1,
  legendText: "group 1",
  layers: ["layer1", "layer2"]
}

Then use it to populate your treeview.

 

Dec 12, 2012 at 10:43 AM

Hi mese79

I try it updating WebLegend Render method but when i insert an item as parent node, the layers crash and not shown when i check its.

I wait for a new release :(

Thanks

Mauro

Jan 7, 2013 at 3:58 PM

At present I have not time to working on this issue but I think will not very difficult to modify th legend populator (is a simple recoursive function...)

(all italian in ths discussion ?)

ciao

T