{"action":"created","comment":{"url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/comments/64592226","id":64592226,"diff_hunk":"@@ -0,0 +1,138 @@\n+<!DOCTYPE html>\n+<html>\n+<head>\n+  <meta charset=\"utf-8\">\n+  <meta name=\"viewport\" content=\"initial-scale=1,maximum-scale=1,user-scalable=no\">\n+  <title>Search with Query Task</title>\n+\n+  <link rel=\"stylesheet\" href=\"https://js.arcgis.com/4.0/esri/css/main.css\">\n+  \n+  <style>\n+    html, body, #viewDiv {\n+      padding: 0;\n+      margin: 0;\n+      height: 100%;\n+    }\n+  </style>\n+\n+  <script src=\"https://js.arcgis.com/4.0/\"></script>\n+\n+  <script>\n+    require([\n+      \"esri/Map\",\n+      \"esri/views/MapView\",\n+      \"esri/layers/FeatureLayer\",\n+      \"esri/tasks/QueryTask\",\n+      \"esri/tasks/support/Query\",\n+      \"esri/symbols/SimpleMarkerSymbol\",\n+      \"esri/core/watchUtils\",\n+      \"dojo/on\",\n+      \"dojo/dom\",\n+      \"dojo/domReady!\"\n+    ], function(Map, MapView, FeatureLayer, QueryTask, Query, SimpleMarkerSymbol, watchUtils, on, dom) {\n+\n+      var map = new Map({\n+        basemap: \"dark-gray-vector\"\n+      });\n+\n+      var view = new MapView({\n+        container: \"viewDiv\",\n+        map: map,\n+        center: [-122.68, 45.52], // lon, lat\n+        zoom: 10\n+      });\n+\n+      // Create query task to reference the PDX_Rail_Stops_Styled feature layer      \n+      var queryTask = new QueryTask({\n+        url: \"http://services.arcgis.com/uCXeTVveQzP4IIcx/arcgis/rest/services/PDX_Rail_Stops_Styled/FeatureServer/0\"\n+      });\n+\n+      // Only return three fields\n+      var query = new Query({\n+        returnGeometry: true,\n+        outFields: [\"STATION\", \"LINE\", \"TYPE\"],\n+        where: \"\"\n+      });\n+\n+      // Perform query on load\n+      getFeatures(\"TYPE = 'MAX'\");\n+\n+      // Get features with sql clause\n+      function getFeatures(sql) {\n+        query.where = sql;\n+        queryTask.execute(query).then(function(results) {\n+          if (!view.ready) {\n+            watchUtils.whenTrueOnce(view, \"ready\", function() {\n+              addFeatures(results.features);\n+            })\n+          } else {\n+            addFeatures(results.features);\n+          }\n+        });\n+      }\n+\n+      // Add features as graphics\n+      function addFeatures(features) {\n+        var color,\n+          symbol;\n+        // Color\n+        switch (features[0].attributes.TYPE) {\n+          case \"MAX\":\n+            color = [237, 81, 81]\n+            break;\n+          case \"CR\":\n+            color = [167, 198, 54]\n+            break;\n+          case \"SC\":\n+            color = [20, 158, 206]\n+            break;\n+        }\n+        symbol = new SimpleMarkerSymbol({\n+          color: color,\n+          size: 8,\n+          outline: {\n+            color: [ 255, 255, 255 ],\n+            width: 1\n+          }\n+        });\n+        // Set symbol and popup template\n+        for (var i=0; i < features.length; i++) {\n+          var feature = features[i];\n+          feature.symbol = symbol;\n+          feature.popupTemplate = {","path":"develop/jsapi/search_with_query_task/index.html","position":102,"original_position":102,"commit_id":"736d8935f5cf21d27cff723f9aa98c5097cfe192","original_commit_id":"736d8935f5cf21d27cff723f9aa98c5097cfe192","user":{"login":"alaframboise","id":2539681,"avatar_url":"https://avatars.githubusercontent.com/u/2539681?v=3","gravatar_id":"","url":"https://api.github.com/users/alaframboise","html_url":"https://github.com/alaframboise","followers_url":"https://api.github.com/users/alaframboise/followers","following_url":"https://api.github.com/users/alaframboise/following{/other_user}","gists_url":"https://api.github.com/users/alaframboise/gists{/gist_id}","starred_url":"https://api.github.com/users/alaframboise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alaframboise/subscriptions","organizations_url":"https://api.github.com/users/alaframboise/orgs","repos_url":"https://api.github.com/users/alaframboise/repos","events_url":"https://api.github.com/users/alaframboise/events{/privacy}","received_events_url":"https://api.github.com/users/alaframboise/received_events","type":"User","site_admin":false},"body":"The problem is that the amount of code is already distracting enough from the focus on query task.","created_at":"2016-05-25T15:16:10Z","updated_at":"2016-05-25T15:16:10Z","html_url":"https://github.com/Esri/geodev-hackerlabs/pull/126#discussion_r64592226","pull_request_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126","_links":{"self":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/comments/64592226"},"html":{"href":"https://github.com/Esri/geodev-hackerlabs/pull/126#discussion_r64592226"},"pull_request":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126"}}},"pull_request":{"url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126","id":71323035,"html_url":"https://github.com/Esri/geodev-hackerlabs/pull/126","diff_url":"https://github.com/Esri/geodev-hackerlabs/pull/126.diff","patch_url":"https://github.com/Esri/geodev-hackerlabs/pull/126.patch","issue_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues/126","number":126,"state":"open","locked":false,"title":"Converted search_with_query_task to 4.0","user":{"login":"alaframboise","id":2539681,"avatar_url":"https://avatars.githubusercontent.com/u/2539681?v=3","gravatar_id":"","url":"https://api.github.com/users/alaframboise","html_url":"https://github.com/alaframboise","followers_url":"https://api.github.com/users/alaframboise/followers","following_url":"https://api.github.com/users/alaframboise/following{/other_user}","gists_url":"https://api.github.com/users/alaframboise/gists{/gist_id}","starred_url":"https://api.github.com/users/alaframboise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alaframboise/subscriptions","organizations_url":"https://api.github.com/users/alaframboise/orgs","repos_url":"https://api.github.com/users/alaframboise/repos","events_url":"https://api.github.com/users/alaframboise/events{/privacy}","received_events_url":"https://api.github.com/users/alaframboise/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-25T02:50:15Z","updated_at":"2016-05-25T15:16:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d0b1abae2a80d7b5087c4c216f9efa2e0ec48a6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126/commits","review_comments_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126/comments","review_comment_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues/126/comments","statuses_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/statuses/736d8935f5cf21d27cff723f9aa98c5097cfe192","head":{"label":"alaframboise:gh-pages","ref":"gh-pages","sha":"736d8935f5cf21d27cff723f9aa98c5097cfe192","user":{"login":"alaframboise","id":2539681,"avatar_url":"https://avatars.githubusercontent.com/u/2539681?v=3","gravatar_id":"","url":"https://api.github.com/users/alaframboise","html_url":"https://github.com/alaframboise","followers_url":"https://api.github.com/users/alaframboise/followers","following_url":"https://api.github.com/users/alaframboise/following{/other_user}","gists_url":"https://api.github.com/users/alaframboise/gists{/gist_id}","starred_url":"https://api.github.com/users/alaframboise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alaframboise/subscriptions","organizations_url":"https://api.github.com/users/alaframboise/orgs","repos_url":"https://api.github.com/users/alaframboise/repos","events_url":"https://api.github.com/users/alaframboise/events{/privacy}","received_events_url":"https://api.github.com/users/alaframboise/received_events","type":"User","site_admin":false},"repo":{"id":33574465,"name":"geodev-hackerlabs","full_name":"alaframboise/geodev-hackerlabs","owner":{"login":"alaframboise","id":2539681,"avatar_url":"https://avatars.githubusercontent.com/u/2539681?v=3","gravatar_id":"","url":"https://api.github.com/users/alaframboise","html_url":"https://github.com/alaframboise","followers_url":"https://api.github.com/users/alaframboise/followers","following_url":"https://api.github.com/users/alaframboise/following{/other_user}","gists_url":"https://api.github.com/users/alaframboise/gists{/gist_id}","starred_url":"https://api.github.com/users/alaframboise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alaframboise/subscriptions","organizations_url":"https://api.github.com/users/alaframboise/orgs","repos_url":"https://api.github.com/users/alaframboise/repos","events_url":"https://api.github.com/users/alaframboise/events{/privacy}","received_events_url":"https://api.github.com/users/alaframboise/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alaframboise/geodev-hackerlabs","description":"A place to learn how to build geo apps with the ArcGIS Platform.","fork":true,"url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs","forks_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/forks","keys_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/teams","hooks_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/hooks","issue_events_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/issues/events{/number}","events_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/events","assignees_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/assignees{/user}","branches_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/branches{/branch}","tags_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/tags","blobs_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/statuses/{sha}","languages_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/languages","stargazers_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/stargazers","contributors_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/contributors","subscribers_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/subscribers","subscription_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/subscription","commits_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/contents/{+path}","compare_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/merges","archive_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/downloads","issues_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/issues{/number}","pulls_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/pulls{/number}","milestones_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/milestones{/number}","notifications_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/labels{/name}","releases_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/releases{/id}","deployments_url":"https://api.github.com/repos/alaframboise/geodev-hackerlabs/deployments","created_at":"2015-04-07T23:54:23Z","updated_at":"2016-01-12T21:01:27Z","pushed_at":"2016-05-25T02:56:11Z","git_url":"git://github.com/alaframboise/geodev-hackerlabs.git","ssh_url":"git@github.com:alaframboise/geodev-hackerlabs.git","clone_url":"https://github.com/alaframboise/geodev-hackerlabs.git","svn_url":"https://github.com/alaframboise/geodev-hackerlabs","homepage":null,"size":6506,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"Esri:gh-pages","ref":"gh-pages","sha":"a3577ba31481abf861bc94e1cae1e0edad0e7aca","user":{"login":"Esri","id":628795,"avatar_url":"https://avatars.githubusercontent.com/u/628795?v=3","gravatar_id":"","url":"https://api.github.com/users/Esri","html_url":"https://github.com/Esri","followers_url":"https://api.github.com/users/Esri/followers","following_url":"https://api.github.com/users/Esri/following{/other_user}","gists_url":"https://api.github.com/users/Esri/gists{/gist_id}","starred_url":"https://api.github.com/users/Esri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Esri/subscriptions","organizations_url":"https://api.github.com/users/Esri/orgs","repos_url":"https://api.github.com/users/Esri/repos","events_url":"https://api.github.com/users/Esri/events{/privacy}","received_events_url":"https://api.github.com/users/Esri/received_events","type":"Organization","site_admin":false},"repo":{"id":33573485,"name":"geodev-hackerlabs","full_name":"Esri/geodev-hackerlabs","owner":{"login":"Esri","id":628795,"avatar_url":"https://avatars.githubusercontent.com/u/628795?v=3","gravatar_id":"","url":"https://api.github.com/users/Esri","html_url":"https://github.com/Esri","followers_url":"https://api.github.com/users/Esri/followers","following_url":"https://api.github.com/users/Esri/following{/other_user}","gists_url":"https://api.github.com/users/Esri/gists{/gist_id}","starred_url":"https://api.github.com/users/Esri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Esri/subscriptions","organizations_url":"https://api.github.com/users/Esri/orgs","repos_url":"https://api.github.com/users/Esri/repos","events_url":"https://api.github.com/users/Esri/events{/privacy}","received_events_url":"https://api.github.com/users/Esri/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Esri/geodev-hackerlabs","description":"A place to learn how to build geo apps with the ArcGIS.","fork":false,"url":"https://api.github.com/repos/Esri/geodev-hackerlabs","forks_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/forks","keys_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/teams","hooks_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/hooks","issue_events_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues/events{/number}","events_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/events","assignees_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/assignees{/user}","branches_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/branches{/branch}","tags_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/tags","blobs_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/statuses/{sha}","languages_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/languages","stargazers_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/stargazers","contributors_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/contributors","subscribers_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/subscribers","subscription_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/subscription","commits_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/contents/{+path}","compare_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/merges","archive_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/downloads","issues_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues{/number}","pulls_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls{/number}","milestones_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/milestones{/number}","notifications_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/labels{/name}","releases_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/releases{/id}","deployments_url":"https://api.github.com/repos/Esri/geodev-hackerlabs/deployments","created_at":"2015-04-07T23:23:11Z","updated_at":"2016-05-23T14:53:20Z","pushed_at":"2016-05-25T13:08:16Z","git_url":"git://github.com/Esri/geodev-hackerlabs.git","ssh_url":"git@github.com:Esri/geodev-hackerlabs.git","clone_url":"https://github.com/Esri/geodev-hackerlabs.git","svn_url":"https://github.com/Esri/geodev-hackerlabs","homepage":"","size":6737,"stargazers_count":62,"watchers_count":62,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":40,"mirror_url":null,"open_issues_count":14,"forks":40,"open_issues":14,"watchers":62,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126"},"html":{"href":"https://github.com/Esri/geodev-hackerlabs/pull/126"},"issue":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues/126"},"comments":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/issues/126/comments"},"review_comments":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126/comments"},"review_comment":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/pulls/126/commits"},"statuses":{"href":"https://api.github.com/repos/Esri/geodev-hackerlabs/statuses/736d8935f5cf21d27cff723f9aa98c5097cfe192"}}}}
{"actor":{"display_login":"alaframboise"}}