{"action":"created","issue":{"url":"https://api.github.com/repos/codeforboston/ungentry/issues/49","labels_url":"https://api.github.com/repos/codeforboston/ungentry/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/codeforboston/ungentry/issues/49/comments","events_url":"https://api.github.com/repos/codeforboston/ungentry/issues/49/events","html_url":"https://github.com/codeforboston/ungentry/issues/49","id":58506400,"number":49,"title":"relocate legend","user":{"login":"mjrouser","id":6425938,"avatar_url":"https://avatars.githubusercontent.com/u/6425938?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrouser","html_url":"https://github.com/mjrouser","followers_url":"https://api.github.com/users/mjrouser/followers","following_url":"https://api.github.com/users/mjrouser/following{/other_user}","gists_url":"https://api.github.com/users/mjrouser/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrouser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrouser/subscriptions","organizations_url":"https://api.github.com/users/mjrouser/orgs","repos_url":"https://api.github.com/users/mjrouser/repos","events_url":"https://api.github.com/users/mjrouser/events{/privacy}","received_events_url":"https://api.github.com/users/mjrouser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/codeforboston/ungentry/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/codeforboston/ungentry/milestones/1","html_url":"https://github.com/codeforboston/ungentry/milestones/1.0%20Release","labels_url":"https://api.github.com/repos/codeforboston/ungentry/milestones/1/labels","id":964742,"number":1,"title":"1.0 Release","description":"By the end of March, we would need to have a stable build ready to be publicized. \r\n\r\nRequired components:\r\n\r\n1.  All selected census data functioning and present.\r\n\r\n2. App modularized with RequireJS and BackboneJS \r\n\r\n3. UI redesign implemented \r\n\r\n4. Data included from at least one external API (4sq first, HMDA or Zillow second)","creator":{"login":"mjrouser","id":6425938,"avatar_url":"https://avatars.githubusercontent.com/u/6425938?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrouser","html_url":"https://github.com/mjrouser","followers_url":"https://api.github.com/users/mjrouser/followers","following_url":"https://api.github.com/users/mjrouser/following{/other_user}","gists_url":"https://api.github.com/users/mjrouser/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrouser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrouser/subscriptions","organizations_url":"https://api.github.com/users/mjrouser/orgs","repos_url":"https://api.github.com/users/mjrouser/repos","events_url":"https://api.github.com/users/mjrouser/events{/privacy}","received_events_url":"https://api.github.com/users/mjrouser/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":1,"state":"open","created_at":"2015-02-04T01:26:47Z","updated_at":"2015-03-05T17:43:10Z","due_on":"2015-03-31T04:00:00Z","closed_at":null},"comments":2,"created_at":"2015-02-22T15:35:38Z","updated_at":"2015-03-16T23:14:36Z","closed_at":null,"body":"We want to take the legend out of the map div and relocate it to the sidebar.  This way we will not have three instances of the legend, and can free up map space.  \r\n\r\nStep 1.: Break out the code from prospect/censuslayer/js/CensusLayer.js and create a require module in the src folder.\r\n\r\n``` javascript\r\n\t\t\t_loadLegend : function() {\r\n\r\n\t\t\t\tif (this._legend) {\r\n\t\t\t\t\tthis._map.removeControl(this._legend);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar self = this;\r\n\t\t\t\tthis._legend = L.control({position: 'bottomright'});\r\n\t\t\t\tthis._legend.onAdd = function (lwrapper) {\r\n\t\t\t\t\tdebugger;\r\n\t\t\t\t\tvar div = L.DomUtil.create('div', 'info legend');\r\n\t\t\t\t\tif (self._currentProperty!=\"\") {\r\n\r\n\t\t\t\t\t\tvar prop = self._properties_data[self._currentProperty];\r\n\r\n\t\t\t\t\t\tif (prop) {\r\n\t\t\t\t\t\t\tvar geo = prop.serie;\r\n\r\n\r\n\t\t\t\t\t\t\tdiv.innerHTML += '<h4>'+prop.title+'</h4>';\r\n\t\t\t\t\t\t\tfor (var i = 0; i < 5; i++) {\r\n\t\t\t\t\t\t\t    var range_min = geo[i].toFixed(0);\r\n\t\t\t\t\t\t\t    var range_max =  geo[i+1].toFixed(0);\r\n\t\t\t\t\t\t\t    var color =  self._getColor(geo, (parseFloat(range_max)+parseFloat(range_min))/2 );\r\n\t\t\t\t\t\t\t    div.innerHTML += '<i style=\"background: ' + color + ';\"></i> ' + range_min + prop.unit + \" - \" + range_max + prop.unit + '<br>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlwrapper.html(div);\r\n\t\t\t\t\t//return div;\r\n\t\t\t    \t};\r\n\t\t\t\tthis._legend.addTo($('.lwrapper'));\r\n\r\n```\r\n\r\nStep 2.: hack the `addTo()` method to attach the legend to `div.lwrapper`."},"comment":{"url":"https://api.github.com/repos/codeforboston/ungentry/issues/comments/81983297","html_url":"https://github.com/codeforboston/ungentry/issues/49#issuecomment-81983297","issue_url":"https://api.github.com/repos/codeforboston/ungentry/issues/49","id":81983297,"user":{"login":"mjrouser","id":6425938,"avatar_url":"https://avatars.githubusercontent.com/u/6425938?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrouser","html_url":"https://github.com/mjrouser","followers_url":"https://api.github.com/users/mjrouser/followers","following_url":"https://api.github.com/users/mjrouser/following{/other_user}","gists_url":"https://api.github.com/users/mjrouser/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrouser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrouser/subscriptions","organizations_url":"https://api.github.com/users/mjrouser/orgs","repos_url":"https://api.github.com/users/mjrouser/repos","events_url":"https://api.github.com/users/mjrouser/events{/privacy}","received_events_url":"https://api.github.com/users/mjrouser/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T23:14:36Z","updated_at":"2015-03-16T23:14:36Z","body":"@isaacchansky, have you had a chance to look at this this week?  :-)"}}