<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> </DIV>
<DIV>You need to pass a reference to the actual layer</DIV>
<DIV> </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> </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> </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"> </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"> </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"> </DIV>
<DIV
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt"> </DIV>
<DIV
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt"> </DIV>
<DIV
style="FONT-FAMILY: arial, helvetica, sans-serif; COLOR: rgb(0,0,0); FONT-SIZE: 10pt"> </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> <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>
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> 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>
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> 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> 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> 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> 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> 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> 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> });</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> </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>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> 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> <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>