| 1 | = classObj = |
| 2 | {{{ |
| 3 | #!perl |
| 4 | $class = new mapscript::classObj($layer); |
| 5 | |
| 6 | $class->{label}->{autoangle} = 1; |
| 7 | $class->{label}->{sizescaled} = 8; |
| 8 | |
| 9 | $class->setExpression("\"${string_variable}\""); |
| 10 | $class->setExpression('/^{A-Z}/'); |
| 11 | $class->setExpression('([LENGTH] gt 50 and [AREA] < 150000)'); |
| 12 | $class->setExpression('N'); |
| 13 | |
| 14 | my $s_class = $s_layer->getClass(0); |
| 15 | |
| 16 | $class->{color} = $map->addColor(0,255,0); |
| 17 | |
| 18 | # Example of creating a "canvas" image for adding legend icons to & adding 1 really big icon. |
| 19 | my $legend_img = $class->createLegendIcon($rmap,$layer,200,100); |
| 20 | $class->drawLegendIcon($map,$layer,150,50,$legend_img,25,25); |
| 21 | }}} |
| 22 | ---- |
| 23 | back to PerlMapScript |