PHP/MapScript module test

numlayers; // phpinfo(); // // RENDER MAIN MAP // // Note: If you get errors with the saveWebImage() call below, then make sure // that the directory specified by IMAGEPATH in the .MAP file exists and is // writable by the httpd user. // $img = $map->draw(); $url = $img->saveWebImage(); printf("\n", $url, $map->width, $map->height); // // LEGEND // $img = $map->drawLegend(); $url = $img->saveWebImage(); printf("

Draw into one picture.
\n", $url); // Draw all legend icon from all class in all layers printf("

Draw each icon seperatly.
"); printf(""); for ($i=0; $i<$map->numlayers; $i++) { $layer = $map->getLayer($i); if ($layer->status != MS_OFF && $layer->type != MS_LAYER_QUERY) for ($j=0; $j<$layer->numclasses; $j++) { $myClass = $layer->GetClass($j); $img = $myClass->createLegendIcon($map->keysizex, $map->keysizey); $url = $img->saveWebImage(); printf("", $url, $myClass->name); } } printf("
%s
"); // // SCALE BAR // $img = $map->drawScaleBar(); $url = $img->saveWebImage(); printf("

\n", $url); ?>