I have a MapServer project where the vector map is rotated on the client window (LeafLet plugin) but I need labels and icons to remain "north-up".
I know the STYLE allows ANGLE but it can be static or loaded from the query.
LAYER
NAME ...
STATUS ON
TYPE POINT
CONNECTIONTYPE postgis
CONNECTION "... port=5432"
DATA "geom from tablename using unique table_id using srid=3857"
CLASS
STYLE
ANGLE [maprotation] //example of table name
...
SIZE 6
END
END
END
In this case, maprotation is read from the table but that's not what I need. I can pass an extra parameter in the WMS query like:
tablelayer.updateParams({'maprotationvalue': angledegree});
This kind of parameters can be easily used in a VALIDATION or FILTER section of the .map file like:
FILTER ('[id]' = '%maprotationvalue%')```
What I'd like to have is something like:
LAYER
NAME ...
STATUS ON
TYPE POINT
CONNECTIONTYPE postgis
CONNECTION "... port=5432"
DATA "geom from tablename using unique table_id using srid=3857"
CLASS
STYLE
ANGLE ['%maprotationvalue%']
...
SIZE 6
END
END
END
...in order to have a true runtime rotation of the map based on the client requests but keeping the right label and icon orientation.
One of the things I tried was to build a query like:
SELECT %maprotationvalue% AS maprotation, geom FROM ...
That would allow to have a result field with the content I need but I wasn't able to find the right syntax for MapServer.
Have you any idea?