{"action":"created","comment":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/33750941","id":33750941,"diff_hunk":"@@ -37,12 +38,116 @@ goog.require('ga_map_service');\n \n         if (useTemporaryLayer) {\n           dfltLayer.displayInLayerManager = false;\n+          dfltLayer.preview = true;\n         }\n-\n+        gaMeasure.registerOverlaysEvents(map, dfltLayer);\n         dfltLayer.label = 'Drawing';\n         dfltLayer.type = 'KML';\n         return dfltLayer;\n       };\n+      // Find the corresponding style\n+      var findIcon = function(olIcon, icons) {\n+        var id = olIcon.getSrc();\n+        for (var i = 0; i < icons.length; i++) {\n+          var regex = new RegExp('/' + icons[i].id + '-24');\n+          if (regex.test(id)) {\n+            return icons[i];\n+          }\n+        }\n+        return icons[0];\n+      };\n+\n+      var findIconSize = function(olIcon, iconSizes) {\n+        var scale = olIcon.getScale();\n+        for (var i = 0; i < iconSizes.length; i++) {\n+          if (scale == iconSizes[i].scale) {\n+            return iconSizes[i];\n+          }\n+        }\n+        return iconSizes[0];\n+      };\n+\n+      var findColor = function(olColor, colors) {\n+        var rgb = ol.color.asString(olColor.slice(0, 3));\n+        for (var i = 0; i < colors.length; i++) {\n+          if (rgb == ol.color.asString(colors[i].fill)) {\n+            return colors[i];\n+          }\n+        }\n+        return colors[0];\n+      };\n+\n+      // Creates a new help tooltip\n+      var createHelpTooltip = function() {\n+        var tooltipElement = document.createElement('div');\n+        tooltipElement.className = 'ga-draw-help';\n+        var tooltip = new ol.Overlay({\n+          element: tooltipElement,\n+          offset: [15, 15],\n+          positioning: 'top-left',\n+          stopEvent: false\n+        });\n+        return tooltip;\n+      };\n+\n+      // Creates a new measure tooltip with a nice arrow\n+      var createMeasureTooltip = function() {\n+        var tooltipElement = document.createElement('div');","path":"src/components/draw/DrawDirective.js","position":72,"original_position":72,"commit_id":"2940b78c60614c378226a55fad43d5e45ad213d3","original_commit_id":"278382ff73213bb774e3fd14c23d6de9bc130cbf","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":"dito?","created_at":"2015-07-02T06:49:51Z","updated_at":"2015-07-02T06:49:51Z","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2457#discussion_r33750941","pull_request_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457","_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/33750941"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/2457#discussion_r33750941"},"pull_request":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457"}}},"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457","id":38887635,"html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2457","diff_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2457.diff","patch_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2457.patch","issue_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2457","number":2457,"state":"open","locked":false,"title":"New draw","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 #2258 \r\n\r\n[test](https://mf-geoadmin3.dev.bgdi.ch/teo_new_draw)","created_at":"2015-06-30T15:01:14Z","updated_at":"2015-07-02T06:49:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b5c96922f8e1e710f33cea6aece32c9f473a6af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457/commits","review_comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457/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/2457/comments","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/2940b78c60614c378226a55fad43d5e45ad213d3","head":{"label":"geoadmin:teo_new_draw","ref":"teo_new_draw","sha":"2940b78c60614c378226a55fad43d5e45ad213d3","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-05-08T06:47:45Z","pushed_at":"2015-07-02T06:42:55Z","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":40146,"stargazers_count":69,"watchers_count":69,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":75,"forks":32,"open_issues":75,"watchers":69,"default_branch":"master"}},"base":{"label":"geoadmin:master","ref":"master","sha":"04b384e278095ddf172942494d1f999ced8abb45","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-05-08T06:47:45Z","pushed_at":"2015-07-02T06:42:55Z","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":40146,"stargazers_count":69,"watchers_count":69,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":75,"forks":32,"open_issues":75,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/2457"},"issue":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2457"},"comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2457/comments"},"review_comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2457/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/2457/commits"},"statuses":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/2940b78c60614c378226a55fad43d5e45ad213d3"}}}}