<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Hi,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">In my app I am automatically changing the baselayer according to zoomlevel as follows...</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div><div><font face="arial, helvetica, sans-serif" size="2"> function mapEvent(event) {</font></div><div><font face="arial, helvetica, sans-serif" size="2"> ZoomLev = map.getZoom();</font></div><div><font face="arial, helvetica, sans-serif" size="2">
switch(ZoomLev){</font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 0:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=layer_5mil){map.setBaseLayer(layer_5mil);}</font></div><div><font face="arial, helvetica, sans-serif" size="2"> break;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 1:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=layer_5mil){map.setBaseLayer(layer_5mil);}
<span class="Apple-tab-span" style="white-space:pre">        </span></font></div><div><font face="arial, helvetica, sans-serif" size="2"> break;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 2:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=layer_500){map.setBaseLayer(layer_500);} </font></div><div><font face="arial, helvetica, sans-serif" size="2"> break; </font></div><div><font face="arial, helvetica, sans-serif" size="2">
</font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 3:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=layer_500){map.setBaseLayer(layer_500);} </font></div><div><font face="arial, helvetica, sans-serif" size="2"> break;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 4:</font></div><div><font face="arial, helvetica, sans-serif" size="2">
if(map.BaseLayer!=tk_100){map.setBaseLayer(tk_100);} </font></div><div><font face="arial, helvetica, sans-serif" size="2"> break;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 5:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=tk_100){map.setBaseLayer(tk_100);} </font></div><div><font face="arial, helvetica, sans-serif" size="2"> break;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font
face="arial, helvetica, sans-serif" size="2"> case 6:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=tk_50){map.setBaseLayer(tk_50);} </font></div><div><font face="arial, helvetica, sans-serif" size="2"> break; </font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 7:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=tk_25){map.setBaseLayer(tk_25);} </font></div><div><font face="arial, helvetica,
sans-serif" size="2"> break;</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> case 8:</font></div><div><font face="arial, helvetica, sans-serif" size="2"> if(map.BaseLayer!=tk_10){map.setBaseLayer(tk_10);} </font></div><div><font face="arial, helvetica, sans-serif" size="2"> break; </font></div><div><font
face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2">What I need to do now is toggle the visibility of the current basemap so the user can turn off base layer...ie just have a white basemap. I have tried various methods including using this...</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"><div> action = new GeoExt.Action({</div><div> icon: 'images/tick.png',</div><div> map: map,</div><div>
tooltip: {</div><div> title: 'turn baselayer off'</div><div> },</div><div> handler: function () {</div><div> var map = Ext.getCmp("mapPanel");</div><div> mapPanel.map.setBaseLayer(emptymap);</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div> }</div><div> });</div></font></div><div><font face="arial, helvetica, sans-serif" size="2"><div><br></div><div><br></div><div>but the map will not change to leer.</div><div><br></div><div><br></div><div>can anyone see what I could do?,</div><div><br></div><div>yours,</div><div><br></div><div>Rob</div><div><br></div><div><br></div></font></div></div></div></body></html>