0) { $shape = $shape->buffer($buffer); } # Open the mapfile $map = ms_newMapObj('resources/renderWKT.map'); # Set up the extents and the mapsize $map->setExtent($extent[0], $extent[1], $extent[2], $extent[3]); if(isset($imagesize)) { $imagesize = split(' ',$imagesize); $map->setSize($imagesize[0],$imagesize[1]); } else { $map->setSize(500,500); } $layer = $map->getLayer(0); # Set the layer type to match the object that will be drawn if($shape->{type} == MS_SHAPE_POINT) { $layer->set('type', MS_LAYER_POINT); if(isset($_REQUEST['symbol'])) { $cl = $layer->getClass(0); $st = $cl->getStyle(1); $st->set('symbol', $map->getsymbolbyname($_REQUEST['symbol'])); # print $_REQUEST['symbol']; } } elseif ($shape->{type} == MS_SHAPE_LINE) { $layer->set('type', MS_LAYER_LINE); } elseif ($shape->{type} == MS_SHAPE_POLYGON) { $layer->set('type', MS_LAYER_POLYGON); } # Now setup the coloring from the CGI request $class = $layer->getClass(0); # there can be only 1 if(isset($title)) { $class->settext($title); } if(isset($lineWidth)) { $class->getStyle(1)->set('size', $lineWidth); } if(isset($lineColor)) { $lineColor = split(' ', $lineColor); $class->getStyle(1)->outlinecolor->setRGB($lineColor[0],$lineColor[1],$lineColor[2]); } if(isset($fillColor)) { $fillColor = split(' ', $fillColor); $class->getStyle(0)->color->setRGB($fillColor[0],$fillColor[1],$fillColor[2]); } # Points only get one style applied to them, so this makes sure the point is filled properly if($shape->{type} == MS_SHAPE_POINT) { if(isset($fillColor)) { $class->getStyle(1)->color->setRGB($fillColor[0],$fillColor[1],$fillColor[2]); } } $layer->addFeature($shape); $image= $map->prepareImage(); $image = $map->draw(); header('Content-type: image/gif'); #$layer->{status} = MS_OFF; $image->saveImage(''); # No file name means it goes to stdout #$image->saveImage(); #print "completed"; #print "
"; #print $shape->toWkt(); #readfile('/tmp/www/out.gif'); #readfile("../shared/images/blank.gif"); ?>