[Mapserver-users] classes not showing up in php/mapscript 41

Mahalakshmi Narayanan mhln25 at yahoo.com
Wed Apr 7 08:50:05 EDT 2004


Dear MapServer Users:

We have created a dynamic thematic map application
that talks to a SQL Server for attribute data and
based on the no. of classes and the ranges fed in by
the user the theme is generated. Visit
http://gisd.tn.nic.in/oss for viewing this and offer
your suggestions please.

For this we read each shape one by one in the layer
and try to see which range it belongs to and then 
sett the color for the shape.  This application is
working alright in PHP/MapScript 36.  However, when we
tried to change the application for PHP/Mapscript 41,
we are facing problems. Colours are set properly but
the latest class alone is being displayed on the map
with the rest of features being shown with the default
color mentioned in the mapfile. I think we are having
problems in classes (moveup, etc..) The code which
opens the layer and class is followed with the code
that is repeated for each shapeid is attached below:

		$layern = $gpoMap->GetLayerByName('Boundary');
       		$class=$layern->getClass(0);
         
       		$layern->open(); 

		//  loop thro each shapeid 
		
		$newsh=$layern->getShape(-1,$shapeid); 
		...
	        $class = ms_newClassObj($layern);
 		
		$style = ms_newStyleObj($class);
	
$style->color->setRGB($legarray1[0],$legarray1[1],$legarray1[2]);
   		//legarray1 has the colour chosen by the user for
the class 
		$style->outlinecolor->setRGB(0,0,0);

		//$class->set("status", MS_ON);
	
	        $layern->moveclassup(1);
		$newsh->draw($gpoMap,$layern,$image);

		$shapeid++; 

		// end loop 

Any help would be grately appreciated.

Thanks and regards,
Mahalakshmi Narayanan





__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/



More information about the mapserver-users mailing list