[mapserver-users] how to make symbol rotate with the map?

Oliver Christen oliver.christen at camptocamp.com
Thu Sep 4 05:28:11 PDT 2014


a bit easier way to do it is to use mapserver substitution to recover 
the map angle and calculate the final angle value directly in the 
postgres data string :

DATA "geom FROM (SELECT ..., (%map_angle%::float+angle)*-1 AS angle
             FROM table
             WHERE condition)
             as foo USING UNIQUE id USING srid=21781"

...

METADATA
   ...
   "default_map_angle" "0"
   "map_angle_validation_pattern" "[0-9.\-]*" # for map angle
END

CLASS
     STYLE
         SYMBOL 'bla.png'
         SIZE 120.0
         ANGLE [angle]
         OFFSET 0 60.000000
     END
END

maybe there is an even easier way to do it?

> dear all
>
> I need to make a symbol rotate with the map, i.e. if my symbol has an 
> angle of 45° and the map is rotated by, let say, 10°, the symbol angle 
> should be 55° to keep it's orientation relative to the map itself.
>
> at the moment the only way I see is to dynamically set in my database 
> the angle values to be used for the symbol calculated from the angle 
> of the map selected by the user (which is totally dynamic, not a 
> configured value), and that's horrendously annoying as I would have to 
> dynamically set the data value for the given layer so it use the 
> dynamically generated angles values.
>
> is there any other way to make a symbol angle follow the map rotation ?
>
> thanks for reading
> best regards
> Oliver
>


-- 
Camptocamp SA
Oliver Christen
PSE A, EPFL
CH-1015 Lausanne

www.camptocamp.com

+41 21 619 10 23 (direct)
+41 21 619 10 10 (centrale)
+41 21 619 10 00 (fax)



More information about the mapserver-users mailing list