<HTML><HEAD>
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>
</HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Arial'; COLOR: #000000; FONT-SIZE: 10pt">
<DIV>the setBaseLayer function doesn’t work because that value is a string</DIV>
<DIV>&nbsp;</DIV>
<DIV>You need to pass a reference to the actual layer</DIV>
<DIV>&nbsp;</DIV>
<DIV>Matt Priour</DIV>
<DIV>Kestrel Computer Consulting</DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV>&nbsp;</DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=robertdbuckley@yahoo.com 
href="mailto:robertdbuckley@yahoo.com">Robert Buckley</A> </DIV>
<DIV><B>Sent:</B> Tuesday, August 02, 2011 3:51 PM</DIV>
<DIV><B>To:</B> <A title=users@geoext.org 
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] basemapcombo</DIV></DIV></DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV 
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 10pt">
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">Hi,</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">&nbsp;</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">I´ve 
been trying for ages to get this to work...but it just doesn´t.</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">&nbsp;</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">I 
wanted to make a simple array store from which I can choose my basemaps...</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">&nbsp;</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">&nbsp;</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">&nbsp;</DIV>
<DIV 
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt">&nbsp;</DIV>
<DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>var baselayerStore = new 
Ext.data.ArrayStore({</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>fields: ['basemap'],</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>data:[['mapnik'],['gsat'],['gphy'],['gmap'],['ghyb']]</FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT 
class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"></FONT></SPAN></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp; <SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>});</FONT></DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT 
class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"></FONT></SPAN></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>var baselayercombo = new 
Ext.form.ComboBox({</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp;&nbsp; 
id:'baselayercombo',</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; store: 
baselayerStore,</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; 
displayField:'basemap',</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; typeAhead: true,</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; mode: 'local',</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; forceSelection: 
true,</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; triggerAction: 
'all',</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; emptyText:'Select a 
basemap...',</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp; selectOnFocus:true</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp; });</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN></FONT>&nbsp;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre" class=Apple-tab-span><FONT 
class=Apple-style-span size=2 
face="arial,&#13;&#10; helvetica, sans-serif"></FONT></SPAN></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>baselayercombo.on('select', function (combo, record, 
index) {</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select = 
Ext.getCmp('baselayercombo').getValue();</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>var mapPanel = Ext.getCmp('mapPanel');</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>alert(select);</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>map.setBaseLayer(select);</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>&nbsp;&nbsp; <SPAN style="WHITE-SPACE: pre" 
class=Apple-tab-span></SPAN>}, this);</FONT></DIV></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 face="arial, helvetica, sans-serif">The 
problem is, the map.setBaseLayer just won´t take the getValue from the the 
comboBox.</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 face="arial, helvetica, sans-serif">The 
alert even sends the correct value, but nothing happens!?!?!?!?</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 face="arial, helvetica, sans-serif">Can 
anyone see what my error is?</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif">yours,</FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif"><BR></FONT></DIV>
<DIV><FONT class=Apple-style-span size=2 
face="arial, helvetica, sans-serif">Rob</FONT></DIV>
<DIV 
style="POSITION: fixed; FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt"></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>Users mailing 
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></DIV></DIV></DIV></BODY></HTML>