| 1 | = layerObj = |
| 2 | |
| 3 | == Adding Dynamic layers in Mapscript 4.0.1 Perl == |
| 4 | ... However my own code for setting the style on a line layer that I have (dynamically created) does something similar to the following: (where $layer is a layerObj) |
| 5 | |
| 6 | my $layerClass = new mapscript::classObj($layer); |
| 7 | |
| 8 | 1. ... Set the values inside $layerClass ... |
| 9 | |
| 10 | $layerClass->{numstyles} = 1; |
| 11 | |
| 12 | == If you set TEMPLATE at the layer level == |
| 13 | then all shapes in the file are queried, even if they don't belong in any class. |
| 14 | |
| 15 | == Setting OVERLAYSIZE & etc. via MapScript == |
| 16 | (OVERLAYSYMBOL is deprecated) |
| 17 | {{{ |
| 18 | #!perl |
| 19 | $style = $class->getStyle(0); # underneath style |
| 20 | $overlay_style = new mapscript::styleObj($class); # new style at index 1 |
| 21 | $overlay_style->{symbol} = $overlay_symbol; # a symbol index number |
| 22 | $overlay_style->{size} = $overlay_size; # new symbol size |
| 23 | }}} |
| 24 | == Symbolscale Note == |
| 25 | The dynamic scaling in mapserver is a bit limited because what we *really* need in many cases is not linear scaling, but *log* scaling of feature line widths. If a feature has size0 = 10 at scale0 = 32000 (your case), it would be nice to have the feature size scale like: size = size0*log(scale0)/(log(scale) |
| 26 | |
| 27 | ---- |
| 28 | back to PerlMapScript |