{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/1431","repository_url":"https://api.github.com/repos/CartoDB/cartodb.js","labels_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/1431/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/1431/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/1431/events","html_url":"https://github.com/CartoDB/cartodb.js/pull/1431","id":181612355,"number":1431,"title":"[WIP] Geometry drawing","user":{"login":"alonsogarciapablo","id":390398,"avatar_url":"https://avatars.githubusercontent.com/u/390398?v=3","gravatar_id":"","url":"https://api.github.com/users/alonsogarciapablo","html_url":"https://github.com/alonsogarciapablo","followers_url":"https://api.github.com/users/alonsogarciapablo/followers","following_url":"https://api.github.com/users/alonsogarciapablo/following{/other_user}","gists_url":"https://api.github.com/users/alonsogarciapablo/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsogarciapablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsogarciapablo/subscriptions","organizations_url":"https://api.github.com/users/alonsogarciapablo/orgs","repos_url":"https://api.github.com/users/alonsogarciapablo/repos","events_url":"https://api.github.com/users/alonsogarciapablo/events{/privacy}","received_events_url":"https://api.github.com/users/alonsogarciapablo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-07T08:33:02Z","updated_at":"2016-10-07T08:47:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb.js/pulls/1431","html_url":"https://github.com/CartoDB/cartodb.js/pull/1431","diff_url":"https://github.com/CartoDB/cartodb.js/pull/1431.diff","patch_url":"https://github.com/CartoDB/cartodb.js/pull/1431.patch"},"body":"Part of https://github.com/CartoDB/cartodb.js/issues/1423.\r\n\r\nI'm opening this PR to explain what the API looks like so far, and get some early feedback 😄 \r\n\r\nBut first, a little demo (source code is [here](https://github.com/CartoDB/cartodb.js/blob/geometry-management/examples/v4/geometry-drawing.html)):\r\n\r\n![geometries](https://cloud.githubusercontent.com/assets/390398/19183277/dd67da4e-8c77-11e6-9447-d67a497da429.gif)\r\n\r\n## API\r\n\r\n**Starting to \"draw\" a geometry (disables map interaction):**\r\n```\r\nvis.map.drawPoint(); // returns a Point\r\nvis.map.drawPolygon(); // returns a Polygon\r\nvis.map.drawPolyline(); // returns a Polyline\r\n```\r\n\r\n**Stopping \"drawing mode\" (re-enables map interaction):**\r\n```\r\nvis.map.stopDrawing();\r\n```\r\n\r\n**Working with points:**\r\n```\r\nvar point = vis.map.drawPoint();\r\npoint.on('change:geojson', function (point) {\r\n  console.log(point.toGeoJSON());\r\n});\r\npoint.isComplete();\r\n```\r\n\r\n**Working with polygons:**\r\n```\r\nvar polygon = vis.map.drawPolygon();\r\npolygon.on('change:geojson', function (polygon) {\r\n  console.log(polygon.toGeoJSON());\r\n});\r\npolygon.isComplete();\r\n```\r\n\r\n**Working with polylines:**\r\n```\r\nvar polyline = vis.map.drawPolyline();\r\npolyline.on('change:geojson', function (polyline) {\r\n  console.log(polyline.toGeoJSON());\r\n});\r\npolyline.isComplete();\r\n```\r\n\r\nI think this is all we need to start implementing \"feature drawing\" in the Builder. I'd love your feedback!\r\n\r\ncc: @rochoa @javisantana @xavijam "},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/comments/252185805","html_url":"https://github.com/CartoDB/cartodb.js/pull/1431#issuecomment-252185805","issue_url":"https://api.github.com/repos/CartoDB/cartodb.js/issues/1431","id":252185805,"user":{"login":"alonsogarciapablo","id":390398,"avatar_url":"https://avatars.githubusercontent.com/u/390398?v=3","gravatar_id":"","url":"https://api.github.com/users/alonsogarciapablo","html_url":"https://github.com/alonsogarciapablo","followers_url":"https://api.github.com/users/alonsogarciapablo/followers","following_url":"https://api.github.com/users/alonsogarciapablo/following{/other_user}","gists_url":"https://api.github.com/users/alonsogarciapablo/gists{/gist_id}","starred_url":"https://api.github.com/users/alonsogarciapablo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alonsogarciapablo/subscriptions","organizations_url":"https://api.github.com/users/alonsogarciapablo/orgs","repos_url":"https://api.github.com/users/alonsogarciapablo/repos","events_url":"https://api.github.com/users/alonsogarciapablo/events{/privacy}","received_events_url":"https://api.github.com/users/alonsogarciapablo/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T08:47:17Z","updated_at":"2016-10-07T08:47:17Z","body":"> I miss editing feauture api.\r\n\r\nI guess you're referring to the second part of https://github.com/CartoDB/cartodb.js/issues/1423, which is what I'm about to start working on. Basically: being able to listen to clicks on features and being able to add features (editable) based on some GeoJSON... right?"}}
{"actor":{"display_login":"alonsogarciapablo"}}