{"action":"created","issue":{"url":"https://api.github.com/repos/USGS-CMG/terriajs-dive/issues/3","repository_url":"https://api.github.com/repos/USGS-CMG/terriajs-dive","labels_url":"https://api.github.com/repos/USGS-CMG/terriajs-dive/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/USGS-CMG/terriajs-dive/issues/3/comments","events_url":"https://api.github.com/repos/USGS-CMG/terriajs-dive/issues/3/events","html_url":"https://github.com/USGS-CMG/terriajs-dive/issues/3","id":147002220,"number":3,"title":"Add widgets to UI to control COLORSCALERANGE","user":{"login":"rsignell-usgs","id":1872600,"avatar_url":"https://avatars.githubusercontent.com/u/1872600?v=3","gravatar_id":"","url":"https://api.github.com/users/rsignell-usgs","html_url":"https://github.com/rsignell-usgs","followers_url":"https://api.github.com/users/rsignell-usgs/followers","following_url":"https://api.github.com/users/rsignell-usgs/following{/other_user}","gists_url":"https://api.github.com/users/rsignell-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/rsignell-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsignell-usgs/subscriptions","organizations_url":"https://api.github.com/users/rsignell-usgs/orgs","repos_url":"https://api.github.com/users/rsignell-usgs/repos","events_url":"https://api.github.com/users/rsignell-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/rsignell-usgs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jiwalker-usgs","id":1173041,"avatar_url":"https://avatars.githubusercontent.com/u/1173041?v=3","gravatar_id":"","url":"https://api.github.com/users/jiwalker-usgs","html_url":"https://github.com/jiwalker-usgs","followers_url":"https://api.github.com/users/jiwalker-usgs/followers","following_url":"https://api.github.com/users/jiwalker-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jiwalker-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jiwalker-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiwalker-usgs/subscriptions","organizations_url":"https://api.github.com/users/jiwalker-usgs/orgs","repos_url":"https://api.github.com/users/jiwalker-usgs/repos","events_url":"https://api.github.com/users/jiwalker-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jiwalker-usgs/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-04-08T18:26:10Z","updated_at":"2016-04-08T19:05:30Z","closed_at":null,"body":"We decided on our initial call yesterday with _Data61_ that an appropriate first task for @jiwalker-usgs to attempt would be to add widgets to control `COLORSCALERANGE` so that TerriaJS could issue WMS requests like this:\r\n\r\n\r\nhttp://ereeftds.bom.gov.au/ereefs/tds/wms/ereefs/mwq_gridAgg_P1A?LAYERS=Chl_MIM_mean&ELEVATION=0&TIME=2009-01-01T00%3A00%3A00.000Z&TRANSPARENT=true&STYLES=boxfill%2Frainbow&CRS=EPSG%3A4326&COLORSCALERANGE=0.1123%2C4.642&NUMCOLORBANDS=20&LOGSCALE=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&SRS=EPSG%3A4326&BBOX=147.47521484374,-28.598397216798,157.70881530761,-18.364796752931&WIDTH=256&HEIGHT=256\r\n\r\nRight now there are no such controls:\r\n![2016-04-08_9-17-33](https://cloud.githubusercontent.com/assets/1872600/14392678/94820a14-fd90-11e5-9f45-d5c2d43b1430.jpg)\r\n\r\nOne more wrinkle:  these controls should only appear on WMS endpoints that support `COLORSCALERANGE` (e.g. ncWMS, sci-wms), but unfortunately I can't think of a good way to determine that.   There is no mention of `COLORSCALERANGE` in the `getCapabilities` because `COLORSCALERANGE` is an extension, which isn't part of the WMS standard!  \r\n\r\nhttp://ereeftds.bom.gov.au/ereefs/tds/wms/ereefs/mwq_gridAgg_P1A?service=WMS&version=1.3.0&request=GetCapabilities\r\n\r\nI can only think of a non-robust way to determine if the server is a ncWMS server, which would be to check the getCaps and see if there is style with name `boxfill/occam`, which exists in all ncWMS servers I've seen (since it's configured by default):\r\n```\r\n<Style>\r\n<Name>boxfill/occam</Name>\r\n<Title>boxfill/occam</Title>\r\n<Abstract>boxfill style, using the occam palette</Abstract>\r\n<LegendURL width=\"110\" height=\"264\">\r\n<Format>image/png</Format>\r\n<OnlineResource xlink:type=\"simple\" xlink:href=\"http://ereeftds.bom.gov.au/ereefs/tds/wms/ereefs/mwq_gridAgg_P1A?REQUEST=GetLegendGraphic&LAYER=Chl_MIM_n_obs&PALETTE=occam\"/>\r\n</LegendURL>\r\n</Style>\r\n```\r\nBut this isn't robust because any other WMS service could also provide this style (though I haven't seen it).\r\n\r\nI'll try asking the ncWMS mailing list if there is a better way...\r\n\r\n@kring, what development branch should @jiwalker-usgs start with?"},"comment":{"url":"https://api.github.com/repos/USGS-CMG/terriajs-dive/issues/comments/207561260","html_url":"https://github.com/USGS-CMG/terriajs-dive/issues/3#issuecomment-207561260","issue_url":"https://api.github.com/repos/USGS-CMG/terriajs-dive/issues/3","id":207561260,"user":{"login":"rsignell-usgs","id":1872600,"avatar_url":"https://avatars.githubusercontent.com/u/1872600?v=3","gravatar_id":"","url":"https://api.github.com/users/rsignell-usgs","html_url":"https://github.com/rsignell-usgs","followers_url":"https://api.github.com/users/rsignell-usgs/followers","following_url":"https://api.github.com/users/rsignell-usgs/following{/other_user}","gists_url":"https://api.github.com/users/rsignell-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/rsignell-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsignell-usgs/subscriptions","organizations_url":"https://api.github.com/users/rsignell-usgs/orgs","repos_url":"https://api.github.com/users/rsignell-usgs/repos","events_url":"https://api.github.com/users/rsignell-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/rsignell-usgs/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T19:05:30Z","updated_at":"2016-04-08T19:05:30Z","body":"@jiwalker-usgs, you could do that, but we don't want to require JSON.  We want the user to be able to drag and drop a WMS endpoint from ncWMS (which is the WMS on THREDDS Data Server) and have the widgets pop up as controls. "}}