{"action":"created","issue":{"url":"https://api.github.com/repos/TerriaJS/terriajs/issues/895","labels_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/895/labels{/name}","comments_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/895/comments","events_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/895/events","html_url":"https://github.com/TerriaJS/terriajs/issues/895","id":102763762,"number":895,"title":"`getFeatureInfoFormats` type `plain` breaks `wms-getCapabilities` services","user":{"login":"meh9","id":5283003,"avatar_url":"https://avatars.githubusercontent.com/u/5283003?v=3","gravatar_id":"","url":"https://api.github.com/users/meh9","html_url":"https://github.com/meh9","followers_url":"https://api.github.com/users/meh9/followers","following_url":"https://api.github.com/users/meh9/following{/other_user}","gists_url":"https://api.github.com/users/meh9/gists{/gist_id}","starred_url":"https://api.github.com/users/meh9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meh9/subscriptions","organizations_url":"https://api.github.com/users/meh9/orgs","repos_url":"https://api.github.com/users/meh9/repos","events_url":"https://api.github.com/users/meh9/events{/privacy}","received_events_url":"https://api.github.com/users/meh9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-24T10:42:50Z","updated_at":"2015-08-26T20:08:34Z","closed_at":null,"body":"I have a `wms-getCapabilities` service group that supports only two `GetFeatureInfo` formats:\r\n\r\n```\r\n<GetFeatureInfo>\r\n    <Format>text/plain</Format>\r\n    <Format>application/vnd.ogc.gml</Format>\r\n```\r\n\r\nThe default if you don't specify anything is the GML format, which is less useful in the info popup than the `text/plain` format. (We should add GML support, or better yet implement info box templating: #496)\r\n\r\nHowever, when you do specify a format for the group in the Terria init file, then when you try to expand the group to see the layers Terria instead throws an error:\r\n\r\n```\r\nGroup is not available\r\n\r\nAn error occurred while invoking GetCapabilities on the WMS server.\r\n...\r\n```\r\n\r\nWith a bit of testing I've found that it will always break for all `wms-getCapabilities` services when you specify `plain` for `getFeatureInfoFormats`.\r\n\r\nExample:\r\n\r\n```\r\n        {\r\n          \"name\": \"Test\",\r\n          \"url\": \"http://geoserver.nationalmap.nicta.com.au/admin_bnds_abs/ows\",\r\n          \"type\": \"wms-getCapabilities\",\r\n          \"itemProperties\": {\r\n            \"getFeatureInfoFormats\": [\r\n              {\r\n                \"type\": \"plain\"\r\n              }\r\n            ]\r\n          }\r\n        }\r\n```\r\n\r\nIf you change the `plain` to `html`, which is also supported for that service, then it works and you can expand the group.\r\n\r\nSo this will work, and will show HTML in the info popup:\r\n\r\n```\r\n            \"getFeatureInfoFormats\": [\r\n              {\r\n                \"type\": \"html\"\r\n              }\r\n            ]\r\n```"},"comment":{"url":"https://api.github.com/repos/TerriaJS/terriajs/issues/comments/135156476","html_url":"https://github.com/TerriaJS/terriajs/issues/895#issuecomment-135156476","issue_url":"https://api.github.com/repos/TerriaJS/terriajs/issues/895","id":135156476,"user":{"login":"kring","id":924374,"avatar_url":"https://avatars.githubusercontent.com/u/924374?v=3","gravatar_id":"","url":"https://api.github.com/users/kring","html_url":"https://github.com/kring","followers_url":"https://api.github.com/users/kring/followers","following_url":"https://api.github.com/users/kring/following{/other_user}","gists_url":"https://api.github.com/users/kring/gists{/gist_id}","starred_url":"https://api.github.com/users/kring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kring/subscriptions","organizations_url":"https://api.github.com/users/kring/orgs","repos_url":"https://api.github.com/users/kring/repos","events_url":"https://api.github.com/users/kring/events{/privacy}","received_events_url":"https://api.github.com/users/kring/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T20:08:34Z","updated_at":"2015-08-26T20:08:34Z","body":"Right, `plain` isn't a valid type.  The valid values are `text`, `json`, `xml`, or `html`.  Try this:\r\n\r\n```json\r\n        {\r\n          \"name\": \"Test\",\r\n          \"url\": \"http://geoserver.nationalmap.nicta.com.au/admin_bnds_abs/ows\",\r\n          \"type\": \"wms-getCapabilities\",\r\n          \"itemProperties\": {\r\n            \"getFeatureInfoFormats\": [\r\n              {\r\n                \"type\": \"text\",\r\n                \"format\": \"text/plain\"\r\n              }\r\n            ]\r\n          }\r\n        }\r\n```"}}