{"action":"created","comment":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/25338912","id":25338912,"diff_hunk":"@@ -405,19 +405,114 @@\n       }\n     };\n \n-    this.$get = function($http, gaDefinePropertiesForLayer, gaMapClick,\n-        gaMapUtils, gaGlobalOptions, $rootScope, $translate, gaStyleFactory,\n-        gaStorage, gaNetworkStatus) {\n+    this.$get = function($http, $q, $rootScope, $timeout, $translate,\n+        gaDefinePropertiesForLayer, gaGlobalOptions, gaMapClick, gaMapUtils,\n+        gaNetworkStatus, gaStorage, gaStyleFactory, gaUrlUtils) {\n+\n       // Create the parser\n       var kmlFormat = new ol.format.KML({\n         extractStyles: true,\n         extractAttributes: true,\n         defaultStyle: [gaStyleFactory.getStyle('kml')]\n       });\n-      var Kml = function(proxyUrl) {\n-        /**\n-         * Create a KML layer from a KML string\n-         */\n+\n+      // Read a kml string then return a list of features.\n+      var readFeatures = function(kml) {\n+        // Replace all hrefs to prevent errors if image doesn't have\n+        // CORS headers. Exception for google markers icons (lightblue.png,\n+        // ltblue-dot.png, ltblu-pushpin.png, ...) to keep the OL3 magic for\n+        // anchor origin.\n+        // Test regex here: http://regex101.com/r/tF3vM0\n+        // List of google icons: http://www.lass.it/Web/viewer.aspx?id=4","path":"src/components/map/MapService.js","position":29,"original_position":29,"commit_id":"91b30754a7c88fa9f67882e7b3c76759e5739c53","original_commit_id":"91b30754a7c88fa9f67882e7b3c76759e5739c53","user":{"login":"gjn","id":2572317,"avatar_url":"https://avatars.githubusercontent.com/u/2572317?v=3","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},"body":"How stable is this list? Would be hard to maintain it if it changes on a regular basis.\r\n\r\nOr: why not keep all google png's in there as google is likely to support CORS anyway?","created_at":"2015-02-25T13:26:08Z","updated_at":"2015-02-25T13:26:08Z","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2161#discussion_r25338912","pull_request_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161","_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/25338912"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/2161#discussion_r25338912"},"pull_request":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161"}}},"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161","id":29454994,"html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2161","diff_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2161.diff","patch_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2161.patch","issue_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2161","number":2161,"state":"open","locked":false,"title":"Manage  NetworkLink tags in KML file","user":{"login":"oterral","id":621420,"avatar_url":"https://avatars.githubusercontent.com/u/621420?v=3","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":"Fix  #1918 \r\n\r\nThis PR  uses promises in gaKml in order to get features from NetworkLink tags\r\n\r\n[Test](http://mf-geoadmin3.dev.bgdi.ch/teo_net_links/index.html?X=166266.05&Y=633389.01&zoom=2&lang=de&topic=ech&bgLayer=ch.swisstopo.pixelkarte-farbe&layers=KML%7C%7Chttps:%2F%2Fdoc-10-38-docs.googleusercontent.com%2Fdocs%2Fsecuresc%2Flpbfmkon86t1kr9s1hfh5ofs0s235fnq%2Fk4o1pfjltrtf2kbk3jhbapoosgk6drlr%2F1424188800000%2F10258287539236638996%2F10258287539236638996%2F0B4uRuJ1hajZmdld1bzdkVDEzMkszZHFjdHhtSzNDTGdpSkM4%3Fe%3Ddownload%26gd%3Dtrue%26access_token%3Dya29.HQFvAplD39zTDfSlDWbyYNiAXwNCGxrjCy7_Gxd_q2aTeBD8_8cPC4f4Ms6dw5Wc0iTmNQ7zA0ZnWg)\r\n\r\nThis test link includes a KML  file including 3 others KML files via NetworLink tags","created_at":"2015-02-17T16:20:06Z","updated_at":"2015-02-25T13:26:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f754f25265e556fc87de48caa50eda0df3dff9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161/commits","review_comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161/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/2161/comments","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/91b30754a7c88fa9f67882e7b3c76759e5739c53","head":{"label":"geoadmin:teo_net_links","ref":"teo_net_links","sha":"91b30754a7c88fa9f67882e7b3c76759e5739c53","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","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://avatars.githubusercontent.com/u/3369793?v=3","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}","created_at":"2013-05-31T06:37:20Z","updated_at":"2015-02-25T13:20:23Z","pushed_at":"2015-02-25T13:20:23Z","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":35878,"stargazers_count":63,"watchers_count":63,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":82,"forks":26,"open_issues":82,"watchers":63,"default_branch":"master"}},"base":{"label":"geoadmin:master","ref":"master","sha":"2415b4d93e63ec6e5497311e63464ddd3ab29750","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","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://avatars.githubusercontent.com/u/3369793?v=3","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}","created_at":"2013-05-31T06:37:20Z","updated_at":"2015-02-25T13:20:23Z","pushed_at":"2015-02-25T13:20:23Z","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":35878,"stargazers_count":63,"watchers_count":63,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":82,"forks":26,"open_issues":82,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/2161"},"issue":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2161"},"comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2161/comments"},"review_comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2161/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/2161/commits"},"statuses":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/91b30754a7c88fa9f67882e7b3c76759e5739c53"}}}}