[Users] Measure Length and Area UX Tools Give Error

Eric Lemoine eric.lemoine at camptocamp.com
Wed Dec 22 06:41:52 CET 2010


On Tuesday, December 21, 2010, IT Intern <itintern12 at gmail.com> wrote:
> Thanks for the response Eric!  Here is the code for my tree as you have requested :)
>
> layerRoot = new Ext.tree.TreeNode({
>                 text: "All Layers",
>                 expanded: true
>             });
>
>   layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({
>                 text: "Base Layers",
>                 map: map,
>                 layerStore: mapPanel.layers,
>                 expanded: true
>             }));
>
> //A few other overlay containers are added similarly...
>
> //Tree menu for layers
>             var layerTree = new Ext.tree.TreePanel({
>                 overflow: 'visible',     // For the Combo popup
>                 region: "west",
>                 title: "Map Layers",
>                 root: layerRoot,
>                 loader: new Ext.tree.TreeLoader({applyLoader: false}),
>                 enableDD: true,
>                 collapsible: true,
>                 width: 300,
>                 autoScroll: true,
>                 expanded: false
>             });
>
> //Adding tree to panel
> var panel = new Ext.Panel({
>                 //width: $(window).width(),
>                 height: $(window).height() - 100,
>                 //height: 700,
>                 layout: "border",
>                 id: 'myViewPort',
>                 renderTo: document.body,
>                 items: [layerTree, mapPanel]
>                 //items: [layerTree, legend, mapPanel]
>             });
>
> "Vector layers created by Point, Path and Polygon handlers (used by the
> Measure control) have displayInLayerSwitcher set to false, so they
> should appear in the tree"
>
> If the displayInLayerSwitcher is set to false, then shouldn't it be that these layers should not show in my tree? :-/

Right. Moreover, you're using a BaseLayerContainer, so only base
layers with displayInLayerSwitcher set to true should appear in the
tree.

You can add a breakpoint into LayerLoader.js where the filter is
applied (function addLayerNode) and see what's going.

For further assistance here could you please come up with a small
example (a map panel + a measure tool + a tree panel) demonstrating
the issue.

Sorry for not being more helpful here.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list