Being able to style our features programmatically through javascript is a nice
feature. This was added in MS RFC 102: Support of Styleitem JavaScript Plugin. It allows us to avoid writing many
classes and styles in the mapfile. An additional use case of javascript could be
the ability to modify the geometry of the feature based on the input geometry
and/or its attributes.

This RFC proposes the addition of a GEOMTRANSFORM javascript plugin. It will
allow us to modify the geometry programmatically through javascript. This is
similar to the built-in geomtransform (buffer, centroid, etc.), but allows you
to implement your own logic using javascript. Additionally, you will be able to modify
a geometry based on its attributes values.

You can use styleitem javascript in combination with the geomtransform
javascript. However, this adds some overhead since two javascript scripts are
executed for each shape. For this reason, it will also be possible to modify the geometry in the
styleitem javascript method without having to use geomtransform. The difference in the styleitem javascript case is that instead of returning a new geometry, we modify the existing one. There might be some limitations with using
this method though. (ie. not sure if it is safe to return another type of geometry in this case).