Last active
November 1, 2017 11:28
-
-
Save adrianpietka/57ec031c71c01ce241c6fa1d837c6dd7 to your computer and use it in GitHub Desktop.
AngularJS 1.x & Bing Maps V8 Web Control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| var mapTimer = setInterval(mapSupervisor, 10); | |
| function mapModule(angular, Microsoft) { | |
| angular | |
| .module('app') | |
| .factory('mapProxyService', mapProxyService); | |
| console.log('Has all modules. Initialize.'); | |
| function mapProxyService() { | |
| console.log('Microsoft:', Microsoft); | |
| return { | |
| map: Microsoft.Maps | |
| } | |
| } | |
| } | |
| function mapSupervisor() { | |
| var isLoadedMap = window.Microsoft !== undefined | |
| && window.Microsoft.Maps !== undefined | |
| && window.Microsoft.Maps.Events !== undefined | |
| && window.Microsoft.Maps.Layer !== undefined; | |
| if (isLoadedMap) { | |
| clearInterval(mapTimer); | |
| mapModule(window.angular, window.Microsoft); | |
| } else { | |
| console.log('Waiting...'); | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment