<div>I accomplish this on the &quot;moveend&quot; event.</div>
<div>&nbsp;</div>
<div>map.events.register(&#39;moveend&#39;, map, function (e)<br>{<br>&nbsp;var mapScale = this.getScale();<br>&nbsp;if (mapScale &lt; 55568034)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; markerLayer.setVisibility(true);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; markerLayer.setVisibility(false);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>}</div>
<div>&nbsp;</div>
<div>I also would like this layer not to fire until it is between the min and max scale settings.&nbsp; It still goes out and retrieves the url and causes performance problems.&nbsp; But it is my understanding that this will come in a future release.
</div>
<div>&nbsp;</div>
<div>Thanks,</div>
<div>Linda Rawson<br><br></div>
<div class="gmail_quote">On Dec 7, 2007 2:36 PM, Bart van den Eijnden (OSGIS) &lt;<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">That&#39;s true, but since I have the scales array set on the Map, the layer<br>also has scales. And if scales is not null, it will never reach the code
<br>block where minScale and maxScale are applied.<br><br>Best regards,<br>Bart<br><br>Eric Lemoine schreef:<br>
<div class="Ih2E3d">&gt; On Dec 7, 2007 3:53 PM, Bart van den Eijnden (OSGIS) &lt;<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>&gt; wrote:<br>&gt;<br>&gt;&gt; Hi list,<br>&gt;&gt;<br>&gt;&gt; I am trying to make one of my WMS layers scale dependent (only visible
<br>&gt;&gt; between 0 and 1:25000, units: m), but I cannot get it done.<br>&gt;&gt;<br>&gt;&gt; My map is constructed with an array of scales and a maxExtent.<br>&gt;&gt;<br>&gt;&gt; On my layer I use minScale 25000 and maxScale 0.
<br>&gt;&gt;<br>&gt;&gt; But since the code in InitResolutions of Layer.js falls back on the map<br>&gt;&gt; object, the Layer&#39;s scales array will be set using the Map&#39;s scales array,<br>&gt;&gt; and the code for minScale and maxScale will never be reached.
<br>&gt;&gt;<br>&gt;<br>&gt; When I look at the code, I see the opposite. minScale, maxScale and<br>&gt; friends are taken from the map object *only* if they&#39;re not specified<br>&gt; at the layer level.<br>&gt;<br>&gt; &lt;
<a href="http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer.js#L411" target="_blank">http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer.js#L411</a>&gt;<br>&gt; &lt;<a href="http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer.js#L604" target="_blank">
http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Layer.js#L604</a>&gt;<br>&gt;<br>&gt; Am I missing something here?<br>&gt;<br>&gt; --<br>&gt; Eric<br>&gt;<br>&gt;<br>&gt;<br><br><br></div><font color="#888888">
--<br>Bart van den Eijnden<br>OSGIS, Open Source GIS<br><a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a><br><a href="http://www.osgis.nl/" target="_blank">http://www.osgis.nl</a><br></font>
<div>
<div></div>
<div class="Wj3C7c"><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users" target="_blank">
http://openlayers.org/mailman/listinfo/users</a><br></div></div></blockquote></div><br>