{"action":"created","issue":{"url":"https://api.github.com/repos/Esri/image-discovery-app-js/issues/44","labels_url":"https://api.github.com/repos/Esri/image-discovery-app-js/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/Esri/image-discovery-app-js/issues/44/comments","events_url":"https://api.github.com/repos/Esri/image-discovery-app-js/issues/44/events","html_url":"https://github.com/Esri/image-discovery-app-js/issues/44","id":90366762,"number":44,"title":"Adding a new tool in the Geometry - Clone Search By Bounds and create new one","user":{"login":"soomro30","id":1238737,"avatar_url":"https://avatars.githubusercontent.com/u/1238737?v=3","gravatar_id":"","url":"https://api.github.com/users/soomro30","html_url":"https://github.com/soomro30","followers_url":"https://api.github.com/users/soomro30/followers","following_url":"https://api.github.com/users/soomro30/following{/other_user}","gists_url":"https://api.github.com/users/soomro30/gists{/gist_id}","starred_url":"https://api.github.com/users/soomro30/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soomro30/subscriptions","organizations_url":"https://api.github.com/users/soomro30/orgs","repos_url":"https://api.github.com/users/soomro30/repos","events_url":"https://api.github.com/users/soomro30/events{/privacy}","received_events_url":"https://api.github.com/users/soomro30/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-23T11:48:07Z","updated_at":"2015-06-25T11:26:27Z","closed_at":null,"body":"![fireshot screen capture 065 - base configuration application - 172_16_5_231_8080_image-discovery_site](https://cloud.githubusercontent.com/assets/1238737/8303846/0dffe690-19b2-11e5-81fb-9694246a3997.png)\r\n\r\nI want to clone SearchByBounds and create another tool or sixth tool in the geometry. I have tried but it looks very complex. Can you tell me quick way to create another tool of Search By Bounds \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Esri/image-discovery-app-js/issues/comments/115215085","html_url":"https://github.com/Esri/image-discovery-app-js/issues/44#issuecomment-115215085","issue_url":"https://api.github.com/repos/Esri/image-discovery-app-js/issues/44","id":115215085,"user":{"login":"soomro30","id":1238737,"avatar_url":"https://avatars.githubusercontent.com/u/1238737?v=3","gravatar_id":"","url":"https://api.github.com/users/soomro30","html_url":"https://github.com/soomro30","followers_url":"https://api.github.com/users/soomro30/followers","following_url":"https://api.github.com/users/soomro30/following{/other_user}","gists_url":"https://api.github.com/users/soomro30/gists{/gist_id}","starred_url":"https://api.github.com/users/soomro30/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soomro30/subscriptions","organizations_url":"https://api.github.com/users/soomro30/orgs","repos_url":"https://api.github.com/users/soomro30/repos","events_url":"https://api.github.com/users/soomro30/events{/privacy}","received_events_url":"https://api.github.com/users/soomro30/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T11:26:27Z","updated_at":"2015-06-25T11:26:27Z","body":"Thanks Rivera,\n\nI was able to create the search by coordinates tool but my search buffer is\nnot working.\n\nI have attached the screenshot.\n\nHow can I implement search by x,y as a center point and radius buffer as a\ncircle to bring results.\n\nYou can see in the image.\n\n\n\nOn Tue, Jun 23, 2015 at 9:00 PM, Richard Rivera <notifications@github.com>\nwrote:\n\n> What do you want the sixth tool to do? SearchByBounds is the most complex\n> of the search tools and would require quite a bit of code changes to\n> implement. Another geometry search (such as circle) would be much easier to\n> implement.\n>\n> you would add the toggle icon for the tool here:\n>\n>\n> https://github.com/Esri/image-discovery-app-js/blob/master/site/js/imagediscovery/ui/discover/template/ImageDiscoveryTemplate.html\n>\n> update the view model for the clicking of the toggle icon here (need to\n> turn off other tools when clicked)\n>\n>\n> https://github.com/Esri/image-discovery-app-js/blob/master/site/js/imagediscovery/ui/discover/model/ImageDiscoveryViewModel.js\n>\n> then you create an instance of your new widget here (reference how i\n> create an instance of SearchByBoundsWidget):\n>\n>\n> https://github.com/Esri/image-discovery-app-js/blob/master/site/js/imagediscovery/ui/discover/ImageDiscoveryWidget.js\n>\n> follow the serchbyBounds widget for eventing:\n>\n>\n> https://github.com/Esri/image-discovery-app-js/blob/master/site/js/imagediscovery/ui/discover/SearchByBoundsWidget.js\n>\n> inside of ImageDiscoveryWidget you need to listen on an even that your new\n> widget will publish when the user wants to search by their inputs (you\n> convert the input to an esri geometry). in ImageDiscoveryWidget you can see\n> that i am listening on \"boundsGeometryCreated\" to be called from the bounds\n> widget. This passes the geometry with the event where i use it to call\n> \"performSearchCallback\" which does the searching.\n>\n> this.searchByBoundsWidget.on(\"boundsGeometryCreated\",\n> this.performSearchCallback);\n>\n> Not TOO complicated but there are a lot of moving parts:\n>\n> 1) add icon to the html template\n> 2) set up viewModel binding\n> 3) create instance of your widget\n> - hook display/hide into the icon in step 1\n> - in ImageDiscoveryWidget listen on an event that passes an esri geometry\n> (you create geometry from user inputs)\n> - perform the search in ImageDiscoveryWidget (this. performSearchCallback\n> is scoped properly). look at line 399 in ImageDiscoveryWidget to see how I\n> listen for a geometry on the SearchByBoundsWidget\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/Esri/image-discovery-app-js/issues/44#issuecomment-114572655>\n> .\n>\n"}}