[Mapserver-users] Changing Colors in Map !!

Stephen Woodbridge woodbri at swoodbridge.com
Sat Jul 17 09:31:37 EDT 2004


Satyajit wrote:

> Dear Users,
>             Thanks a million to all the users who gave me their valuable
> suggestions while building site. Without the help of this group it would
> have been impossible for me to build such a nice site ( I hope you too
> find it nice). Though my map is smoothly running, I have a strange
> problem in my hands. The data layers in my map are changing colors while
> browsing through them. The change in color happens randomly at some zoom
> levels. At times the colors of the data layer match with the colors in
> the map. You can check out this site http://203.199.114.111/newham/ .
> Normally the data is shown in the color specified in the map file. But
> when I try to zoom in the data layers seem to take the colors of
> different other data layers. And it create a whole lot of confusion. I
> can't really find any reason for this. 
> Any ideas ? 

Very nice!

I have had this color changing problem in the past. It seems to be 
caused by generating too many colors for the browsers color map which 
cause the browser to select another color lookup table slot which is 
already in use.

The annoying (because mapserver should do this for you, and there is a 
bug on it) work around that I have found is to create a dummy layer as 
the first layer in the mapfile with a bunch of classes in it and each 
class has a color I want to reserve (or preserves). Mapserver then adds 
these colors to the lookup table first so that later assignments do not 
overwrite the colors I care about.

I think I may have created a feature and inserted a one pixel dot on the 
map that gets covers by later layers. Play with it and if you have a 
problem let me know and I can dig through old mapfiles and find out how 
I did it.

-Steve W.





More information about the mapserver-users mailing list