{"action":"reopened","issue":{"url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/issues/189","repository_url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas","labels_url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/issues/189/comments","events_url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/issues/189/events","html_url":"https://github.com/Innovate-Inc/EnviroAtlas/issues/189","id":169250229,"number":189,"title":"Selecting a community should add a definitionExpression to all community layers","user":{"login":"torrin47","id":2127036,"avatar_url":"https://avatars.githubusercontent.com/u/2127036?v=3","gravatar_id":"","url":"https://api.github.com/users/torrin47","html_url":"https://github.com/torrin47","followers_url":"https://api.github.com/users/torrin47/followers","following_url":"https://api.github.com/users/torrin47/following{/other_user}","gists_url":"https://api.github.com/users/torrin47/gists{/gist_id}","starred_url":"https://api.github.com/users/torrin47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torrin47/subscriptions","organizations_url":"https://api.github.com/users/torrin47/orgs","repos_url":"https://api.github.com/users/torrin47/repos","events_url":"https://api.github.com/users/torrin47/events{/privacy}","received_events_url":"https://api.github.com/users/torrin47/received_events","type":"User","site_admin":false},"labels":[{"id":261371855,"url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/labels/tableOfContents","name":"tableOfContents","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":{"login":"Baohong","id":5190408,"avatar_url":"https://avatars.githubusercontent.com/u/5190408?v=3","gravatar_id":"","url":"https://api.github.com/users/Baohong","html_url":"https://github.com/Baohong","followers_url":"https://api.github.com/users/Baohong/followers","following_url":"https://api.github.com/users/Baohong/following{/other_user}","gists_url":"https://api.github.com/users/Baohong/gists{/gist_id}","starred_url":"https://api.github.com/users/Baohong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baohong/subscriptions","organizations_url":"https://api.github.com/users/Baohong/orgs","repos_url":"https://api.github.com/users/Baohong/repos","events_url":"https://api.github.com/users/Baohong/events{/privacy}","received_events_url":"https://api.github.com/users/Baohong/received_events","type":"User","site_admin":false},"assignees":[{"login":"Baohong","id":5190408,"avatar_url":"https://avatars.githubusercontent.com/u/5190408?v=3","gravatar_id":"","url":"https://api.github.com/users/Baohong","html_url":"https://github.com/Baohong","followers_url":"https://api.github.com/users/Baohong/followers","following_url":"https://api.github.com/users/Baohong/following{/other_user}","gists_url":"https://api.github.com/users/Baohong/gists{/gist_id}","starred_url":"https://api.github.com/users/Baohong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baohong/subscriptions","organizations_url":"https://api.github.com/users/Baohong/orgs","repos_url":"https://api.github.com/users/Baohong/repos","events_url":"https://api.github.com/users/Baohong/events{/privacy}","received_events_url":"https://api.github.com/users/Baohong/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/milestones/20","html_url":"https://github.com/Innovate-Inc/EnviroAtlas/milestones/Milestone%2020","labels_url":"https://api.github.com/repos/Innovate-Inc/EnviroAtlas/milestones/20/labels","id":1947818,"number":20,"title":"Milestone 20","description":"Heating up!","creator":{"login":"torrin47","id":2127036,"avatar_url":"https://avatars.githubusercontent.com/u/2127036?v=3","gravatar_id":"","url":"https://api.github.com/users/torrin47","html_url":"https://github.com/torrin47","followers_url":"https://api.github.com/users/torrin47/followers","following_url":"https://api.github.com/users/torrin47/following{/other_user}","gists_url":"https://api.github.com/users/torrin47/gists{/gist_id}","starred_url":"https://api.github.com/users/torrin47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torrin47/subscriptions","organizations_url":"https://api.github.com/users/torrin47/orgs","repos_url":"https://api.github.com/users/torrin47/repos","events_url":"https://api.github.com/users/torrin47/events{/privacy}","received_events_url":"https://api.github.com/users/torrin47/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":5,"state":"closed","created_at":"2016-08-17T16:34:24Z","updated_at":"2016-11-30T18:02:27Z","due_on":"2016-08-31T00:00:00Z","closed_at":"2016-09-07T18:09:36Z"},"comments":0,"created_at":"2016-08-03T22:32:24Z","updated_at":"2016-11-30T18:02:27Z","closed_at":null,"body":"It looks like a feature layer has a method \"setDefinitionExpression\" which will filter the layer:  https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#setdefinitionexpression\nall of the community layers appear to have a community attribute - the \"Community\" field - that could be used for this definitionExpression.  So, when someone selects \"Durham, NC\", all the communities in the TOC would execute:  featureLayer.setDefinitionExpression(\"Community = 'Durham, NC'\");\nBaohong Ji (bji@innovateteam.com)\nSo it has nothing to do with the filter function in the AttributeTable, right?\nhehehehe.  no, probably not. i'm not sure, it's entirely possible that using the filter function in the AttributeTable actually does the same thing, and I'm very curious to see whether the AttributeTable will recognize the DefinitionExpression we set on the layer directly, but because the JavaScript API has that simple method, I think it would be far more straightforward to use it directly than to have one widget call another widget.\nBaohong Ji (bji@innovateteam.com)\nWhat is the aim of using the code of \"featureLayer.setDefinitionExpression(\"Community = 'Durham, NC'\");\"? to change symbology?\nwell, the thought is that the dynamic symbology widget will recognize the definition expression and include it in calculating statistics.  Esri is usually pretty good about this sort of thing.\nBaohong Ji (bji@innovateteam.com)\nSo what I need to do is just add that piece of code when I add the layer. That is, only show those features when add the layer, right?\nwell, yes, it will need to apply both to any newly added community layers as well as any community layers already added to the map.\nBaohong Ji (bji@innovateteam.com)\nWhat do you mean by \"any community layers already added to the map\"?\nsay someone adds a bunch of community layers to the map, then goes and selects Durham, NC, from the community selection widget.  that will zoom them to Durham, NC, and at that point, any community layers already added to the map will need to have that definition expression applied.  if they add a new community layer to the map while Durham is selected, it will also need that definition expression applied.  but then, if they switch to Fresno, CA, the definitionExpression will need to be changed for all those layers.\nBaohong Ji (bji@innovateteam.com)\nSo you mean the all the community layers will be shown for only one community? Is there any case that the user want to add one layer for community Durham, and then he want to add another layer but with community Fresno? I mean can Durham and Fresno coexist?\ni think the agreement was no - only one community could be selected at one time for the entire map. if someone wants to compare communities, we will need to implement the multiple map split screen functionality.\nBaohong Ji (bji@innovateteam.com)\nI have one related question: if the user have already added one community, say Durham. Then he selects another community in \"Select Community\" widget, Fresno but did not check on any of the layers in search filter. In this case, will the definitionExpression switch to Fresno?\nWhen you say that someone has already added one community, does that mean that they have selected that community in the Select Community Widget?\nbut they haven't added any map layers?\nBaohong Ji (bji@innovateteam.com)\nYes. he had selected Durham in \"Select Community widget\" and also he added a layer by check on one layer in \"search filter\". But layer if he open \"Select Community widget\" and select another community but make no further action (have not check on any selectable layers yet), Should we switch to the latter?\nyes.  the layer that was already selected needs to switch to Fresno\nBaohong Ji (bji@innovateteam.com)\nI see. Are you sure that \"the dynamic symbology widget will recognize the definition expression\"? If not, why do not we just make the dynamic symbology widget do the calculating statistics?\nwell, because of how the client described the workflow - that selecting a community would trigger certain actions, including recalculation of the statistics for community layers.  i'm not certain of the recalculation, but if we do it the other way, then the user would have to go through layer by layer to update symbology, rather than having it happen all at once when a community is selected.\nBaohong Ji (bji@innovateteam.com)\nOk. I will add the expressionDefintion for the added layers.\n"}}
{"actor":{"display_login":"torrin47"}}