bingmaps V8 + Typescript + requirejs as AMD loader RRS feed

  • Question

  • Hi,

    I'm not able to get bingmaps V8 loaded, no matter what I do. Its driving me crazy.

    Typescript 1.9

    Here my require config:

        waitSeconds: 10,
        baseUrl: "/",   
        paths: {		
            "bingmaps": "https://www.bing.com/api/maps/mapcontrol?branch=experimental",        
        shim: {
                exports: "Microsoft"

    I also created a definition file "bingmaps.d.ts":

    declare var bingmaps: any;
    declare module 'bingmaps' {
        export = bingmaps;

    So now I can load bing map (for example in my app.ts):

    import Microsoft = require('bingmaps');

    But Microsoft is always undefined. I try to solve this now the last 4h and it drives me crazy.... :(


    It looks like it is related to this thread.

    Regards Steffen

    Wednesday, July 27, 2016 10:37 PM


  • Here is a code sample the uses SystemJS which used AMD loader. This may help resolve this issue.

    <!DOCTYPE html>
        <meta charset="utf-8" />
                   <script src="https://jspm.io/system@0.19.34.js"></script>
                     defaultJSExtensions: false,
                     meta: {
                                  "BingMap": {
                                    "scriptLoad": true,
                                    "format": "global",
                                    "exports": "BingMap"
                     map: {
                                  "BingMap": "https://www.bing.com/api/maps/mapcontrol?branch=experimental"
                     System.import('BingMap').then(() => {
                                                 var map = new Microsoft.Maps.Map(document.getElementById('map'), {
                                                   credentials: ''
                                  }, 500);
                   <div id='map'></div>

    [Blog] [twitter] [LinkedIn]

    Wednesday, August 31, 2016 1:30 AM