{"action":"created","comment":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/138080953","pull_request_review_id":61828517,"id":138080953,"diff_hunk":"@@ -0,0 +1,64 @@\n+\n+goog.provide('ga_featureload_service');\n+\n+goog.require('ga_map_service');\n+goog.require('ga_styles_service');\n+\n+(function() {\n+  var module = angular.module('ga_featureload_service', [\n+    'ga_map_service',\n+    'ga_styles_service'\n+  ]);\n+\n+  /*\n+   *This service checks if features are loaded.\n+   */\n+\n+  module.provider('gaFeatureLoadManager', function() {\n+    this.$get = function($rootScope, $q, $http, gaDefinePropertiesForLayer,\n+        gaStyleFactory, gaLayerFilters, gaMapUtils, gaLayers) {\n+\n+      var promises = {};\n+      var scope = $rootScope.$new();\n+\n+      var FeatureLoadManager = function() {\n+        var map;\n+\n+        // watches layers for changes, returns loaded features in promises.\n+        var createWatcher = function(bodId) {\n+          scope.layers = map.getLayers().getArray();\n+          scope.layerFilter = gaLayerFilters.geojson;\n+          scope.$watchCollection('layers | filter:layerFilter',\n+              function(layers) {\n+                var layerFeatures;\n+                angular.forEach(layers, function(flayer) {\n+                  flayer.getSource().on('addfeature', function(event) {","path":"src/components/map/FeatureLoadService.js","position":35,"original_position":35,"commit_id":"381c1db6046356d44d65fea180a80bb9186af402","original_commit_id":"381c1db6046356d44d65fea180a80bb9186af402","user":{"login":"oterral","id":621420,"avatar_url":"https://avatars0.githubusercontent.com/u/621420?v=4","gravatar_id":"","url":"https://api.github.com/users/oterral","html_url":"https://github.com/oterral","followers_url":"https://api.github.com/users/oterral/followers","following_url":"https://api.github.com/users/oterral/following{/other_user}","gists_url":"https://api.github.com/users/oterral/gists{/gist_id}","starred_url":"https://api.github.com/users/oterral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oterral/subscriptions","organizations_url":"https://api.github.com/users/oterral/orgs","repos_url":"https://api.github.com/users/oterral/repos","events_url":"https://api.github.com/users/oterral/events{/privacy}","received_events_url":"https://api.github.com/users/oterral/received_events","type":"User","site_admin":false},"body":"The `addFeature` event is sent for each  feature added, but you only want to execute code once, when the GeoJSON is loaded, that's why the use of promises created in the `gaLayers` service makes more sense.","created_at":"2017-09-11T14:07:47Z","updated_at":"2017-09-11T14:14:36Z","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3944#discussion_r138080953","pull_request_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/138080953"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/3944#discussion_r138080953"},"pull_request":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944"}}},"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944","id":139585823,"html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3944","diff_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3944.diff","patch_url":"https://github.com/geoadmin/mf-geoadmin3/pull/3944.patch","issue_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3944","number":3944,"state":"open","locked":false,"title":"[WIP] Link to object for geojson","user":{"login":"nadine-piveteau","id":9396451,"avatar_url":"https://avatars1.githubusercontent.com/u/9396451?v=4","gravatar_id":"","url":"https://api.github.com/users/nadine-piveteau","html_url":"https://github.com/nadine-piveteau","followers_url":"https://api.github.com/users/nadine-piveteau/followers","following_url":"https://api.github.com/users/nadine-piveteau/following{/other_user}","gists_url":"https://api.github.com/users/nadine-piveteau/gists{/gist_id}","starred_url":"https://api.github.com/users/nadine-piveteau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadine-piveteau/subscriptions","organizations_url":"https://api.github.com/users/nadine-piveteau/orgs","repos_url":"https://api.github.com/users/nadine-piveteau/repos","events_url":"https://api.github.com/users/nadine-piveteau/events{/privacy}","received_events_url":"https://api.github.com/users/nadine-piveteau/received_events","type":"User","site_admin":false},"body":"Implementation of the permanentlink to an object in geojson layer. \r\n[URL Example for link to Object](https://mf-geoadmin3.dev.bgdi.ch/ltpin/src/?ch.bafu.hydroweb-messstationen_gefahren=2004&showTooltip=true)\r\n\r\nOpening this URL invokes:\r\n- zoom to object\r\n- object is highlighted \r\n- tooltip appears\r\n\r\nReferring to [Issue #2571 ](https://github.com/geoadmin/mf-chsdi3/issues/2571)","created_at":"2017-09-06T14:58:37Z","updated_at":"2017-09-11T14:14:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb3dec68e0d51988d857209acb36c8f87611adeb","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gjn","id":2572317,"avatar_url":"https://avatars2.githubusercontent.com/u/2572317?v=4","gravatar_id":"","url":"https://api.github.com/users/gjn","html_url":"https://github.com/gjn","followers_url":"https://api.github.com/users/gjn/followers","following_url":"https://api.github.com/users/gjn/following{/other_user}","gists_url":"https://api.github.com/users/gjn/gists{/gist_id}","starred_url":"https://api.github.com/users/gjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gjn/subscriptions","organizations_url":"https://api.github.com/users/gjn/orgs","repos_url":"https://api.github.com/users/gjn/repos","events_url":"https://api.github.com/users/gjn/events{/privacy}","received_events_url":"https://api.github.com/users/gjn/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944/commits","review_comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944/comments","review_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3944/comments","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/381c1db6046356d44d65fea180a80bb9186af402","head":{"label":"geoadmin:pin_plfeaturselection","ref":"pin_plfeaturselection","sha":"381c1db6046356d44d65fea180a80bb9186af402","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars2.githubusercontent.com/u/3369793?v=4","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":10399273,"name":"mf-geoadmin3","full_name":"geoadmin/mf-geoadmin3","owner":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars2.githubusercontent.com/u/3369793?v=4","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoadmin/mf-geoadmin3","description":"map.geo.admin.ch source code","fork":false,"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","forks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/forks","keys_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/teams","hooks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/hooks","issue_events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/events{/number}","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/events","assignees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/assignees{/user}","branches_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/branches{/branch}","tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/tags","blobs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/{sha}","languages_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/languages","stargazers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/stargazers","contributors_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contributors","subscribers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscribers","subscription_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscription","commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contents/{+path}","compare_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/merges","archive_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/downloads","issues_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues{/number}","pulls_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls{/number}","milestones_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/milestones{/number}","notifications_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/labels{/name}","releases_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/releases{/id}","deployments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/deployments","created_at":"2013-05-31T06:37:20Z","updated_at":"2017-08-01T16:48:52Z","pushed_at":"2017-09-08T14:29:49Z","git_url":"git://github.com/geoadmin/mf-geoadmin3.git","ssh_url":"git@github.com:geoadmin/mf-geoadmin3.git","clone_url":"https://github.com/geoadmin/mf-geoadmin3.git","svn_url":"https://github.com/geoadmin/mf-geoadmin3","homepage":"http://map.geo.admin.ch","size":253360,"stargazers_count":120,"watchers_count":120,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":94,"forks":53,"open_issues":94,"watchers":120,"default_branch":"master"}},"base":{"label":"geoadmin:master","ref":"master","sha":"73cfbb0a098471af8eddaf59ec108d12dda3be8e","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars2.githubusercontent.com/u/3369793?v=4","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":10399273,"name":"mf-geoadmin3","full_name":"geoadmin/mf-geoadmin3","owner":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars2.githubusercontent.com/u/3369793?v=4","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoadmin/mf-geoadmin3","description":"map.geo.admin.ch source code","fork":false,"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","forks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/forks","keys_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/teams","hooks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/hooks","issue_events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/events{/number}","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/events","assignees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/assignees{/user}","branches_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/branches{/branch}","tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/tags","blobs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/{sha}","languages_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/languages","stargazers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/stargazers","contributors_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contributors","subscribers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscribers","subscription_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscription","commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contents/{+path}","compare_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/merges","archive_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/downloads","issues_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues{/number}","pulls_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls{/number}","milestones_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/milestones{/number}","notifications_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/labels{/name}","releases_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/releases{/id}","deployments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/deployments","created_at":"2013-05-31T06:37:20Z","updated_at":"2017-08-01T16:48:52Z","pushed_at":"2017-09-08T14:29:49Z","git_url":"git://github.com/geoadmin/mf-geoadmin3.git","ssh_url":"git@github.com:geoadmin/mf-geoadmin3.git","clone_url":"https://github.com/geoadmin/mf-geoadmin3.git","svn_url":"https://github.com/geoadmin/mf-geoadmin3","homepage":"http://map.geo.admin.ch","size":253360,"stargazers_count":120,"watchers_count":120,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":94,"forks":53,"open_issues":94,"watchers":120,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/3944"},"issue":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3944"},"comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/3944/comments"},"review_comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944/comments"},"review_comment":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/3944/commits"},"statuses":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/381c1db6046356d44d65fea180a80bb9186af402"}},"author_association":"NONE"}}
{"actor":{"display_login":"oterral"}}