[MAPSERVER-USERS] Displaying layers based on zoom level

Ila ila.engg at gmail.com
Fri Jun 6 03:46:50 PDT 2008


For your reference, there is an example I have tested, just check this out:

LAYER		# to dispaly district as land 
  NAME "district"
  CONNECTIONTYPE da_name
  CONNECTION username/password
  
  DATA "query_to_be_fired"
 
  TYPE POLYGON
  STATUS ON
  CLASSITEM "TYPE"
  LABELITEM "NAME"
  
  CLASS
    NAME "DISTRICT"
      COLOR 253 251 240
    OUTLINECOLOR 255 255 240
    
    EXPRESSION "DISTRICT"
    #EXPRESSION ('[TYPE]' = 'district')
    MAXSCALE 260000
    MINSCALE 120000   
  END 
 END # Layer

LAYER		# to display area

  NAME "area"
  CONNECTIONTYPE db_name
  CONNECTION username/password
  TYPE POLYGON
  STATUS ON
  CLASSITEM "TYPE"
  LABELITEM "NAME"
  
  CLASS
    NAME "AREA"
    COLOR 253 251 240
    EXPRESSION "AREA"
    MAXSCALE 120000
    MINSCALE 260000
    LABEL      	
      COLOR  0 0 0    
      FONT "verdanab"
      SHADOWSIZE 2 2
      TYPE truetype	
      SIZE 8      
      ANTIALIAS true
      POSITION AUTO 
      PARTIALS FALSE     
      OUTLINECOLOR 255 255 255      
    END       	
	style
	 COLOR 255 255 255
	 WIDTH 1
	 antialias true
	end
  END

END

Hope this will clear you more.

Adrian Popa-3 wrote:
> 
> Thank you very much for your help. I made the changes (tweaked the 
> values for MAXSCALE) and I'm happy with the results :)
> 
> Cheers!
> 
> David Martinez Morata wrote:
>> Hi!
>> The functions in LAYER object are
>> MAXSCALE 'Value of Scale'
>> MINSCALE 'Value of minimun Scale'
>> Consult this http://mapserver.gis.umn.edu/docs/reference/mapfile/layer
>> And at the end of the page you find some considerations for MINSCALE 
>> AND MAXSCALE interpretation in MapServer
>>
>>
>> 2008/6/6 Adrian Popa <adrian_gh.popa at romtelecom.ro 
>> <mailto:adrian_gh.popa at romtelecom.ro>>:
>>
>>     Hello everybody,
>>
>>     I'm new to this mailing list, so forgive me if this question has
>>     been asked before (I haven't been able to search the archives).
>>
>>     My question is this:
>>     I have a map with several layers (including cities, roads,
>>     villages) and I would like to automatically turn some layers on
>>     when the user has zoomed in enough. I know I have read somewhere
>>     that you can set a property to the layer to tell it when it should
>>     be turned automatically on, but I can't find the property name or
>>     an example to get me going.
>>
>>     So please, point me in the right direction.
>>
>>     Thank you!
>>
>>     PS. I'm using mapserver 4.1 (and msMap as a frontend).
>>
>>     -- 
>>     Adrian Popa
>>
>>     Network Engineer
>>     Romtelecom S.A.
>>     Divizia Centrul National de Operare Retea
>>     Departament Transport IP & Metro
>>     Compartiment IP Core
>>
>>
>>     _______________________________________________
>>     mapserver-users mailing list
>>     mapserver-users at lists.osgeo.org
>>     <mailto:mapserver-users at lists.osgeo.org>
>>     http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
> 
> 
> -- 
> Adrian Popa
> 
> Network Engineer
> Romtelecom S.A.
> Divizia Centrul National de Operare Retea
> Departament Transport IP & Metro
> Compartiment IP Core
> 
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Displaying-layers-based-on-zoom-level-tp17686351p17689278.html
Sent from the Mapserver - User mailing list archive at Nabble.com.




More information about the MapServer-users mailing list