开发者

Mapserver ignores my template-file for GetFeatureInfo-requests

开发者 https://www.devze.com 2023-01-19 08:30 出处:网络
I want my mapfile to support the GetFeatureInfo-request for some layers. I added the following line to the layer:

I want my mapfile to support the GetFeatureInfo-request for some layers.

I added the following line to the layer:

TEMPLATE "change-template.txt"

And the fileitself looks like follows (only for testing-purposes until now):

# MapServer Template

[version]
test123

If I make my GetFeatureInfo-request, I get the following output:

GetFeatureInfo results:

Layer 'Change-North'
  Feature 3150: 

So it hits a feature (if I change the coordinates I get different Feature-numbers), but I cannot get any stuff from my template. The mapserver respects my TEMPLATE-line, because if I comment it out, the GetFeatureInfo-request doesn't work any longer: 'Requested lay开发者_开发知识库er(s) are not queryable.'

What is wrong here?


OK, I found a solution myself now. This template will only be used with a GetFeatureInfo​ request with the parameter INFO_FORMAT set to text/html. But to support text/html you also have to set another value in the WEB-part of the mapfile:

    WEB
            METADATA
                    "WMS_FEATURE_INFO_MIME_TYPE" "text/html"
            END
    END

Also it only worked, if the name of the template-file ended with .html. But I'm using it to send back simple text-information. Hope this helps anyone, who runs into the same problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消