{"action":"created","issue":{"url":"https://api.github.com/repos/tangrams/tangram/issues/349","repository_url":"https://api.github.com/repos/tangrams/tangram","labels_url":"https://api.github.com/repos/tangrams/tangram/issues/349/labels{/name}","comments_url":"https://api.github.com/repos/tangrams/tangram/issues/349/comments","events_url":"https://api.github.com/repos/tangrams/tangram/issues/349/events","html_url":"https://github.com/tangrams/tangram/pull/349","id":163222560,"number":349,"title":"Add option to require text when drawing point","user":{"login":"bcamper","id":16733,"avatar_url":"https://avatars.githubusercontent.com/u/16733?v=3","gravatar_id":"","url":"https://api.github.com/users/bcamper","html_url":"https://github.com/bcamper","followers_url":"https://api.github.com/users/bcamper/followers","following_url":"https://api.github.com/users/bcamper/following{/other_user}","gists_url":"https://api.github.com/users/bcamper/gists{/gist_id}","starred_url":"https://api.github.com/users/bcamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcamper/subscriptions","organizations_url":"https://api.github.com/users/bcamper/orgs","repos_url":"https://api.github.com/users/bcamper/repos","events_url":"https://api.github.com/users/bcamper/events{/privacy}","received_events_url":"https://api.github.com/users/bcamper/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tangrams/tangram/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/tangrams/tangram/labels/needs-docs","name":"needs-docs","color":"c5def5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tangrams/tangram/milestones/13","html_url":"https://github.com/tangrams/tangram/milestones/v0.9.0","labels_url":"https://api.github.com/repos/tangrams/tangram/milestones/13/labels","id":1870176,"number":13,"title":"v0.9.0","description":null,"creator":{"login":"bcamper","id":16733,"avatar_url":"https://avatars.githubusercontent.com/u/16733?v=3","gravatar_id":"","url":"https://api.github.com/users/bcamper","html_url":"https://github.com/bcamper","followers_url":"https://api.github.com/users/bcamper/followers","following_url":"https://api.github.com/users/bcamper/following{/other_user}","gists_url":"https://api.github.com/users/bcamper/gists{/gist_id}","starred_url":"https://api.github.com/users/bcamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcamper/subscriptions","organizations_url":"https://api.github.com/users/bcamper/orgs","repos_url":"https://api.github.com/users/bcamper/repos","events_url":"https://api.github.com/users/bcamper/events{/privacy}","received_events_url":"https://api.github.com/users/bcamper/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-07-07T15:05:14Z","updated_at":"2016-07-07T15:16:34Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2016-06-30T17:37:41Z","updated_at":"2016-07-07T19:54:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tangrams/tangram/pulls/349","html_url":"https://github.com/tangrams/tangram/pull/349","diff_url":"https://github.com/tangrams/tangram/pull/349.diff","patch_url":"https://github.com/tangrams/tangram/pull/349.patch"},"body":"We added the ability to attach `text` to a `points` (or `points`-based style) draw group in v0.8.0. However, in that implementation, the text portion is **optional**, while the point itself is **required**: that is, the text will only draw if it's parent point is visible, but the converse is not true (the point will still draw, even if the text does *not* fit).\r\n\r\nThis PR adds an option to **require** the text: the point and text are co-dependent and will draw or not draw as a single unit, with a new `required` option:\r\n\r\n```\r\ndraw:\r\n   points:\r\n      color: red\r\n      size: 6px\r\n      text:\r\n         required: true # only draw parent point if text can also be drawn\r\n         font:\r\n            ...\r\n```\r\n\r\nThe default behavior is unchanged (e.g. `required: false`), for backwards compatibility (*however this is not necessary if we feel that `required: true` is a better default*).\r\n\r\nFollowing are some examples with/without required text. Note that in some cases, the number of culled POIs is modest/expected, while in others, many more are removed, likely due to tile boundaries (compound icon/text with long labels just occupy a lot of space). This is a concern, and perhaps reason to keep the default to not require text. We can improve with future label improvements such as multiple label anchor placements (e.g. if label doesn't fit on bottom, try placing on right, etc.), and moving label collision into screenspace (on the main thread) to allow labels to cross tile boundaries (a bigger but ultimately important change).\r\n\r\n![output_kbnnpf](https://cloud.githubusercontent.com/assets/16733/16497846/f99e1cd6-3ec6-11e6-87bc-b95f6251e512.gif)\r\n\r\n![output_l6br2o](https://cloud.githubusercontent.com/assets/16733/16497848/fcf534dc-3ec6-11e6-9dc6-8677710be88b.gif)\r\n\r\n![output_l8vupr](https://cloud.githubusercontent.com/assets/16733/16497852/011a99ee-3ec7-11e6-87a3-506d84fe3733.gif)\r\n\r\n![output_38mxej](https://cloud.githubusercontent.com/assets/16733/16497854/038278d2-3ec7-11e6-99a1-dcdadf3c5a65.gif)\r\n\r\n**Road Shields**\r\nRelated work in this PR allows linked text and points to not collide with one another, which helps to enable road shields. Further work is likely required for full road shield support, but an initial example has been added to the bundled Tangram demo:\r\n\r\n![screen shot 2016-06-29 at 7 22 58 pm](https://cloud.githubusercontent.com/assets/16733/16497995/a232e354-3ec7-11e6-8cb5-c03b905592f4.png)\r\n\r\n![screen shot 2016-06-29 at 7 23 49 pm](https://cloud.githubusercontent.com/assets/16733/16497993/a2325da8-3ec7-11e6-809c-1d2f12c80a51.png)\r\n\r\n![screen shot 2016-06-29 at 7 24 29 pm](https://cloud.githubusercontent.com/assets/16733/16497994/a232895e-3ec7-11e6-9d0f-65cb112f95db.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/tangrams/tangram/issues/comments/231188611","html_url":"https://github.com/tangrams/tangram/pull/349#issuecomment-231188611","issue_url":"https://api.github.com/repos/tangrams/tangram/issues/349","id":231188611,"user":{"login":"bcamper","id":16733,"avatar_url":"https://avatars.githubusercontent.com/u/16733?v=3","gravatar_id":"","url":"https://api.github.com/users/bcamper","html_url":"https://github.com/bcamper","followers_url":"https://api.github.com/users/bcamper/followers","following_url":"https://api.github.com/users/bcamper/following{/other_user}","gists_url":"https://api.github.com/users/bcamper/gists{/gist_id}","starred_url":"https://api.github.com/users/bcamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcamper/subscriptions","organizations_url":"https://api.github.com/users/bcamper/orgs","repos_url":"https://api.github.com/users/bcamper/repos","events_url":"https://api.github.com/users/bcamper/events{/privacy}","received_events_url":"https://api.github.com/users/bcamper/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T19:54:42Z","updated_at":"2016-07-07T19:54:42Z","body":"Thanks. I would like to stick with this then, I think it is most consistent with existing syntax:\r\n\r\n```\r\npoints:\r\n  ...\r\n  text:\r\n    optional: true\r\n    ...\r\n```"}}
{"actor":{"display_login":"bcamper"}}