gridObj in PHP MapScript

CamKhmer chrisscrazydays at HOTMAIL.COM
Fri Dec 15 23:33:36 EST 2006


I am trying to build a grid layer for my map but I can't get it to display if
I generate the layer in MapScript instead of the mapfile. Here is the method
I am using to construct the layer, can anyone see where I'm going wrong?
With this code the map is rendered just without the grid and isVisible()
returns 0. Also the layer is not included in getlayersdrawingorder() which
makes me think I need to do something else make draw() recognize this new
layer?

	private function buildMapGrid(){
		$gridLayer = ms_newLayerObj($this->mapObj);
		$gridLayer->connectiontype = MS_GRATICULE;
		$gridLayer->name = "Grid";
		$gridLayer->type = MS_LAYER_LINE;
		$gridLayer->status = MS_ON;
		$gridLayer->projection = "proj=utm,GRS80=WGS84,datum=WGS84";
		
			$gridClass = ms_newClassObj($gridLayer);
			$gridClass->label->font = "sans";
			$gridClass->label->type = MS_TRUETYPE;
			$gridClass->label->size = "8";
			$gridClass->label->color->setRGB("0","0","0");
			$gridClass->label->outlinecolor->setRGB("255","255","255");
			
		$gridLayer->grid->labelformat = "DD";
		$gridLayer->grid->minarcs = "4";
		$gridLayer->grid->maxarcs = "6";

		print $gridLayer->isVisible();
	}

Any advice would be much appreciated.
-- 
View this message in context: http://www.nabble.com/gridObj-in-PHP-MapScript-tf2830859.html#a7903299
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list