[OpenLayers-Users] minScale maxScale on layer
toni hernández
tonidelacalle at gmail.com
Thu Apr 16 10:48:15 EDT 2009
hi,
it finally works! Just in case someone else needs it. The thing was that I
use resolutions to define my map instead of scales. So I needed to use
minResolution and maxResolution.
As easy as that.
Thanks to all!
2009/4/16 Arnd Wippermann <arnd.wippermann at web.de>
> Hi,
>
> I use minScale and maxScale for WMS layers, but my scales more like 6643704
> (EPSG:4326, EPSG:32627) to display whole Spain. Perhaps you have to set max
> and minResolution.
>
> Arnd
>
> ------------------------------
> *Von:* users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> *Im Auftrag von *toni hernández
> *Gesendet:* Donnerstag, 16. April 2009 12:51
> *An:* Bill Thoen
> *Cc:* users at openlayers.org
> *Betreff:* Re: [OpenLayers-Users] minScale maxScale on layer
>
> hi,
> thanks for the answer.
> I saw the examples and It looks like minScale and maxScale refer either to
> the map object or third part layers.
>
> I tried this code (and several more) on a WMS Layer without any luck.
> I mean the layer is always visible.
>
> Also, when I execute getScale the values are quite understandable. (like
> 107 for the whole territory of spain!!!!).
>
> var catastreLayer = new OpenLayers.Layer.WMS(
> "Cadastre",
> "
> http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx",
> {layers: 'Catastro', transparent: "true", format:
> "image/png"},{tileSize: new OpenLayers.Size(512,512), singleTile:true,
> buffer: 0,minScale: 1/100,maxScale: 1/400}
> );
> map.addLayer([catastreLayer]);
>
> 2009/4/15 Bill Thoen <bthoen at gisnet.com>
>
>> There's a good description on that subject right here:
>> http://trac.openlayers.org/wiki/SettingZoomLevels
>>
>> - Bill Thoen
>>
>>
>> toni hernández wrote:
>>
>>> Does anyone know if it is possible to set the minscale and maxscale on a
>>> layer so it shows and hides depending on the scale of the map.
>>>
>>> If tried to specify minScale:100, maxScale: 5000 (so the layer appears
>>> between the two scales) on the layer but the layer is still always visible.
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090416/fcdae85f/attachment.html
More information about the Users
mailing list