{"action":"created","comment":{"url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/comments/35167054","id":35167054,"diff_hunk":"@@ -0,0 +1,81 @@\n+//= require geoblacklight/viewers/map\n+\n+GeoBlacklight.Viewer.Esri = GeoBlacklight.Viewer.Map.extend({\n+  layerInfo: {},\n+\n+  load: function() {\n+    this.options.bbox = L.bboxToBounds(this.data.mapBbox);\n+    this.map = L.map(this.element).fitBounds(this.options.bbox);\n+    this.map.addLayer(this.selectBasemap());\n+    this.map.addLayer(this.overlay);\n+    if (this.data.available) {\n+      this.getEsriLayer();\n+    } else {\n+      this.addBoundsOverlay(this.options.bbox);\n+    }\n+  },\n+\n+  getEsriLayer: function() {\n+    var _this = this;\n+\n+    // remove any trailing slash from endpoint url\n+    _this.data.url = _this.data.url.replace(/\\/$/, '');\n+\n+    L.esri.get = L.esri.Request.get.JSONP;\n+    L.esri.get(_this.data.url, {}, function(error, response){\n+      if(!error) {\n+        _this.layerInfo = response;\n+\n+        // get layer as defined in submodules (e.g. esri/mapservice)\n+        var layer = _this.getPreviewLayer();\n+\n+        // add layer to map\n+        if (_this.addPreviewLayer(layer)) {\n+\n+          // add control if layer is added\n+          _this.addOpacityControl();\n+        }\n+      }\n+    });\n+  },\n+\n+  addPreviewLayer: function(layer) {\n+\n+    // if not null, add layer to map\n+    if (layer) {\n+\n+      this.overlay.addLayer(layer);\n+      return true;\n+    }\n+  },\n+\n+  addOpacityControl: function() {\n+    this.map.addControl(new L.Control.LayerOpacity(this.overlay));\n+  },\n+  \n+  // clear attribute table and setup spinner icon\n+  appendLoadingMessage: function() {\n+    var spinner = '<tbody class=\"attribute-table-body\"><tr><td colspan=\"2\">' +\n+      '<span id=\"attribute-table\">' +\n+      '<i class=\"fa fa-spinner fa-spin fa-align-center\">' +\n+      '</i></span>' +\n+      '</td></tr></tbody>';\n+  },\n+\n+  // appends error message to attribute table\n+  appendErrorMessage: function() {","path":"app/assets/javascripts/geoblacklight/viewers/esri.js","position":66,"original_position":66,"commit_id":"c6ff949dbf34d45a72a38c38fd4fec7061ec0f0f","original_commit_id":"c6ff949dbf34d45a72a38c38fd4fec7061ec0f0f","user":{"login":"mejackreed","id":1656824,"avatar_url":"https://avatars.githubusercontent.com/u/1656824?v=3","gravatar_id":"","url":"https://api.github.com/users/mejackreed","html_url":"https://github.com/mejackreed","followers_url":"https://api.github.com/users/mejackreed/followers","following_url":"https://api.github.com/users/mejackreed/following{/other_user}","gists_url":"https://api.github.com/users/mejackreed/gists{/gist_id}","starred_url":"https://api.github.com/users/mejackreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mejackreed/subscriptions","organizations_url":"https://api.github.com/users/mejackreed/orgs","repos_url":"https://api.github.com/users/mejackreed/repos","events_url":"https://api.github.com/users/mejackreed/events{/privacy}","received_events_url":"https://api.github.com/users/mejackreed/received_events","type":"User","site_admin":false},"body":"Could we pull `appendLoadingMessage` and `appendErrorMessage` to a top level module? Then we could also use it in `wms.js`? https://github.com/geoblacklight/geoblacklight/blob/master/app/assets/javascripts/geoblacklight/viewers/wms.js#L39-L40 https://github.com/geoblacklight/geoblacklight/blob/master/app/assets/javascripts/geoblacklight/viewers/wms.js#L58","created_at":"2015-07-21T23:33:47Z","updated_at":"2015-07-21T23:33:47Z","html_url":"https://github.com/geoblacklight/geoblacklight/pull/335#discussion_r35167054","pull_request_url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335","_links":{"self":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/comments/35167054"},"html":{"href":"https://github.com/geoblacklight/geoblacklight/pull/335#discussion_r35167054"},"pull_request":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335"}}},"pull_request":{"url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335","id":36797032,"html_url":"https://github.com/geoblacklight/geoblacklight/pull/335","diff_url":"https://github.com/geoblacklight/geoblacklight/pull/335.diff","patch_url":"https://github.com/geoblacklight/geoblacklight/pull/335.patch","issue_url":"https://api.github.com/repos/geoblacklight/geoblacklight/issues/335","number":335,"state":"open","locked":false,"title":"Adds ESRI map service support","user":{"login":"eliotjordan","id":784196,"avatar_url":"https://avatars.githubusercontent.com/u/784196?v=3","gravatar_id":"","url":"https://api.github.com/users/eliotjordan","html_url":"https://github.com/eliotjordan","followers_url":"https://api.github.com/users/eliotjordan/followers","following_url":"https://api.github.com/users/eliotjordan/following{/other_user}","gists_url":"https://api.github.com/users/eliotjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/eliotjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliotjordan/subscriptions","organizations_url":"https://api.github.com/users/eliotjordan/orgs","repos_url":"https://api.github.com/users/eliotjordan/repos","events_url":"https://api.github.com/users/eliotjordan/events{/privacy}","received_events_url":"https://api.github.com/users/eliotjordan/received_events","type":"User","site_admin":false},"body":"This pull request adds support for ArcGIS REST API services.  @cheetah90 from UMN kicked off the effort and did the preliminary work. This is a rough draft and really needs more eyeballs on it from the community. \r\n\r\nMissing Features:\r\n\r\n- [ ] Feature layer inspection\r\n- [ ] Web services link\r\n- [ ] Download link (??)\r\n\r\nAreas for Closer Inspection:\r\n\r\n- [ ] Reference URI (Currently: http://resources.arcgis.com/en/help/arcgis-rest-api)\r\n- [ ] Fixtures","created_at":"2015-06-03T04:09:56Z","updated_at":"2015-07-21T23:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04b787e38439a7cafeebf18d11e46fc743417751","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335/commits","review_comments_url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335/comments","review_comment_url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geoblacklight/geoblacklight/issues/335/comments","statuses_url":"https://api.github.com/repos/geoblacklight/geoblacklight/statuses/c6ff949dbf34d45a72a38c38fd4fec7061ec0f0f","head":{"label":"cheetah90:esri-map-viewer","ref":"esri-map-viewer","sha":"c6ff949dbf34d45a72a38c38fd4fec7061ec0f0f","user":{"login":"cheetah90","id":3032091,"avatar_url":"https://avatars.githubusercontent.com/u/3032091?v=3","gravatar_id":"","url":"https://api.github.com/users/cheetah90","html_url":"https://github.com/cheetah90","followers_url":"https://api.github.com/users/cheetah90/followers","following_url":"https://api.github.com/users/cheetah90/following{/other_user}","gists_url":"https://api.github.com/users/cheetah90/gists{/gist_id}","starred_url":"https://api.github.com/users/cheetah90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheetah90/subscriptions","organizations_url":"https://api.github.com/users/cheetah90/orgs","repos_url":"https://api.github.com/users/cheetah90/repos","events_url":"https://api.github.com/users/cheetah90/events{/privacy}","received_events_url":"https://api.github.com/users/cheetah90/received_events","type":"User","site_admin":false},"repo":{"id":30253961,"name":"geoblacklight","full_name":"cheetah90/geoblacklight","owner":{"login":"cheetah90","id":3032091,"avatar_url":"https://avatars.githubusercontent.com/u/3032091?v=3","gravatar_id":"","url":"https://api.github.com/users/cheetah90","html_url":"https://github.com/cheetah90","followers_url":"https://api.github.com/users/cheetah90/followers","following_url":"https://api.github.com/users/cheetah90/following{/other_user}","gists_url":"https://api.github.com/users/cheetah90/gists{/gist_id}","starred_url":"https://api.github.com/users/cheetah90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheetah90/subscriptions","organizations_url":"https://api.github.com/users/cheetah90/orgs","repos_url":"https://api.github.com/users/cheetah90/repos","events_url":"https://api.github.com/users/cheetah90/events{/privacy}","received_events_url":"https://api.github.com/users/cheetah90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cheetah90/geoblacklight","description":"Discovery platform for GIS data.","fork":true,"url":"https://api.github.com/repos/cheetah90/geoblacklight","forks_url":"https://api.github.com/repos/cheetah90/geoblacklight/forks","keys_url":"https://api.github.com/repos/cheetah90/geoblacklight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cheetah90/geoblacklight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cheetah90/geoblacklight/teams","hooks_url":"https://api.github.com/repos/cheetah90/geoblacklight/hooks","issue_events_url":"https://api.github.com/repos/cheetah90/geoblacklight/issues/events{/number}","events_url":"https://api.github.com/repos/cheetah90/geoblacklight/events","assignees_url":"https://api.github.com/repos/cheetah90/geoblacklight/assignees{/user}","branches_url":"https://api.github.com/repos/cheetah90/geoblacklight/branches{/branch}","tags_url":"https://api.github.com/repos/cheetah90/geoblacklight/tags","blobs_url":"https://api.github.com/repos/cheetah90/geoblacklight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cheetah90/geoblacklight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cheetah90/geoblacklight/git/refs{/sha}","trees_url":"https://api.github.com/repos/cheetah90/geoblacklight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cheetah90/geoblacklight/statuses/{sha}","languages_url":"https://api.github.com/repos/cheetah90/geoblacklight/languages","stargazers_url":"https://api.github.com/repos/cheetah90/geoblacklight/stargazers","contributors_url":"https://api.github.com/repos/cheetah90/geoblacklight/contributors","subscribers_url":"https://api.github.com/repos/cheetah90/geoblacklight/subscribers","subscription_url":"https://api.github.com/repos/cheetah90/geoblacklight/subscription","commits_url":"https://api.github.com/repos/cheetah90/geoblacklight/commits{/sha}","git_commits_url":"https://api.github.com/repos/cheetah90/geoblacklight/git/commits{/sha}","comments_url":"https://api.github.com/repos/cheetah90/geoblacklight/comments{/number}","issue_comment_url":"https://api.github.com/repos/cheetah90/geoblacklight/issues/comments{/number}","contents_url":"https://api.github.com/repos/cheetah90/geoblacklight/contents/{+path}","compare_url":"https://api.github.com/repos/cheetah90/geoblacklight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cheetah90/geoblacklight/merges","archive_url":"https://api.github.com/repos/cheetah90/geoblacklight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cheetah90/geoblacklight/downloads","issues_url":"https://api.github.com/repos/cheetah90/geoblacklight/issues{/number}","pulls_url":"https://api.github.com/repos/cheetah90/geoblacklight/pulls{/number}","milestones_url":"https://api.github.com/repos/cheetah90/geoblacklight/milestones{/number}","notifications_url":"https://api.github.com/repos/cheetah90/geoblacklight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cheetah90/geoblacklight/labels{/name}","releases_url":"https://api.github.com/repos/cheetah90/geoblacklight/releases{/id}","created_at":"2015-02-03T17:01:22Z","updated_at":"2015-05-02T19:14:07Z","pushed_at":"2015-07-21T20:09:08Z","git_url":"git://github.com/cheetah90/geoblacklight.git","ssh_url":"git@github.com:cheetah90/geoblacklight.git","clone_url":"https://github.com/cheetah90/geoblacklight.git","svn_url":"https://github.com/cheetah90/geoblacklight","homepage":"http://geoblacklight.org","size":995,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"geoblacklight:master","ref":"master","sha":"9cd70e4b32fce03d6a6a0df578c6c1bd059a4e6b","user":{"login":"geoblacklight","id":8245408,"avatar_url":"https://avatars.githubusercontent.com/u/8245408?v=3","gravatar_id":"","url":"https://api.github.com/users/geoblacklight","html_url":"https://github.com/geoblacklight","followers_url":"https://api.github.com/users/geoblacklight/followers","following_url":"https://api.github.com/users/geoblacklight/following{/other_user}","gists_url":"https://api.github.com/users/geoblacklight/gists{/gist_id}","starred_url":"https://api.github.com/users/geoblacklight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoblacklight/subscriptions","organizations_url":"https://api.github.com/users/geoblacklight/orgs","repos_url":"https://api.github.com/users/geoblacklight/repos","events_url":"https://api.github.com/users/geoblacklight/events{/privacy}","received_events_url":"https://api.github.com/users/geoblacklight/received_events","type":"Organization","site_admin":false},"repo":{"id":21216322,"name":"geoblacklight","full_name":"geoblacklight/geoblacklight","owner":{"login":"geoblacklight","id":8245408,"avatar_url":"https://avatars.githubusercontent.com/u/8245408?v=3","gravatar_id":"","url":"https://api.github.com/users/geoblacklight","html_url":"https://github.com/geoblacklight","followers_url":"https://api.github.com/users/geoblacklight/followers","following_url":"https://api.github.com/users/geoblacklight/following{/other_user}","gists_url":"https://api.github.com/users/geoblacklight/gists{/gist_id}","starred_url":"https://api.github.com/users/geoblacklight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoblacklight/subscriptions","organizations_url":"https://api.github.com/users/geoblacklight/orgs","repos_url":"https://api.github.com/users/geoblacklight/repos","events_url":"https://api.github.com/users/geoblacklight/events{/privacy}","received_events_url":"https://api.github.com/users/geoblacklight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoblacklight/geoblacklight","description":"Discovery platform for GIS data.","fork":false,"url":"https://api.github.com/repos/geoblacklight/geoblacklight","forks_url":"https://api.github.com/repos/geoblacklight/geoblacklight/forks","keys_url":"https://api.github.com/repos/geoblacklight/geoblacklight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoblacklight/geoblacklight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoblacklight/geoblacklight/teams","hooks_url":"https://api.github.com/repos/geoblacklight/geoblacklight/hooks","issue_events_url":"https://api.github.com/repos/geoblacklight/geoblacklight/issues/events{/number}","events_url":"https://api.github.com/repos/geoblacklight/geoblacklight/events","assignees_url":"https://api.github.com/repos/geoblacklight/geoblacklight/assignees{/user}","branches_url":"https://api.github.com/repos/geoblacklight/geoblacklight/branches{/branch}","tags_url":"https://api.github.com/repos/geoblacklight/geoblacklight/tags","blobs_url":"https://api.github.com/repos/geoblacklight/geoblacklight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoblacklight/geoblacklight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoblacklight/geoblacklight/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoblacklight/geoblacklight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoblacklight/geoblacklight/statuses/{sha}","languages_url":"https://api.github.com/repos/geoblacklight/geoblacklight/languages","stargazers_url":"https://api.github.com/repos/geoblacklight/geoblacklight/stargazers","contributors_url":"https://api.github.com/repos/geoblacklight/geoblacklight/contributors","subscribers_url":"https://api.github.com/repos/geoblacklight/geoblacklight/subscribers","subscription_url":"https://api.github.com/repos/geoblacklight/geoblacklight/subscription","commits_url":"https://api.github.com/repos/geoblacklight/geoblacklight/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoblacklight/geoblacklight/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoblacklight/geoblacklight/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoblacklight/geoblacklight/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoblacklight/geoblacklight/contents/{+path}","compare_url":"https://api.github.com/repos/geoblacklight/geoblacklight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoblacklight/geoblacklight/merges","archive_url":"https://api.github.com/repos/geoblacklight/geoblacklight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoblacklight/geoblacklight/downloads","issues_url":"https://api.github.com/repos/geoblacklight/geoblacklight/issues{/number}","pulls_url":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls{/number}","milestones_url":"https://api.github.com/repos/geoblacklight/geoblacklight/milestones{/number}","notifications_url":"https://api.github.com/repos/geoblacklight/geoblacklight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoblacklight/geoblacklight/labels{/name}","releases_url":"https://api.github.com/repos/geoblacklight/geoblacklight/releases{/id}","created_at":"2014-06-25T19:46:57Z","updated_at":"2015-06-03T23:56:10Z","pushed_at":"2015-07-21T20:09:08Z","git_url":"git://github.com/geoblacklight/geoblacklight.git","ssh_url":"git@github.com:geoblacklight/geoblacklight.git","clone_url":"https://github.com/geoblacklight/geoblacklight.git","svn_url":"https://github.com/geoblacklight/geoblacklight","homepage":"http://geoblacklight.org","size":2716,"stargazers_count":28,"watchers_count":28,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":42,"forks":2,"open_issues":42,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335"},"html":{"href":"https://github.com/geoblacklight/geoblacklight/pull/335"},"issue":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/issues/335"},"comments":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/issues/335/comments"},"review_comments":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335/comments"},"review_comment":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/pulls/335/commits"},"statuses":{"href":"https://api.github.com/repos/geoblacklight/geoblacklight/statuses/c6ff949dbf34d45a72a38c38fd4fec7061ec0f0f"}}}}