{"action":"created","comment":{"url":"https://api.github.com/repos/APT-project/upcoming/pulls/comments/89854352","pull_request_review_id":10386172,"id":89854352,"diff_hunk":"@@ -0,0 +1,94 @@\n+(function() {\n+  'use strict';\n+  angular.module('upcomingStops.map').controller('MapController', MapController);\n+\n+  MapController.$inject = ['$scope'];\n+\n+  function MapController($scope) {\n+    var vm = this;\n+    vm.map = null;\n+\n+    vm.latestLocation = { lat: 61.498180, lng: 23.762195 };\n+\n+    vm.showUserPosition = true;\n+    vm.userPosMarker = null;\n+\n+    vm.setMap = setMap;\n+    vm.getMap = getMap;\n+    vm.centerToUser = centerToUser;\n+\n+    function setMap(map) {\n+      vm.map = map;\n+      initUserPositionMarker(vm.map, vm.latestLocation);\n+\n+      $scope.$emit('mapReady', vm.map);\n+    }\n+\n+    function getMap() {\n+      return vm.map;\n+    }\n+\n+    function initUserPositionMarker(map, initPosition) {\n+      vm.userPosMarker = map.createMarker({\n+        position: initPosition,\n+        icon: 'img/userpositionmarker.png'\n+      });\n+      vm.userPosMarker.setClickable(false);\n+\n+      if (vm.showUserPosition) {\n+        showUserPosMarker();\n+      }\n+    }\n+\n+    function updateUserPosMarker() {\n+      if (vm.userPosMarker !== null) {\n+        vm.userPosMarker.setPosition(vm.latestLocation);\n+      }\n+    }\n+\n+    function showUserPosMarker() {\n+      if (vm.map !== null && vm.latestLocation != null) {\n+        if (vm.userPosMarker === null) {\n+          initUserPositionMarker(vm.map, vm.latestLocation);\n+        }\n+\n+        vm.map.showMarker(vm.userPosMarker);\n+      }\n+    }\n+\n+    function centerToUser() {\n+      if (vm.map !== null && vm.latestLocation != null) {\n+        vm.map.setZoom(15);\n+        vm.map.panTo(vm.latestLocation);\n+      }\n+    }\n+\n+    llb_app.addListener('location', function(data){","path":"app/js/map/map.controller.js","position":66,"original_position":66,"commit_id":"62e37e1eea93119358e096e8b920f93c3c24c030","original_commit_id":"62e37e1eea93119358e096e8b920f93c3c24c030","user":{"login":"Pikkuninja","id":4076467,"avatar_url":"https://avatars.githubusercontent.com/u/4076467?v=3","gravatar_id":"","url":"https://api.github.com/users/Pikkuninja","html_url":"https://github.com/Pikkuninja","followers_url":"https://api.github.com/users/Pikkuninja/followers","following_url":"https://api.github.com/users/Pikkuninja/following{/other_user}","gists_url":"https://api.github.com/users/Pikkuninja/gists{/gist_id}","starred_url":"https://api.github.com/users/Pikkuninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pikkuninja/subscriptions","organizations_url":"https://api.github.com/users/Pikkuninja/orgs","repos_url":"https://api.github.com/users/Pikkuninja/repos","events_url":"https://api.github.com/users/Pikkuninja/events{/privacy}","received_events_url":"https://api.github.com/users/Pikkuninja/received_events","type":"User","site_admin":false},"body":"This is needed in the controller. Modules really aren't anything more than packages in Java.","created_at":"2016-11-28T19:03:57Z","updated_at":"2016-11-28T19:03:57Z","html_url":"https://github.com/APT-project/upcoming/pull/30#discussion_r89854352","pull_request_url":"https://api.github.com/repos/APT-project/upcoming/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/APT-project/upcoming/pulls/comments/89854352"},"html":{"href":"https://github.com/APT-project/upcoming/pull/30#discussion_r89854352"},"pull_request":{"href":"https://api.github.com/repos/APT-project/upcoming/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/APT-project/upcoming/pulls/30","id":95521695,"html_url":"https://github.com/APT-project/upcoming/pull/30","diff_url":"https://github.com/APT-project/upcoming/pull/30.diff","patch_url":"https://github.com/APT-project/upcoming/pull/30.patch","issue_url":"https://api.github.com/repos/APT-project/upcoming/issues/30","number":30,"state":"open","locked":false,"title":"Added a Google map implementation from city info app","user":{"login":"Pikkuninja","id":4076467,"avatar_url":"https://avatars.githubusercontent.com/u/4076467?v=3","gravatar_id":"","url":"https://api.github.com/users/Pikkuninja","html_url":"https://github.com/Pikkuninja","followers_url":"https://api.github.com/users/Pikkuninja/followers","following_url":"https://api.github.com/users/Pikkuninja/following{/other_user}","gists_url":"https://api.github.com/users/Pikkuninja/gists{/gist_id}","starred_url":"https://api.github.com/users/Pikkuninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pikkuninja/subscriptions","organizations_url":"https://api.github.com/users/Pikkuninja/orgs","repos_url":"https://api.github.com/users/Pikkuninja/repos","events_url":"https://api.github.com/users/Pikkuninja/events{/privacy}","received_events_url":"https://api.github.com/users/Pikkuninja/received_events","type":"User","site_admin":false},"body":"Added maps module and shared module from city info. Shared module has code for async loading of the Google Maps libraries.\r\n\r\nAlso applied couple of fixes to the added modules, the ng-if statement for showing/hiding instead of ng-show kinda messed couple of things up. Especially reshowing a map that was once shown but was hidden by going to tilemode didn't work, the map just didn't bother to redraw itself so I added a function to redraw it manually and call it with a small delay when the app state changes.\r\n\r\nGet your own Google Maps API key, I kinda regret putting mine to public display on our own repo in the first place.","created_at":"2016-11-28T15:41:12Z","updated_at":"2016-11-28T19:03:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42b24a860fcc564faab39d3400a230a16d31e28b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/APT-project/upcoming/pulls/30/commits","review_comments_url":"https://api.github.com/repos/APT-project/upcoming/pulls/30/comments","review_comment_url":"https://api.github.com/repos/APT-project/upcoming/pulls/comments{/number}","comments_url":"https://api.github.com/repos/APT-project/upcoming/issues/30/comments","statuses_url":"https://api.github.com/repos/APT-project/upcoming/statuses/62e37e1eea93119358e096e8b920f93c3c24c030","head":{"label":"Pikkuninja:google-map","ref":"google-map","sha":"62e37e1eea93119358e096e8b920f93c3c24c030","user":{"login":"Pikkuninja","id":4076467,"avatar_url":"https://avatars.githubusercontent.com/u/4076467?v=3","gravatar_id":"","url":"https://api.github.com/users/Pikkuninja","html_url":"https://github.com/Pikkuninja","followers_url":"https://api.github.com/users/Pikkuninja/followers","following_url":"https://api.github.com/users/Pikkuninja/following{/other_user}","gists_url":"https://api.github.com/users/Pikkuninja/gists{/gist_id}","starred_url":"https://api.github.com/users/Pikkuninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pikkuninja/subscriptions","organizations_url":"https://api.github.com/users/Pikkuninja/orgs","repos_url":"https://api.github.com/users/Pikkuninja/repos","events_url":"https://api.github.com/users/Pikkuninja/events{/privacy}","received_events_url":"https://api.github.com/users/Pikkuninja/received_events","type":"User","site_admin":false},"repo":{"id":74976213,"name":"upcoming","full_name":"Pikkuninja/upcoming","owner":{"login":"Pikkuninja","id":4076467,"avatar_url":"https://avatars.githubusercontent.com/u/4076467?v=3","gravatar_id":"","url":"https://api.github.com/users/Pikkuninja","html_url":"https://github.com/Pikkuninja","followers_url":"https://api.github.com/users/Pikkuninja/followers","following_url":"https://api.github.com/users/Pikkuninja/following{/other_user}","gists_url":"https://api.github.com/users/Pikkuninja/gists{/gist_id}","starred_url":"https://api.github.com/users/Pikkuninja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pikkuninja/subscriptions","organizations_url":"https://api.github.com/users/Pikkuninja/orgs","repos_url":"https://api.github.com/users/Pikkuninja/repos","events_url":"https://api.github.com/users/Pikkuninja/events{/privacy}","received_events_url":"https://api.github.com/users/Pikkuninja/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Pikkuninja/upcoming","description":"Upcoming Stops","fork":true,"url":"https://api.github.com/repos/Pikkuninja/upcoming","forks_url":"https://api.github.com/repos/Pikkuninja/upcoming/forks","keys_url":"https://api.github.com/repos/Pikkuninja/upcoming/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Pikkuninja/upcoming/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Pikkuninja/upcoming/teams","hooks_url":"https://api.github.com/repos/Pikkuninja/upcoming/hooks","issue_events_url":"https://api.github.com/repos/Pikkuninja/upcoming/issues/events{/number}","events_url":"https://api.github.com/repos/Pikkuninja/upcoming/events","assignees_url":"https://api.github.com/repos/Pikkuninja/upcoming/assignees{/user}","branches_url":"https://api.github.com/repos/Pikkuninja/upcoming/branches{/branch}","tags_url":"https://api.github.com/repos/Pikkuninja/upcoming/tags","blobs_url":"https://api.github.com/repos/Pikkuninja/upcoming/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Pikkuninja/upcoming/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Pikkuninja/upcoming/git/refs{/sha}","trees_url":"https://api.github.com/repos/Pikkuninja/upcoming/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Pikkuninja/upcoming/statuses/{sha}","languages_url":"https://api.github.com/repos/Pikkuninja/upcoming/languages","stargazers_url":"https://api.github.com/repos/Pikkuninja/upcoming/stargazers","contributors_url":"https://api.github.com/repos/Pikkuninja/upcoming/contributors","subscribers_url":"https://api.github.com/repos/Pikkuninja/upcoming/subscribers","subscription_url":"https://api.github.com/repos/Pikkuninja/upcoming/subscription","commits_url":"https://api.github.com/repos/Pikkuninja/upcoming/commits{/sha}","git_commits_url":"https://api.github.com/repos/Pikkuninja/upcoming/git/commits{/sha}","comments_url":"https://api.github.com/repos/Pikkuninja/upcoming/comments{/number}","issue_comment_url":"https://api.github.com/repos/Pikkuninja/upcoming/issues/comments{/number}","contents_url":"https://api.github.com/repos/Pikkuninja/upcoming/contents/{+path}","compare_url":"https://api.github.com/repos/Pikkuninja/upcoming/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Pikkuninja/upcoming/merges","archive_url":"https://api.github.com/repos/Pikkuninja/upcoming/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Pikkuninja/upcoming/downloads","issues_url":"https://api.github.com/repos/Pikkuninja/upcoming/issues{/number}","pulls_url":"https://api.github.com/repos/Pikkuninja/upcoming/pulls{/number}","milestones_url":"https://api.github.com/repos/Pikkuninja/upcoming/milestones{/number}","notifications_url":"https://api.github.com/repos/Pikkuninja/upcoming/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Pikkuninja/upcoming/labels{/name}","releases_url":"https://api.github.com/repos/Pikkuninja/upcoming/releases{/id}","deployments_url":"https://api.github.com/repos/Pikkuninja/upcoming/deployments","created_at":"2016-11-28T13:36:12Z","updated_at":"2016-11-28T13:36:13Z","pushed_at":"2016-11-28T15:31:18Z","git_url":"git://github.com/Pikkuninja/upcoming.git","ssh_url":"git@github.com:Pikkuninja/upcoming.git","clone_url":"https://github.com/Pikkuninja/upcoming.git","svn_url":"https://github.com/Pikkuninja/upcoming","homepage":"","size":730,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"APT-project:master","ref":"master","sha":"d48524a0c2b042a599810ec41964231f558be0fa","user":{"login":"APT-project","id":22332627,"avatar_url":"https://avatars.githubusercontent.com/u/22332627?v=3","gravatar_id":"","url":"https://api.github.com/users/APT-project","html_url":"https://github.com/APT-project","followers_url":"https://api.github.com/users/APT-project/followers","following_url":"https://api.github.com/users/APT-project/following{/other_user}","gists_url":"https://api.github.com/users/APT-project/gists{/gist_id}","starred_url":"https://api.github.com/users/APT-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/APT-project/subscriptions","organizations_url":"https://api.github.com/users/APT-project/orgs","repos_url":"https://api.github.com/users/APT-project/repos","events_url":"https://api.github.com/users/APT-project/events{/privacy}","received_events_url":"https://api.github.com/users/APT-project/received_events","type":"Organization","site_admin":false},"repo":{"id":69794173,"name":"upcoming","full_name":"APT-project/upcoming","owner":{"login":"APT-project","id":22332627,"avatar_url":"https://avatars.githubusercontent.com/u/22332627?v=3","gravatar_id":"","url":"https://api.github.com/users/APT-project","html_url":"https://github.com/APT-project","followers_url":"https://api.github.com/users/APT-project/followers","following_url":"https://api.github.com/users/APT-project/following{/other_user}","gists_url":"https://api.github.com/users/APT-project/gists{/gist_id}","starred_url":"https://api.github.com/users/APT-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/APT-project/subscriptions","organizations_url":"https://api.github.com/users/APT-project/orgs","repos_url":"https://api.github.com/users/APT-project/repos","events_url":"https://api.github.com/users/APT-project/events{/privacy}","received_events_url":"https://api.github.com/users/APT-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/APT-project/upcoming","description":"Upcoming Stops","fork":false,"url":"https://api.github.com/repos/APT-project/upcoming","forks_url":"https://api.github.com/repos/APT-project/upcoming/forks","keys_url":"https://api.github.com/repos/APT-project/upcoming/keys{/key_id}","collaborators_url":"https://api.github.com/repos/APT-project/upcoming/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/APT-project/upcoming/teams","hooks_url":"https://api.github.com/repos/APT-project/upcoming/hooks","issue_events_url":"https://api.github.com/repos/APT-project/upcoming/issues/events{/number}","events_url":"https://api.github.com/repos/APT-project/upcoming/events","assignees_url":"https://api.github.com/repos/APT-project/upcoming/assignees{/user}","branches_url":"https://api.github.com/repos/APT-project/upcoming/branches{/branch}","tags_url":"https://api.github.com/repos/APT-project/upcoming/tags","blobs_url":"https://api.github.com/repos/APT-project/upcoming/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/APT-project/upcoming/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/APT-project/upcoming/git/refs{/sha}","trees_url":"https://api.github.com/repos/APT-project/upcoming/git/trees{/sha}","statuses_url":"https://api.github.com/repos/APT-project/upcoming/statuses/{sha}","languages_url":"https://api.github.com/repos/APT-project/upcoming/languages","stargazers_url":"https://api.github.com/repos/APT-project/upcoming/stargazers","contributors_url":"https://api.github.com/repos/APT-project/upcoming/contributors","subscribers_url":"https://api.github.com/repos/APT-project/upcoming/subscribers","subscription_url":"https://api.github.com/repos/APT-project/upcoming/subscription","commits_url":"https://api.github.com/repos/APT-project/upcoming/commits{/sha}","git_commits_url":"https://api.github.com/repos/APT-project/upcoming/git/commits{/sha}","comments_url":"https://api.github.com/repos/APT-project/upcoming/comments{/number}","issue_comment_url":"https://api.github.com/repos/APT-project/upcoming/issues/comments{/number}","contents_url":"https://api.github.com/repos/APT-project/upcoming/contents/{+path}","compare_url":"https://api.github.com/repos/APT-project/upcoming/compare/{base}...{head}","merges_url":"https://api.github.com/repos/APT-project/upcoming/merges","archive_url":"https://api.github.com/repos/APT-project/upcoming/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/APT-project/upcoming/downloads","issues_url":"https://api.github.com/repos/APT-project/upcoming/issues{/number}","pulls_url":"https://api.github.com/repos/APT-project/upcoming/pulls{/number}","milestones_url":"https://api.github.com/repos/APT-project/upcoming/milestones{/number}","notifications_url":"https://api.github.com/repos/APT-project/upcoming/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/APT-project/upcoming/labels{/name}","releases_url":"https://api.github.com/repos/APT-project/upcoming/releases{/id}","deployments_url":"https://api.github.com/repos/APT-project/upcoming/deployments","created_at":"2016-10-02T11:41:21Z","updated_at":"2016-11-07T14:17:28Z","pushed_at":"2016-11-28T15:41:12Z","git_url":"git://github.com/APT-project/upcoming.git","ssh_url":"git@github.com:APT-project/upcoming.git","clone_url":"https://github.com/APT-project/upcoming.git","svn_url":"https://github.com/APT-project/upcoming","homepage":"","size":726,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":6,"forks":4,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/APT-project/upcoming/pulls/30"},"html":{"href":"https://github.com/APT-project/upcoming/pull/30"},"issue":{"href":"https://api.github.com/repos/APT-project/upcoming/issues/30"},"comments":{"href":"https://api.github.com/repos/APT-project/upcoming/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/APT-project/upcoming/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/APT-project/upcoming/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/APT-project/upcoming/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/APT-project/upcoming/statuses/62e37e1eea93119358e096e8b920f93c3c24c030"}}}}
{"actor":{"display_login":"Pikkuninja"}}