Producing dynamic classes within a layer

David Shorthouse dps1 at UALBERTA.CA
Sun Oct 9 19:58:26 EDT 2005


>On October 9, 2005 11:51 am, David Shorthouse wrote:
>> filling in
>> individual States or Provinces with one colour while the 
>remaining States
>> or Provinces do not receive the fill colour. These select States or
>> Provinces must be chosen via a SQL Server query.
>
>Hi David,
>If I understand correctly what you need, all you want is to 
>have multiple 
>CLASS sections, asper the p. 161 example here:
>http://examples.oreilly.com/webmapping/
>
>FYI - to all others, most of the map file code examples from 
>my book (some 
>still remaining) are on that website.
>
>Hope that helps.
>Tyler

This is certainly getting closer, but let me see if I understand this. The
mapfile you pointed me to above looks like it has an Expression associated
with the 'Bulgaria' class as:

CLASS
	EXPRESSION ( ' [NAME] ' ne 'Bulgaria' )
	STYLE
		OUTLINECOLOR 100 100 100
		COLOR 200 200 200
	END
END

Whereby I assume the [NAME] gets pulled from the URL such that 'Bulgaria'
may or may not receive that color depending on what's in the URL. What I
want to do is fill [NAME] from a recordset obtained from SQL Server. At the
moment, I have a series of Classes associated with my State/Province layer.
So, does this mean all I have to do is add expressions as you showed like
[NAME1], [NAME2], ....., [NAMEx] for all the State/Province classes and
somehow figure out how to fill these from a SQL Server recordset?

Dave



More information about the mapserver-users mailing list