[mapserver-users] turning on layers at a particular zoom level

sunny74 sb.ray at hotmail.com
Sat Aug 29 03:01:12 EDT 2009


Hi David,

Thanks for your reply.
I wanted to have 3 layers displayed b/w scale of 1.2M and 1.15M and so I
have added set MAXSCALEDENOM /MINSCALEDENOM as follows:

 LAYER
    NAME 'WaterBody'
    TYPE POLYGON
    DATA 'C:\ms4w\Apache\cgi-bin\Shape\WaterBody.shp'
    METADATA
      'wms_title' 'WaterBody'
    END
    STATUS OFF
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
    END
    CLASS
       NAME 'WaterBody' 
       MAXSCALEDENOM 2000000
       MINSCALEDENOM 1500000
       STYLE
         SYMBOL 0 
         SIZE 2 
         OUTLINECOLOR 0 0 0
         COLOR 150 123 90
       END
    END
  END

1)Pls tell me whether I hav added the things at the correct place.
2) Can I also add it within the layer properties?
3) I find that the layers are being added at PageLoad.This I found out by
looking at the number of items being added at the bottom left corner of IE.
The number of items has nearly doubled due to the addition of the 3 layers.
Is there any way by which I can stop the layers from being added at PageLoad
i.e they should be added only when the desired scale is reached.

4) How to use TileCache or GeoWebCache i.e js code?

Thanks again.

Fawcett, David wrote:
> 
> I assume the 'M' stands for million.  
> 
> If you want the layer to be only visible when 'zoomed in' beyond 1:2M, I
> would set a MAXSCALEDENOM of 2000000.  
> 
> If you want the layer to be only visible when 'zoomed out' beyond 1:2M, I
> would set a MINSCALEDENOM of 2000000.  
> 
> If you only want the layer to be visible between resolutions of 1:100000
> and 1:200000, you would set:  both MINSCALEDENOM 100000 and MAXSCALEDENOM
> 200000
> 
> These values go in either a LAYER or CLASS of LAYER in your MapServer map
> file.   
> 
> 
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of sunny74
> Sent: Friday, August 28, 2009 8:45 AM
> To: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] turning on layers at a particular zoom
> level
> 
> 
> 
> Hi,
> 
> Thanks for your reply.
> I went thru the link and read about MAXSCALEDENOM/MINSCALEDENOM. So
> MINSCALEDENOM is the minimum scale level at which a layer will become
> visible. But I am a bit confused.When the map loads for the first time it
> has a zoom level of 7 as given in the code below.
> 
> map.setCenter(new OpenLayers.LonLat(74.25, 20.35), 7);
> 
> In terms of scale it is showing 1:3M. 
> What is M? 
> If I increase the zoom level i.e do zoom in, scale becomes 1:856K and
> 1:256K etc i.e scale decreases. So If want a layer to be visible at a
> scale level of 1:2M what do I write in the mapfile?
> 
> How to use TileCache or GeoWebCache?Pls give the js code.
> 
> 
> Rahkonen Jukka wrote:
>> 
>> Hi,
>> 
>> Mapserver is somehow documented, about adjusting visibility according 
>> to scale, try to find MAXSCALEDENOM/MINSCALEDENOM from 
>> http://www.mapserver.org/mapfile/layer.html#index-21
>> 
>> Mapserver does not do caching but you can use for examply TileCache or 
>> GeoWebCache between your clients and Mapserver.
>> 
>> -Jukka Rahkonen-
>> 
>> 
>> 
>>> -----Alkuperäinen viesti-----
>>> Lähettäjä: mapserver-users-bounces at lists.osgeo.org
>>> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta sunny74
>>> Lähetetty: 28. elokuuta 2009 14:53
>>> Vastaanottaja: mapserver-users at lists.osgeo.org
>>> Aihe: [mapserver-users] turning on layers at a particular zoom level
>>> 
>>> 
>>> DEar Friends,
>>> 
>>> I have 12 layers in my map and it is taking tooooo long to
>>> load.Therefore I decided to turn on only 2 layers at Page Load.
>>> 
>>> Rest of the layers I want to turn on  at a particular zoom
>>> level.How can I check the zoom level and turn on these layers.
>>> 
>>> How can make the map load faster especially on page reload? Is it 
>>> possible to cache the map or is there some other technique?
>>> 
>>> Thanks for ur reply.
>>> 
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/turning-on-layers-at-a-particular-zoom-le
>>> vel-tp3534156p3534156.html
>>> Sent from the Mapserver - User mailing list archive at Nabble.com.
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>> 
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org 
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>> 
>> 
> 
> -- 
> View this message in context:
> http://n2.nabble.com/turning-on-layers-at-a-particular-zoom-level-tp3534156p3534743.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/turning-on-layers-at-a-particular-zoom-level-tp3534156p3540787.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list