I need help on how to analyse layer usage on Mapguide 3.1.x, Ajax viewer.
I am looking at Access.log and found the following entry telling me a
feature on a layer was selected
<2020-01-09T09:09:28> 1492 Anonymous
So I can count these selections per layer per period.
My question is: Is there an entry in the log file to tell me a layer that
is normally not visible(in map object), was switched on (made visible)?
Any other help re layer usage analyses will be appreciated.
Layer toggles are manifested through GETDYNAMICMAPOVERLAYIMAGE requests to
the mapagent in the SHOWLAYERS/HIDELAYERS parameter. As
GETDYNAMICMAPOVERLAYIMAGE is an API specific to the mapagent, these requests
won't appear in your access.log, but rather your http web server logs.
Unfortunately the values passed in are runtime layer object uuids which are
near meaningless from an analytical context as they are always unique and
new values are generated for every MgMap creation.
The only practical solution at this moment would be implement a custom
mapagent handler (example:
https://github.com/jumpinjackie/mapagent-dotnet-sample) and intercept
`GETDYNAMICMAPOVERLAYIMAGE `requests to do custom logging. At the point of
request interception, you'll have the MAPNAME and layer ids to show/hide so
you can open a MgMap at that point and resolve the MgLayer instances from
the layer ids given and log the respective name/resid/etc of these MgLayers.
Then you'll have to re-route your viewer applications to talk to this custom
mapagent handler instead of the regular mapagent.