[Users] MVC Simple + treelayer

Alexandre Dubé adube at mapgears.com
Wed Dec 5 15:59:19 CET 2012


Hi Antonio,

   Sorry for the late answer.  Were you able to solve your issue ?

Alexandre


On 12-11-19 07:58 PM, Antonio Parrotta wrote:
> Hi,
>
> I'm trying to merge MVC simple 
> (/http://geoext.github.com/geoext2/examples/app/simple/simple.html/) 
> and tree (/http://geoext.github.com/geoext2/examples/tree/tree.html/) 
> examples . I created a new east panel in the viewport and a Layer.js 
> store as reported below. The problem here is that at the time 
> /CF.store.Layers/ is defined, map controller is not yet initialized, 
> then /*mapPanel.layers*/:is undefined. Do you know how to postpone the 
> store creation after the map initialization?
>
> thanks a lot
> Antonio
>
> *Layer Store*
>
> /Ext.define('CF.store.Layers', {/
> /    extend: 'Ext.data.TreeStore',/
> /    model: 'GeoExt.data.LayerTreeModel',/
> /root: {/
> /expanded: true,/
> /children: [/
> /{/
> /plugins: [{/
> /ptype: 'gx_layercontainer',/
> /*store: mapPanel.layers*/
> /}],/
> /expanded: true/
> /}, {/
> /plugins: ['gx_baselayercontainer'],/
> /expanded: true,/
> /text: "Base Maps"/
> /}, {/
> /plugins: ['gx_overlaylayercontainer'],/
> /expanded: true/
> /}/
> /]/
> /}/
> /});/
>
>
> *East Panel*
>
> /items: [/
> /Ext.create('GeoExt.tree.Panel', {/
> /region: "east",/
> /border: true,/
> /title: "Layers",/
> /width: 200,/
> /split: true,/
> /collapsible: true,/
> /collapseMode: "mini",/
> /autoScroll: true,/
> /*store: 'Layers',*/
> /root: {/
> /text: 'root node'/
> /},/
> /rootVisible: false,/
> /lines: false,/
> /tbar: [{/
> /text: "remove",/
> /handler: function() {/
> /layer = mapPanel.map.layers[2];/
> /mapPanel.map.removeLayer(layer);/
> /}/
> /}, {/
> /text: "add",/
> /handler: function() {/
> /mapPanel.map.addLayer(layer);/
> /}/
> /}]/
> /})/
> /]/
> - Antonio
>
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users


-- 
Alexandre Dubé
Mapgears
www.mapgears.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20121205/8041e926/attachment.htm 


More information about the Users mailing list