{"action":"created","issue":{"url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/2591","repository_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf","labels_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/2591/labels{/name}","comments_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/2591/comments","events_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/2591/events","html_url":"https://github.com/fgpv-vpgf/fgpv-vpgf/pull/2591","id":303475701,"number":2591,"title":"Api 06 - SimpleLayer, BaseGeometry, Point","user":{"login":"JahidAhmed","id":9637542,"avatar_url":"https://avatars0.githubusercontent.com/u/9637542?v=4","gravatar_id":"","url":"https://api.github.com/users/JahidAhmed","html_url":"https://github.com/JahidAhmed","followers_url":"https://api.github.com/users/JahidAhmed/followers","following_url":"https://api.github.com/users/JahidAhmed/following{/other_user}","gists_url":"https://api.github.com/users/JahidAhmed/gists{/gist_id}","starred_url":"https://api.github.com/users/JahidAhmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JahidAhmed/subscriptions","organizations_url":"https://api.github.com/users/JahidAhmed/orgs","repos_url":"https://api.github.com/users/JahidAhmed/repos","events_url":"https://api.github.com/users/JahidAhmed/events{/privacy}","received_events_url":"https://api.github.com/users/JahidAhmed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"james-rae","id":7585245,"avatar_url":"https://avatars3.githubusercontent.com/u/7585245?v=4","gravatar_id":"","url":"https://api.github.com/users/james-rae","html_url":"https://github.com/james-rae","followers_url":"https://api.github.com/users/james-rae/followers","following_url":"https://api.github.com/users/james-rae/following{/other_user}","gists_url":"https://api.github.com/users/james-rae/gists{/gist_id}","starred_url":"https://api.github.com/users/james-rae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-rae/subscriptions","organizations_url":"https://api.github.com/users/james-rae/orgs","repos_url":"https://api.github.com/users/james-rae/repos","events_url":"https://api.github.com/users/james-rae/events{/privacy}","received_events_url":"https://api.github.com/users/james-rae/received_events","type":"User","site_admin":false},"assignees":[{"login":"james-rae","id":7585245,"avatar_url":"https://avatars3.githubusercontent.com/u/7585245?v=4","gravatar_id":"","url":"https://api.github.com/users/james-rae","html_url":"https://github.com/james-rae","followers_url":"https://api.github.com/users/james-rae/followers","following_url":"https://api.github.com/users/james-rae/following{/other_user}","gists_url":"https://api.github.com/users/james-rae/gists{/gist_id}","starred_url":"https://api.github.com/users/james-rae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-rae/subscriptions","organizations_url":"https://api.github.com/users/james-rae/orgs","repos_url":"https://api.github.com/users/james-rae/repos","events_url":"https://api.github.com/users/james-rae/events{/privacy}","received_events_url":"https://api.github.com/users/james-rae/received_events","type":"User","site_admin":false},{"login":"milesap","id":10187181,"avatar_url":"https://avatars1.githubusercontent.com/u/10187181?v=4","gravatar_id":"","url":"https://api.github.com/users/milesap","html_url":"https://github.com/milesap","followers_url":"https://api.github.com/users/milesap/followers","following_url":"https://api.github.com/users/milesap/following{/other_user}","gists_url":"https://api.github.com/users/milesap/gists{/gist_id}","starred_url":"https://api.github.com/users/milesap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milesap/subscriptions","organizations_url":"https://api.github.com/users/milesap/orgs","repos_url":"https://api.github.com/users/milesap/repos","events_url":"https://api.github.com/users/milesap/events{/privacy}","received_events_url":"https://api.github.com/users/milesap/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-03-08T13:16:31Z","updated_at":"2018-03-08T18:08:37Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/pulls/2591","html_url":"https://github.com/fgpv-vpgf/fgpv-vpgf/pull/2591","diff_url":"https://github.com/fgpv-vpgf/fgpv-vpgf/pull/2591.diff","patch_url":"https://github.com/fgpv-vpgf/fgpv-vpgf/pull/2591.patch"},"body":"## Description\r\nCloses #2588 \r\nAdds functionality to add `SimpleLayers` and custom points on the map\r\n\r\nAlso fixes a couple small related bugs:\r\n- Datatable updating content on reload if it was previously open\r\n- Refresh interval not appearing for incorrect layers in settings panel\r\n\r\nTo be completed in another PR (added TODOs):\r\n- `enhancements to `icon` property to allow for non-urls\r\n- observing features / geometry clicks, and mouse events\r\n\r\n## Testing\r\n```js\r\nSETUP\r\n    // add layer to map\r\n    RZ.mapById('mobile-map').layers.addLayer('simpleLayer');\r\n\r\n    // set the config layer to a constant for ease of use\r\n    const simpleLayer = RZ.mapById('mobile-map').layers.getLayersById('simpleLayer')[0];\r\n\r\nADD GEOMETRY\r\n    // subscribe to geometry added\r\n    simpleLayer.geometryAdded.subscribe(l => console.log('Geometry added'));\r\n\r\n    // create different types of API points\r\n    const pointA = new RZ.GEO.Point(0, 'https://image.flaticon.com/icons/svg/17/17799.svg', [-79, 43]);\r\n    const pointB = new RZ.GEO.Point(1, '', [-79, 32]);\r\n\r\n    // add points to layer using the different available options\r\n    simpleLayer.addGeometry(pointA);\r\n\r\n    // pointA was already added, will be ignored this time and only pointB will be added\r\n    simpleLayer.addGeometry([ pointA, pointB ]);\r\n\r\n    // expect 'Geometry added' to appear in the console after every time a point was added\r\n\r\nREMOVE GEOMETRY\r\n    // subscribe to geometry removed\r\n    simpleLayer.geometryRemoved.subscribe(l => console.log('Geometry removed'));\r\n\r\n    // remove single geometry instance\r\n    simpleLayer.removeGeometry('0');\r\n\r\n    // expect 'Geometry removed' to appear in the console\r\n\r\n...\r\n```\r\n\r\n## Documentation\r\nhttps://jahidahmed.github.io/docs/api/developer/index.html\r\n\r\n## Checklist\r\n<!-- Quick checklist for items that are easy to miss -->\r\n\r\n- [x] Commit messages follow [the guidelines](https://github.com/fgpv-vpgf/fgpv-vpgf/blob/master/CONTRIBUTING.md#-git-commit-guidelines)\r\n- [ ] Release notes have been updated\r\n- [x] PR targets the correct release version\r\n- [x] Help files and documentation have been updated\r\n\r\nRemember, it is a *muffin offence* to open a PR with any of the above checklist items incomplete.\r\n\r\nPlease keep the original issue up to date with the final solution, expected behaviour, and any additional notes for testers\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/fgpv-vpgf/fgpv-vpgf/2591)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/comments/371572968","html_url":"https://github.com/fgpv-vpgf/fgpv-vpgf/pull/2591#issuecomment-371572968","issue_url":"https://api.github.com/repos/fgpv-vpgf/fgpv-vpgf/issues/2591","id":371572968,"user":{"login":"james-rae","id":7585245,"avatar_url":"https://avatars3.githubusercontent.com/u/7585245?v=4","gravatar_id":"","url":"https://api.github.com/users/james-rae","html_url":"https://github.com/james-rae","followers_url":"https://api.github.com/users/james-rae/followers","following_url":"https://api.github.com/users/james-rae/following{/other_user}","gists_url":"https://api.github.com/users/james-rae/gists{/gist_id}","starred_url":"https://api.github.com/users/james-rae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-rae/subscriptions","organizations_url":"https://api.github.com/users/james-rae/orgs","repos_url":"https://api.github.com/users/james-rae/repos","events_url":"https://api.github.com/users/james-rae/events{/privacy}","received_events_url":"https://api.github.com/users/james-rae/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T18:08:37Z","updated_at":"2018-03-08T18:08:37Z","author_association":"CONTRIBUTOR","body":"Miles; all good suggestions. Think they need a longer conversation instead of amendments to this PR.  I could type paragraphs here lol.\n\n---\n\nReviewed 11 of 47 files at r1.\nReview status: all files reviewed at latest revision, 2 unresolved discussions.\n\n---\n\n*[api/src/layers.ts, line 734 at r1](https://beta.reviewable.io/reviews/fgpv-vpgf/fgpv-vpgf/2591#-L75SfGeAXNoB_TWF_4x:-L75SfGeAXNoB_TWF_4y:b-pav8vh) ([raw file](https://github.com/fgpv-vpgf/fgpv-vpgf/blob/d75a40ad83d9421940ceeeaf1601538a352da463/api/src/layers.ts#L734)):*\n> ```XML\n> \n>     /** Providing a layer json snippet returns a `ConfigLayer`.*/\n>     addLayer(layerJSON: JSON): void;    // change return type after if we want to return something  ?\n> ```\n\nif its available, you probably want to return the ConfigLayer / SimpleLayer object that was created. \n\n---\n\n\n*Comments from [Reviewable](https://beta.reviewable.io/reviews/fgpv-vpgf/fgpv-vpgf/2591#-:-L75n5EODE9rTRlLS2KX:b-l0sjw6)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"james-rae"}}