Changes between Initial Version and Version 1 of PerlLayerObj4


Ignore:
Timestamp:
Jan 29, 2009, 11:23:04 AM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PerlLayerObj4

    v1 v1  
     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
     6my $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 ==
     13then 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 ==
     25The 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----
     28back to PerlMapScript