{"action":"created","issue":{"url":"https://api.github.com/repos/NewSignature/us-map/issues/39","labels_url":"https://api.github.com/repos/NewSignature/us-map/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/NewSignature/us-map/issues/39/comments","events_url":"https://api.github.com/repos/NewSignature/us-map/issues/39/events","html_url":"https://github.com/NewSignature/us-map/issues/39","id":42675803,"number":39,"title":"Cannot set width of map based on percentage.","user":{"login":"CaptainStack","id":1592484,"avatar_url":"https://avatars.githubusercontent.com/u/1592484?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainStack","html_url":"https://github.com/CaptainStack","followers_url":"https://api.github.com/users/CaptainStack/followers","following_url":"https://api.github.com/users/CaptainStack/following{/other_user}","gists_url":"https://api.github.com/users/CaptainStack/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainStack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainStack/subscriptions","organizations_url":"https://api.github.com/users/CaptainStack/orgs","repos_url":"https://api.github.com/users/CaptainStack/repos","events_url":"https://api.github.com/users/CaptainStack/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainStack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-09-12T22:13:29Z","updated_at":"2015-01-22T20:43:40Z","closed_at":null,"body":"If you attempt to size the containing div with a percentage rather than an explicit pixel-based height/width, the map will be rendered in full size and cut off beyond the size of its containing div, rather than shrinking the map to fit into the div."},"comment":{"url":"https://api.github.com/repos/NewSignature/us-map/issues/comments/71094922","html_url":"https://github.com/NewSignature/us-map/issues/39#issuecomment-71094922","issue_url":"https://api.github.com/repos/NewSignature/us-map/issues/39","id":71094922,"user":{"login":"bobsawyer","id":1920362,"avatar_url":"https://avatars.githubusercontent.com/u/1920362?v=3","gravatar_id":"","url":"https://api.github.com/users/bobsawyer","html_url":"https://github.com/bobsawyer","followers_url":"https://api.github.com/users/bobsawyer/followers","following_url":"https://api.github.com/users/bobsawyer/following{/other_user}","gists_url":"https://api.github.com/users/bobsawyer/gists{/gist_id}","starred_url":"https://api.github.com/users/bobsawyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobsawyer/subscriptions","organizations_url":"https://api.github.com/users/bobsawyer/orgs","repos_url":"https://api.github.com/users/bobsawyer/repos","events_url":"https://api.github.com/users/bobsawyer/events{/privacy}","received_events_url":"https://api.github.com/users/bobsawyer/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T20:43:40Z","updated_at":"2015-01-22T20:43:40Z","body":"On lines 158-159, the container width is set via:\r\nvar xscale = this.element.width()/WIDTH; \r\nvar yscale = this.element.height()/HEIGHT; \r\n\r\nBut if you change those to:\r\nvar xscale = WIDTH/this.element.width();\r\nvar yscale = HEIGHT/this.element.height();\r\n\r\nThen the map scales to fit the container.\r\nI forked this and made those plus a few other minor tweaks and am using it on a corporate site rebuild. It's not 100% perfect but it works pretty well.\r\nhttps://github.com/bobsawyer/us-map-scale"}}