{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/5095","repository_url":"https://api.github.com/repos/openlayers/ol3","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/5095/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/5095/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/5095/events","html_url":"https://github.com/openlayers/ol3/issues/5095","id":142661145,"number":5095,"title":"Modify interaction and Box/Square geometry","user":{"login":"sandman7920","id":3589417,"avatar_url":"https://avatars.githubusercontent.com/u/3589417?v=3","gravatar_id":"","url":"https://api.github.com/users/sandman7920","html_url":"https://github.com/sandman7920","followers_url":"https://api.github.com/users/sandman7920/followers","following_url":"https://api.github.com/users/sandman7920/following{/other_user}","gists_url":"https://api.github.com/users/sandman7920/gists{/gist_id}","starred_url":"https://api.github.com/users/sandman7920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandman7920/subscriptions","organizations_url":"https://api.github.com/users/sandman7920/orgs","repos_url":"https://api.github.com/users/sandman7920/repos","events_url":"https://api.github.com/users/sandman7920/events{/privacy}","received_events_url":"https://api.github.com/users/sandman7920/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openlayers/ol3/labels/pull%20request%20accepted","name":"pull request accepted","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-22T14:07:53Z","updated_at":"2016-03-24T14:28:42Z","closed_at":null,"body":"Some versions ago in Draw interaction 'geometryFunction' was introduced, and now it's easy to draw custom geometry type\r\nhttp://openlayers.org/en/v3.14.2/examples/draw-features.html\r\n```javascript\r\nif (value !== 'None') {\r\n          var geometryFunction, maxPoints;\r\n          if (value === 'Square') {\r\n            value = 'Circle';\r\n            geometryFunction = ol.interaction.Draw.createRegularPolygon(4);\r\n          } else if (value === 'Box') {\r\n            value = 'LineString';\r\n            maxPoints = 2;\r\n            geometryFunction = function(coordinates, geometry) {\r\n              if (!geometry) {\r\n                geometry = new ol.geom.Polygon(null);\r\n              }\r\n              var start = coordinates[0];\r\n              var end = coordinates[1];\r\n              geometry.setCoordinates([\r\n                [start, [start[0], end[1]], end, [end[0], start[1]], start]\r\n              ]);\r\n              return geometry;\r\n            };\r\n          }\r\n          draw = new ol.interaction.Draw({\r\n            source: source,\r\n            type: /** @type {ol.geom.GeometryType} */ (value),\r\n            geometryFunction: geometryFunction,\r\n            maxPoints: maxPoints\r\n          });\r\n          map.addInteraction(draw);\r\n        }\r\n```\r\n\r\nIs it possible to have something like that in ol.interaction.Modify, or is there another way to customize geometry.\r\n\r\nNow i put name property to feature in draw and then in modifyinteraction.js (ugly hack and ugly code /poor javascript skills/) depends on the value of the property i make custom geometry\r\n\r\nP.S.\r\nIs there plan to add rectangle geometry or something like that.\r\n\r\nP.S. 2\r\nSorry for my English\r\n"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/200862324","html_url":"https://github.com/openlayers/ol3/issues/5095#issuecomment-200862324","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/5095","id":200862324,"user":{"login":"sandman7920","id":3589417,"avatar_url":"https://avatars.githubusercontent.com/u/3589417?v=3","gravatar_id":"","url":"https://api.github.com/users/sandman7920","html_url":"https://github.com/sandman7920","followers_url":"https://api.github.com/users/sandman7920/followers","following_url":"https://api.github.com/users/sandman7920/following{/other_user}","gists_url":"https://api.github.com/users/sandman7920/gists{/gist_id}","starred_url":"https://api.github.com/users/sandman7920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandman7920/subscriptions","organizations_url":"https://api.github.com/users/sandman7920/orgs","repos_url":"https://api.github.com/users/sandman7920/repos","events_url":"https://api.github.com/users/sandman7920/events{/privacy}","received_events_url":"https://api.github.com/users/sandman7920/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T14:28:42Z","updated_at":"2016-03-24T14:28:42Z","body":"Great thanks. "}}