{"action":"created","issue":{"url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14350","repository_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs","labels_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14350/labels{/name}","comments_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14350/comments","events_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14350/events","html_url":"https://github.com/MicrosoftDocs/azure-docs/issues/14350","id":356019631,"node_id":"MDU6SXNzdWUzNTYwMTk2MzE=","number":14350,"title":"Azure Maps \"atlas.min.js\" Attempts to Initialise AppInsights Without Checking For Existing Instance","user":{"login":"KallumTanton","id":9702539,"node_id":"MDQ6VXNlcjk3MDI1Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/9702539?v=4","gravatar_id":"","url":"https://api.github.com/users/KallumTanton","html_url":"https://github.com/KallumTanton","followers_url":"https://api.github.com/users/KallumTanton/followers","following_url":"https://api.github.com/users/KallumTanton/following{/other_user}","gists_url":"https://api.github.com/users/KallumTanton/gists{/gist_id}","starred_url":"https://api.github.com/users/KallumTanton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KallumTanton/subscriptions","organizations_url":"https://api.github.com/users/KallumTanton/orgs","repos_url":"https://api.github.com/users/KallumTanton/repos","events_url":"https://api.github.com/users/KallumTanton/events{/privacy}","received_events_url":"https://api.github.com/users/KallumTanton/received_events","type":"User","site_admin":false},"labels":[{"id":836704823,"node_id":"MDU6TGFiZWw4MzY3MDQ4MjM=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/assigned-to-author","name":"assigned-to-author","color":"e01f8f","default":false},{"id":926842347,"node_id":"MDU6TGFiZWw5MjY4NDIzNDc=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/azure-maps/svc","name":"azure-maps/svc","color":"097705","default":false},{"id":880598256,"node_id":"MDU6TGFiZWw4ODA1OTgyNTY=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/product-issue","name":"product-issue","color":"2fe09f","default":false},{"id":836702742,"node_id":"MDU6TGFiZWw4MzY3MDI3NDI=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/triaged","name":"triaged","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":{"login":"dsk-2015","id":11432319,"node_id":"MDQ6VXNlcjExNDMyMzE5","avatar_url":"https://avatars0.githubusercontent.com/u/11432319?v=4","gravatar_id":"","url":"https://api.github.com/users/dsk-2015","html_url":"https://github.com/dsk-2015","followers_url":"https://api.github.com/users/dsk-2015/followers","following_url":"https://api.github.com/users/dsk-2015/following{/other_user}","gists_url":"https://api.github.com/users/dsk-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/dsk-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsk-2015/subscriptions","organizations_url":"https://api.github.com/users/dsk-2015/orgs","repos_url":"https://api.github.com/users/dsk-2015/repos","events_url":"https://api.github.com/users/dsk-2015/events{/privacy}","received_events_url":"https://api.github.com/users/dsk-2015/received_events","type":"User","site_admin":false},"assignees":[{"login":"dsk-2015","id":11432319,"node_id":"MDQ6VXNlcjExNDMyMzE5","avatar_url":"https://avatars0.githubusercontent.com/u/11432319?v=4","gravatar_id":"","url":"https://api.github.com/users/dsk-2015","html_url":"https://github.com/dsk-2015","followers_url":"https://api.github.com/users/dsk-2015/followers","following_url":"https://api.github.com/users/dsk-2015/following{/other_user}","gists_url":"https://api.github.com/users/dsk-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/dsk-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsk-2015/subscriptions","organizations_url":"https://api.github.com/users/dsk-2015/orgs","repos_url":"https://api.github.com/users/dsk-2015/repos","events_url":"https://api.github.com/users/dsk-2015/events{/privacy}","received_events_url":"https://api.github.com/users/dsk-2015/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-08-31T15:10:06Z","updated_at":"2018-10-15T22:21:14Z","closed_at":"2018-10-15T22:21:14Z","author_association":"NONE","body":"I'm attempting to use the Azure Maps Javascript control by using the simple instructions in [this article](https://docs.microsoft.com/en-us/azure/azure-maps/how-to-use-map-control).\n\nBoth the script (atlas.min.js) and the styles (atlas.min.css) are retrieved fine however, when I create a new map I receive the following error:\n```\napplicationinsights_js_1.AppInsights.downloadAndSetup is not a function\n    at new e (atlas.min.js?api-version=1.0:435)\n    at baa00b3f-f03c-47ac-a6e8-cd17688ca021:159\n```\nThe application this is being used in already has its own AppInsights initialisation in the header, long before this JS if ever executed. According to [this issue](https://github.com/Microsoft/ApplicationInsights-JS/issues/579) \"The call to downloadAndSetup can fail if the SDK is already downloaded and initialized\". The solution then is simply to check if the function \"downloadAndSetup\" exists before calling it. That's fine, but \"atlas.min.js\" doesn't perform this check and always executes this function regardless of its availability.\n\nMy code:\n\n```\n[Some HTML]\n<div id=\"map\"></div>\n[More HTML]\n<script src=\"https://atlas.microsoft.com/sdk/js/atlas.min.js?api-version=1.0\"></script>\n<script>\n        var map = new atlas.Map(\"map\", {\n            \"subscription-key\": \"YD----------------------------------------A\",\n            center: [-122.33263, 47.59093],\n            zoom: 12\n        });\n</script>\n[Closing HTML]\n```\n\n\n\n---\n#### Document Details\n\n⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*\n\n* ID: ea11ca51-2d51-8328-09d7-2ee9944e5751\n* Version Independent ID: 2077160d-3c5f-33d1-4d14-43a758071a76\n* Content: [How to use the Azure Maps Map Control](https://docs.microsoft.com/en-us/azure/azure-maps/how-to-use-map-control)\n* Content Source: [articles/azure-maps/how-to-use-map-control.md](https://github.com/Microsoft/azure-docs/blob/master/articles/azure-maps/how-to-use-map-control.md)\n* Service: **azure-maps**\n* GitHub Login: @dsk-2015\n* Microsoft Alias: **dkshir**"},"comment":{"url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/comments/430034573","html_url":"https://github.com/MicrosoftDocs/azure-docs/issues/14350#issuecomment-430034573","issue_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/14350","id":430034573,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDAzNDU3Mw==","user":{"login":"sergaz-msft","id":22173500,"node_id":"MDQ6VXNlcjIyMTczNTAw","avatar_url":"https://avatars1.githubusercontent.com/u/22173500?v=4","gravatar_id":"","url":"https://api.github.com/users/sergaz-msft","html_url":"https://github.com/sergaz-msft","followers_url":"https://api.github.com/users/sergaz-msft/followers","following_url":"https://api.github.com/users/sergaz-msft/following{/other_user}","gists_url":"https://api.github.com/users/sergaz-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/sergaz-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergaz-msft/subscriptions","organizations_url":"https://api.github.com/users/sergaz-msft/orgs","repos_url":"https://api.github.com/users/sergaz-msft/repos","events_url":"https://api.github.com/users/sergaz-msft/events{/privacy}","received_events_url":"https://api.github.com/users/sergaz-msft/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T22:21:14Z","updated_at":"2018-10-15T22:21:14Z","author_association":"CONTRIBUTOR","body":"We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue."}}
{"actor":{"display_login":"sergaz-msft"}}