{"action":"closed","issue":{"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/661","repository_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework","labels_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/661/comments","events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/661/events","html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/issues/661","id":166905087,"number":661,"title":"Services with string ids for layers fail to load legends","user":{"login":"caseypt","id":1042475,"avatar_url":"https://avatars.githubusercontent.com/u/1042475?v=3","gravatar_id":"","url":"https://api.github.com/users/caseypt","html_url":"https://github.com/caseypt","followers_url":"https://api.github.com/users/caseypt/followers","following_url":"https://api.github.com/users/caseypt/following{/other_user}","gists_url":"https://api.github.com/users/caseypt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseypt/subscriptions","organizations_url":"https://api.github.com/users/caseypt/orgs","repos_url":"https://api.github.com/users/caseypt/repos","events_url":"https://api.github.com/users/caseypt/events{/privacy}","received_events_url":"https://api.github.com/users/caseypt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"caseypt","id":1042475,"avatar_url":"https://avatars.githubusercontent.com/u/1042475?v=3","gravatar_id":"","url":"https://api.github.com/users/caseypt","html_url":"https://github.com/caseypt","followers_url":"https://api.github.com/users/caseypt/followers","following_url":"https://api.github.com/users/caseypt/following{/other_user}","gists_url":"https://api.github.com/users/caseypt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseypt/subscriptions","organizations_url":"https://api.github.com/users/caseypt/orgs","repos_url":"https://api.github.com/users/caseypt/repos","events_url":"https://api.github.com/users/caseypt/events{/privacy}","received_events_url":"https://api.github.com/users/caseypt/received_events","type":"User","site_admin":false},"assignees":[{"login":"caseypt","id":1042475,"avatar_url":"https://avatars.githubusercontent.com/u/1042475?v=3","gravatar_id":"","url":"https://api.github.com/users/caseypt","html_url":"https://github.com/caseypt","followers_url":"https://api.github.com/users/caseypt/followers","following_url":"https://api.github.com/users/caseypt/following{/other_user}","gists_url":"https://api.github.com/users/caseypt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseypt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseypt/subscriptions","organizations_url":"https://api.github.com/users/caseypt/orgs","repos_url":"https://api.github.com/users/caseypt/repos","events_url":"https://api.github.com/users/caseypt/events{/privacy}","received_events_url":"https://api.github.com/users/caseypt/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-07-21T20:01:51Z","updated_at":"2016-08-11T19:59:29Z","closed_at":"2016-08-11T19:59:29Z","body":"It seems that in all cases, the `layerId` property for layers in `service.layerInfos` are numbers. \r\n\r\nHowever, in some cases, the `layerId` for layers that are returned by `esriMap.getLayersVisibleAtScale` are strings while other times they are numbers. When they are strings, this statement fails to return any fails because the id comparison fails: https://github.com/CoastalResilienceNetwork/GeositeFramework/blob/master/src/GeositeFramework/js/Map.js#L277.\r\n\r\nIf we ensure that `layerId` is a number (by using `parseInt`) in the context of the above function, the legend works for the Restoration Explorer plugin.\r\n\r\nAccording to the documentation the id on the layer will always be a string (https://developers.arcgis.com/javascript/3/jsapi/layer-amd.html#id), but the id on the layer in a layerInfo will always be a number (https://developers.arcgis.com/javascript/3/jsapi/layerinfo-amd.html#id).\r\n\r\nThat doesn't appear to be the case. Note the data type of `layerId` in the screenshots below.\r\n\r\nSample layer for the New Jersey service:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1042475/17036815/e47fbc42-4f5b-11e6-98b3-d95b6b923c69.png)\r\n\r\nSample layer from the Restoration Explorer service:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1042475/17036865/1d532086-4f5c-11e6-9ee0-303030cd0e58.png)\r\n"}}
{"actor":{"display_login":"rajadain"}}