Only an idea, but without warranty. <br>Could you please try to add the layers to the map <u>before</u> creating the <span lang="EN-GB">ScaleSelectorCombo</span> (with map.addLayers()) ?<br>Cédric<br><br><div class="gmail_quote">
On Mon, Mar 22, 2010 at 2:31 PM, Estelle A <span dir="ltr"><<a href="mailto:estelle_ancelet@hotmail.fr">estelle_ancelet@hotmail.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p class="MsoNormal"><span lang="EN-GB">Hi all,</span></p>
<p class="MsoNormal"><span lang="EN-GB">I have an issue
with the ScaleSelectorCombo developed by Cedric Moullet (<a href="http://dev.geoext.org/sandbox/cmoullet/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.html" target="_blank">http://dev.geoext.org/sandbox/cmoullet/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.html</a>).</span></p>
<p class="MsoNormal"><span lang="EN-GB">In my
interface, the Combobox allowing to switch scales stucks at “<i>1 : undefined”</i> (see in the attached).</span></p>
<p class="MsoNormal"><span lang="EN-GB">I don’t
know where this issue comes from.</span></p>
<p class="MsoNormal"><span lang="EN-GB">I specify
that when I run the ScaleSelectorComboExample.html in my own server it works.</span></p>
<p class="MsoNormal"><span lang="EN-GB">Also, the zoom-chooser
example works (<a href="http://dev.geoext.org/trunk/geoext/examples/zoom-chooser.html" target="_blank">http://dev.geoext.org/trunk/geoext/examples/zoom-chooser.html</a>).</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks
for any help.</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Estelle</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Here is my code:</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal">var map; </p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">Ext.onReady(function()
{</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">var
options, layer;</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span></span></p>
<p class="MsoNormal"><span lang="EN-GB">options = {</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>maxExtent: new OpenLayers.Bounds(0,
1300000, 1500000, 3000000),</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>maxResolution: 'auto',</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>controls: [new
OpenLayers.Control.KeyboardDefaults(),new
OpenLayers.Control.MousePosition({"numDigits": 2}),new
OpenLayers.Control.Navigation(), new OpenLayers.Control.Scale()],</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>scales: [12500, 25000, 50000,
100000, 200000, 500000,1500000],</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>units: 'm',</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>projection: new
OpenLayers.Projection("EPSG:27572"),</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>};</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">map = new
OpenLayers.Map(options);</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span></span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span></span></p>
<p class="MsoNormal"><span lang="EN-GB">var
scaleSelectorCombo = new GeoExt.ux.form.ScaleSelectorCombo({</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>map: map,</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>fakeScaleValue: ["12500",
"25000", "50000", "100000", "200000",
"500000","1500000"]</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>});</span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span></p>
<p class="MsoNormal"><span lang="EN-GB">var
viewport = new Ext.Viewport({</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>layout:
'border',</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>items:
[{</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>region:'center',</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>id:
"mappanel",</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span></span>title:
‘Title’,</p>
<p class="MsoNormal"><span> </span><span lang="EN-GB">xtype: 'gx_mappanel',</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>map:
map,</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>split:
true,</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>layers:
[wms18,wms7,wms5],</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>contentEl:
'center',<span> </span></span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span>bbar:
[scaleSelectorCombo] </span></p>
<p class="MsoNormal"><span lang="EN-GB"><span> </span><span> </span></span>}]</p>
<p class="MsoNormal"><span> </span>});
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span> </span>}); </p>
                                           <br><hr>Envie de naviguer sur Internet sans laisser de trace? <a href="http://clk.atdmt.com/FRM/go/207186970/direct/01/" target="_blank">La solution avec Internet Explorer 8</a></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Geospatial Director Camptocamp SA<br>Cédric Moullet<br>PSE A<br>CH-1015 Lausanne<br><a href="http://www.camptocamp.com">www.camptocamp.com</a> / <a href="http://www.mapfish.org">www.mapfish.org</a> / <a href="http://twitter.com/cedricmoullet">twitter.com/cedricmoullet</a> / <a href="http://mapfishblog.blogspot.com/">mapfishblog.blogspot.com/</a><br>
<br>+41 79 759 69 83 (mobile)<br>+41 21 619 10 21 (direct)<br>+41 21 619 10 10 (centrale)<br>+41 21 619 10 00 (fax)<br>