0

I am trying to build an HTML legend for my web application but I am having an issue with the tag [leg_icon] not being recognized. Seems like MapServer is not substituting any URL for this tag. Other tags like [leg_class_name] and [leg_layer_name] work fine. Has anyone encountered similar issue or know a possible fix?

The legend.html template:

[leg_class_html opt_flag=15] <img src=[leg_icon]> [leg_class_name] [leg_layer_name] [leg_class_index] <br> [/leg_class_html]

And the result of MODE=LEGEND request from MapServer. As you can see the icons for each of the classes are not loading.

enter image description here

7
  • 1
    I would guess a font or character encoding issue. Do the logs have any information
    – nmtoken
    Commented Mar 2, 2020 at 15:38
  • Haven't looked at the logs yet. Regarding encoding I think that shouldnt be the cause because the wrong encoding you see in the picture is from a diffrent variable [leg_class_name]. Thank you for the response though I'll give it a look.
    – ousekmatej
    Commented Mar 3, 2020 at 6:22
  • I managed to fix the encoding by adding <meta charset="UTF-8"> to the html template. However that didnt fix the issue of <img src=[leg_icon]> not loading properly. I tried going arround the issue by substituting the MapServer [leg_icon] variable by an URL request for the legend icon directly. But that's very clunky and I still dont know where the issue is.
    – ousekmatej
    Commented Mar 3, 2020 at 6:42
  • Error log for the mapfile returns this message (repeated multiple times): [Tue Mar 3 07:54:37 2020].861968 CGI Request 1 on process 27541 [Tue Mar 3 07:54:37 2020].862216 msSaveImage(): Unable to access file. Failed to create output file (/legend/KU_prirazky_3660_1583218472_0_0_18_12_s0_ff0000_ffffffff_ffffffff_0__0.png). [Tue Mar 3 07:54:37 2020].862233 processIcon(): Unable to access file. Error saving GD image to disk (/legend/KU_prirazky_3660_1583218472_0_0_18_12_s0_ff0000_ffffffff_ffffffff_0__0.png).
    – ousekmatej
    Commented Mar 3, 2020 at 6:57
  • does the your-web-server/legend directory exist?
    – nmtoken
    Commented Mar 3, 2020 at 9:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.