{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/1655","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/1655/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/1655/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/1655/events","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/1655","id":81651020,"number":1655,"title":"shape annotations","user":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/feature","name":"feature","color":"0052cc"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/%E2%9A%A0%EF%B8%8F%20DO%20NOT%20MERGE","name":"⚠️ DO NOT MERGE","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/7","html_url":"https://github.com/mapbox/mapbox-gl-native/milestones/iOS%20Beta%202","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones/7/labels","id":1019113,"number":7,"title":"iOS Beta 2","description":"","creator":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":48,"state":"open","created_at":"2015-03-12T17:38:21Z","updated_at":"2015-05-29T16:58:34Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-05-27T22:24:02Z","updated_at":"2015-05-29T23:04:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/1655","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/1655","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/1655.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/1655.patch"},"body":"Runtime shape annotations. \r\n\r\n* [x] C++ API for adding single shape\r\n* [x] C++ API for adding multiples at once\r\n* [x] Runtime styling at annotation create time\r\n* [x] Exposes `StyleProperties` et al. to `Map` users\r\n* [ ] C++ API for reordering\r\n* [x] C++ API for removing\r\n* [ ] Cocoa API\r\n* [ ] Remove perf penalty when adding points and shapes at same time, since two invalidations occur\r\n* [ ] Track shapes across style changes\r\n* [ ] Bring in GeoJSONVT poly simplification - we could get away with punting for a bit here in exchange for performance were it not for [problems](https://dl.dropboxusercontent.com/u/575564/anigif-1432771398.gif) rendering shapes that span tiles. I do feel good about the state of where I left the GeoJSONVT work and could probably pretty quickly get it into shape to farm out the tiling of shape features instead of the current stopgap [naive tiling based on it](https://github.com/mapbox/mapbox-gl-native/blob/94f7e2fe1d61c28a407a541cb4af80b32412183d/src/mbgl/map/annotation.cpp#L184-L264). \r\n\r\nProblems/checkpoints: \r\n\r\n- [x] Adding shape annotations before style is finished loading misses rendering them. This is because `MapContext::updateAnnotationTiles()` [returns early](https://github.com/mapbox/mapbox-gl-native/blob/9722c92db67dd490aea7972b5d2466877cea4f57/src/mbgl/map/map_context.cpp#L153). This doesn't affect points as their styling is all wrapped up in the style parsing step (since the variable parts are covered in the runtime `{sprite}` property), the conclusion of which performs a render. Worked around right now with [a hack to add after a delay upon startup](https://github.com/mapbox/mapbox-gl-native/commit/9722c92db67dd490aea7972b5d2466877cea4f57#diff-f11c34ebd1af988a0ff3d8643d1dede8R157). \r\n\r\n- [ ] Threading sanity check. \r\n\r\n- [ ] General sanity check. This has been messy work. \r\n\r\n-\r\n\r\n```c++\r\nmap.addPointAnnotation(mbgl::LatLng(45, -120), \"default_marker\");\r\n\r\nmbgl::FillProperties fillProperties;\r\nfillProperties.fill_color = mbgl::Color({{ 1, 0, 0, 1 }});\r\nfillProperties.stroke_color = mbgl::Color({{ 0, 0, 0, 1 }});\r\nfillProperties.opacity = 0.25;\r\n\r\nmbgl::StyleProperties shapeProperties;\r\nshapeProperties.set<mbgl::FillProperties>(fillProperties);\r\n\r\nmap.addShapeAnnotation({\r\n    mbgl::LatLng(44, -122),\r\n    mbgl::LatLng(46, -122),\r\n    mbgl::LatLng(46, -121),\r\n    mbgl::LatLng(44, -122)\r\n}, shapeProperties);\r\n```\r\n\r\n![screen shot 2015-05-27 at 3 23 04 pm](https://cloud.githubusercontent.com/assets/17722/7848852/49ecd5b6-0484-11e5-847d-7a2b13bf7cf1.png)"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/106955367","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/1655#issuecomment-106955367","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/1655","id":106955367,"user":{"login":"incanus","id":17722,"avatar_url":"https://avatars.githubusercontent.com/u/17722?v=3","gravatar_id":"","url":"https://api.github.com/users/incanus","html_url":"https://github.com/incanus","followers_url":"https://api.github.com/users/incanus/followers","following_url":"https://api.github.com/users/incanus/following{/other_user}","gists_url":"https://api.github.com/users/incanus/gists{/gist_id}","starred_url":"https://api.github.com/users/incanus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incanus/subscriptions","organizations_url":"https://api.github.com/users/incanus/orgs","repos_url":"https://api.github.com/users/incanus/repos","events_url":"https://api.github.com/users/incanus/events{/privacy}","received_events_url":"https://api.github.com/users/incanus/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T23:04:20Z","updated_at":"2015-05-29T23:04:20Z","body":"BTW current impact of bad feature clipping is: \r\n\r\n* Lines: small gaps at tile borders. \r\n\r\n    ![screen shot 2015-05-29 at 4 03 10 pm](https://cloud.githubusercontent.com/assets/17722/7894277/3fb4063e-061c-11e5-9de5-74e201e8e7d9.png)\r\n\r\n* Polys: disappear. \r\n\r\n    ![screen shot 2015-05-29 at 4 03 20 pm](https://cloud.githubusercontent.com/assets/17722/7894280/4a935000-061c-11e5-8f76-cc6b873aa457.png)\r\n\r\n    ![screen shot 2015-05-29 at 4 03 23 pm](https://cloud.githubusercontent.com/assets/17722/7894281/5034442e-061c-11e5-9d5e-cc29fcc78512.png)"}}