{"action":"created","comment":{"url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/comments/183984358","pull_request_review_id":115082655,"id":183984358,"diff_hunk":"@@ -0,0 +1,136 @@\n+import { HttpClient } from \"@angular/common/http\";\n+import { Component, Input, OnInit, ViewEncapsulation } from \"@angular/core\";\n+import { fromNullable } from \"fp-ts/lib/Option\";\n+import { List } from \"immutable\";\n+\n+import { KaartClassicComponent } from \"./kaart-classic.component\";\n+import { WmtsCapaConfig, WmtsLaag, WmtsManualConfig, WmtsType } from \"./kaart-elementen\";\n+import { KaartLaagComponent } from \"./kaart-laag.component\";\n+import { Laaggroep } from \"./kaart-protocol-commands\";\n+import * as ol from \"openlayers\";\n+\n+@Component({\n+  selector: \"awv-kaart-wmts-laag\",\n+  template: \"<ng-content></ng-content>\",\n+  encapsulation: ViewEncapsulation.None\n+})\n+export class KaartWmtsLaagComponent extends KaartLaagComponent implements OnInit {\n+  @Input() laagNaam: string;\n+  @Input() tiled = true;\n+  @Input() type: string;\n+  @Input() groep: Laaggroep = \"Achtergrond\";\n+  @Input() matrixSet: string;\n+\n+  @Input() capurl?: string;\n+\n+  @Input() urls: string[] = [];\n+  @Input() versie?: string;\n+  @Input() format = \"image/png\";\n+  @Input() opacity?: number;\n+  @Input() matrixIds: string[];\n+  @Input() style?: string;\n+  @Input() origin?: [number, number];\n+  @Input() extent?: [number, number, number, number];\n+  @Input() projection = \"EPSG:31370\";\n+\n+  private wmtsOptions: ol.olx.source.WMTSOptions;\n+\n+  constructor(kaart: KaartClassicComponent, private http: HttpClient) {\n+    super(kaart);\n+  }\n+\n+  ngOnInit() {\n+    if ([\"Voorgrond\", \"Achtergrond\"].indexOf(this.groep) < 0) {\n+      throw new Error(\"groep moet 'Voorgrond' of 'Achtergrond' zijn\");\n+    }\n+    if (!this.matrixSet) {\n+      throw new Error(\"matrixSet moet opgegeven zijn\");\n+    }\n+    if (!(this.capurl || (this.urls && this.urls.length > 0 && this.matrixIds && this.matrixIds.length > 0))) {\n+      throw new Error(\"capurl of urls en matrixIds moet opgegeven zijn\");\n+    }\n+\n+    if (this.capurl) {\n+      // We moeten eerst de capabilities ophalen. We zullen zelf manueel de this.voegLaagToe() oproepen.\n+      this.voegLaagToeBijStart = false;\n+      this.vraagCapabilitiesOp();\n+    }\n+\n+    super.ngOnInit();\n+  }\n+\n+  createLayer(): WmtsLaag {\n+    let config: WmtsCapaConfig | WmtsManualConfig;\n+    if (this.capurl) {\n+      config = {\n+        type: \"Capa\",\n+        url: this.capurl,\n+        wmtsOptions: this.wmtsOptions\n+      };\n+    } else {\n+      config = {\n+        type: \"Manual\",\n+        urls: List(this.urls),\n+        matrixIds: this.matrixIds,\n+        style: fromNullable(this.style),\n+        origin: fromNullable(this.origin),\n+        extent: fromNullable(this.extent)\n+      };\n+    }\n+\n+    return {\n+      type: WmtsType,\n+      titel: this.titel,\n+      naam: this.laagNaam,\n+      versie: fromNullable(this.versie),\n+      format: fromNullable(this.format),\n+      opacity: fromNullable(this.opacity),\n+      matrixSet: this.matrixSet,\n+      config: config,\n+      backgroundUrl: this.backgroundUrl(config)\n+    };\n+  }\n+\n+  laaggroep(): Laaggroep {\n+    return this.groep;\n+  }\n+\n+  backgroundUrl(config: WmtsCapaConfig | WmtsManualConfig): string {\n+    if (config.type === \"Manual\") {\n+      return (\n+        this.urls[0] +\n+        \"?layer=\" +\n+        encodeURIComponent(this.laagNaam) +\n+        \"&style=\" +\n+        encodeURIComponent(config.style.getOrElseValue(\"\")) +\n+        \"&tilematrixset=\" +\n+        encodeURIComponent(this.matrixSet) +\n+        \"&Service=WMTS&Request=GetTile&Version=1.0.0&WIDTH=256&HEIGHT=256\" +\n+        \"&Format=\" +\n+        encodeURIComponent(this.format) +\n+        \"&TileMatrix=9&TileCol=185&TileRow=273\"\n+      );\n+    } else {\n+      // TODO: bepalen op basis van de echte parameters. Rekening houden met config.\n+      return \"\";\n+    }\n+  }\n+\n+  private vraagCapabilitiesOp(): any {","path":"src/lib/kaart/kaart-wmts-laag.component.ts","position":119,"original_position":119,"commit_id":"63f4189a02dd0e944a2ef9135b88dadf635dc099","original_commit_id":"63f4189a02dd0e944a2ef9135b88dadf635dc099","user":{"login":"bepremeg","id":8665823,"avatar_url":"https://avatars3.githubusercontent.com/u/8665823?v=4","gravatar_id":"","url":"https://api.github.com/users/bepremeg","html_url":"https://github.com/bepremeg","followers_url":"https://api.github.com/users/bepremeg/followers","following_url":"https://api.github.com/users/bepremeg/following{/other_user}","gists_url":"https://api.github.com/users/bepremeg/gists{/gist_id}","starred_url":"https://api.github.com/users/bepremeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bepremeg/subscriptions","organizations_url":"https://api.github.com/users/bepremeg/orgs","repos_url":"https://api.github.com/users/bepremeg/repos","events_url":"https://api.github.com/users/bepremeg/events{/privacy}","received_events_url":"https://api.github.com/users/bepremeg/received_events","type":"User","site_admin":false},"body":"any -> void","created_at":"2018-04-25T08:52:27Z","updated_at":"2018-04-25T08:59:05Z","html_url":"https://github.com/WegenenVerkeer/ng-kaart/pull/42#discussion_r183984358","pull_request_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/comments/183984358"},"html":{"href":"https://github.com/WegenenVerkeer/ng-kaart/pull/42#discussion_r183984358"},"pull_request":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42","id":183952376,"html_url":"https://github.com/WegenenVerkeer/ng-kaart/pull/42","diff_url":"https://github.com/WegenenVerkeer/ng-kaart/pull/42.diff","patch_url":"https://github.com/WegenenVerkeer/ng-kaart/pull/42.patch","issue_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/42","number":42,"state":"open","locked":false,"title":"Feature/agl 2811 wmts van grb","user":{"login":"bauwelp-awv","id":36190054,"avatar_url":"https://avatars1.githubusercontent.com/u/36190054?v=4","gravatar_id":"","url":"https://api.github.com/users/bauwelp-awv","html_url":"https://github.com/bauwelp-awv","followers_url":"https://api.github.com/users/bauwelp-awv/followers","following_url":"https://api.github.com/users/bauwelp-awv/following{/other_user}","gists_url":"https://api.github.com/users/bauwelp-awv/gists{/gist_id}","starred_url":"https://api.github.com/users/bauwelp-awv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bauwelp-awv/subscriptions","organizations_url":"https://api.github.com/users/bauwelp-awv/orgs","repos_url":"https://api.github.com/users/bauwelp-awv/repos","events_url":"https://api.github.com/users/bauwelp-awv/events{/privacy}","received_events_url":"https://api.github.com/users/bauwelp-awv/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-25T08:00:15Z","updated_at":"2018-04-25T08:59:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50a0ddebf693e20a7cb89766ab89820d97ffb92a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42/commits","review_comments_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42/comments","review_comment_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/42/comments","statuses_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/statuses/63f4189a02dd0e944a2ef9135b88dadf635dc099","head":{"label":"WegenenVerkeer:feature/AGL-2811-WMTS-van-GRB","ref":"feature/AGL-2811-WMTS-van-GRB","sha":"63f4189a02dd0e944a2ef9135b88dadf635dc099","user":{"login":"WegenenVerkeer","id":5690205,"avatar_url":"https://avatars0.githubusercontent.com/u/5690205?v=4","gravatar_id":"","url":"https://api.github.com/users/WegenenVerkeer","html_url":"https://github.com/WegenenVerkeer","followers_url":"https://api.github.com/users/WegenenVerkeer/followers","following_url":"https://api.github.com/users/WegenenVerkeer/following{/other_user}","gists_url":"https://api.github.com/users/WegenenVerkeer/gists{/gist_id}","starred_url":"https://api.github.com/users/WegenenVerkeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WegenenVerkeer/subscriptions","organizations_url":"https://api.github.com/users/WegenenVerkeer/orgs","repos_url":"https://api.github.com/users/WegenenVerkeer/repos","events_url":"https://api.github.com/users/WegenenVerkeer/events{/privacy}","received_events_url":"https://api.github.com/users/WegenenVerkeer/received_events","type":"Organization","site_admin":false},"repo":{"id":111726299,"name":"ng-kaart","full_name":"WegenenVerkeer/ng-kaart","owner":{"login":"WegenenVerkeer","id":5690205,"avatar_url":"https://avatars0.githubusercontent.com/u/5690205?v=4","gravatar_id":"","url":"https://api.github.com/users/WegenenVerkeer","html_url":"https://github.com/WegenenVerkeer","followers_url":"https://api.github.com/users/WegenenVerkeer/followers","following_url":"https://api.github.com/users/WegenenVerkeer/following{/other_user}","gists_url":"https://api.github.com/users/WegenenVerkeer/gists{/gist_id}","starred_url":"https://api.github.com/users/WegenenVerkeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WegenenVerkeer/subscriptions","organizations_url":"https://api.github.com/users/WegenenVerkeer/orgs","repos_url":"https://api.github.com/users/WegenenVerkeer/repos","events_url":"https://api.github.com/users/WegenenVerkeer/events{/privacy}","received_events_url":"https://api.github.com/users/WegenenVerkeer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WegenenVerkeer/ng-kaart","description":"Agentschap Wegen & Verkeer Angular kaartkomponent","fork":false,"url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart","forks_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/forks","keys_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/teams","hooks_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/hooks","issue_events_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/events{/number}","events_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/events","assignees_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/assignees{/user}","branches_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/branches{/branch}","tags_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/tags","blobs_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/refs{/sha}","trees_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/statuses/{sha}","languages_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/languages","stargazers_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/stargazers","contributors_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/contributors","subscribers_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/subscribers","subscription_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/subscription","commits_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/commits{/sha}","git_commits_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/commits{/sha}","comments_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/comments{/number}","issue_comment_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/comments{/number}","contents_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/contents/{+path}","compare_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/merges","archive_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/downloads","issues_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues{/number}","pulls_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls{/number}","milestones_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/milestones{/number}","notifications_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/labels{/name}","releases_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/releases{/id}","deployments_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/deployments","created_at":"2017-11-22T19:51:45Z","updated_at":"2018-04-25T08:14:45Z","pushed_at":"2018-04-25T08:50:27Z","git_url":"git://github.com/WegenenVerkeer/ng-kaart.git","ssh_url":"git@github.com:WegenenVerkeer/ng-kaart.git","clone_url":"https://github.com/WegenenVerkeer/ng-kaart.git","svn_url":"https://github.com/WegenenVerkeer/ng-kaart","homepage":null,"size":1130,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":2,"default_branch":"develop"}},"base":{"label":"WegenenVerkeer:develop","ref":"develop","sha":"d4f7476e1480d4fc6ba897a5fa6a5fb874c314ba","user":{"login":"WegenenVerkeer","id":5690205,"avatar_url":"https://avatars0.githubusercontent.com/u/5690205?v=4","gravatar_id":"","url":"https://api.github.com/users/WegenenVerkeer","html_url":"https://github.com/WegenenVerkeer","followers_url":"https://api.github.com/users/WegenenVerkeer/followers","following_url":"https://api.github.com/users/WegenenVerkeer/following{/other_user}","gists_url":"https://api.github.com/users/WegenenVerkeer/gists{/gist_id}","starred_url":"https://api.github.com/users/WegenenVerkeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WegenenVerkeer/subscriptions","organizations_url":"https://api.github.com/users/WegenenVerkeer/orgs","repos_url":"https://api.github.com/users/WegenenVerkeer/repos","events_url":"https://api.github.com/users/WegenenVerkeer/events{/privacy}","received_events_url":"https://api.github.com/users/WegenenVerkeer/received_events","type":"Organization","site_admin":false},"repo":{"id":111726299,"name":"ng-kaart","full_name":"WegenenVerkeer/ng-kaart","owner":{"login":"WegenenVerkeer","id":5690205,"avatar_url":"https://avatars0.githubusercontent.com/u/5690205?v=4","gravatar_id":"","url":"https://api.github.com/users/WegenenVerkeer","html_url":"https://github.com/WegenenVerkeer","followers_url":"https://api.github.com/users/WegenenVerkeer/followers","following_url":"https://api.github.com/users/WegenenVerkeer/following{/other_user}","gists_url":"https://api.github.com/users/WegenenVerkeer/gists{/gist_id}","starred_url":"https://api.github.com/users/WegenenVerkeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WegenenVerkeer/subscriptions","organizations_url":"https://api.github.com/users/WegenenVerkeer/orgs","repos_url":"https://api.github.com/users/WegenenVerkeer/repos","events_url":"https://api.github.com/users/WegenenVerkeer/events{/privacy}","received_events_url":"https://api.github.com/users/WegenenVerkeer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WegenenVerkeer/ng-kaart","description":"Agentschap Wegen & Verkeer Angular kaartkomponent","fork":false,"url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart","forks_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/forks","keys_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/teams","hooks_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/hooks","issue_events_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/events{/number}","events_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/events","assignees_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/assignees{/user}","branches_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/branches{/branch}","tags_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/tags","blobs_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/refs{/sha}","trees_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/statuses/{sha}","languages_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/languages","stargazers_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/stargazers","contributors_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/contributors","subscribers_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/subscribers","subscription_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/subscription","commits_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/commits{/sha}","git_commits_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/git/commits{/sha}","comments_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/comments{/number}","issue_comment_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/comments{/number}","contents_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/contents/{+path}","compare_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/merges","archive_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/downloads","issues_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues{/number}","pulls_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls{/number}","milestones_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/milestones{/number}","notifications_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/labels{/name}","releases_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/releases{/id}","deployments_url":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/deployments","created_at":"2017-11-22T19:51:45Z","updated_at":"2018-04-25T08:14:45Z","pushed_at":"2018-04-25T08:50:27Z","git_url":"git://github.com/WegenenVerkeer/ng-kaart.git","ssh_url":"git@github.com:WegenenVerkeer/ng-kaart.git","clone_url":"https://github.com/WegenenVerkeer/ng-kaart.git","svn_url":"https://github.com/WegenenVerkeer/ng-kaart","homepage":null,"size":1130,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":2,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42"},"html":{"href":"https://github.com/WegenenVerkeer/ng-kaart/pull/42"},"issue":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/42"},"comments":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/WegenenVerkeer/ng-kaart/statuses/63f4189a02dd0e944a2ef9135b88dadf635dc099"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"bepremeg"}}