none
Bing Maps v8 migration: cannot use Microsoft.Maps.Search module RRS feed

  • Question

  • We are migrating from V7 to V8 and using angularJS.

    Our map/mapController is a directive embedded in different pages.

    When access below code more than once,  

    init() {

    ...

    Microsoft.Maps.loadModule('Microsoft.Maps.Search', { callback: searchModuleLoaded });

    }

    var searchModuleLoaded = function() {
    //$scope.searchManager = new Microsoft.Maps.Search.SearchManager(map);

    if (!searchManager) {
    map.addComponent('searchManager', new Microsoft.Maps.Search.SearchManager(map));
    searchManager = map.getComponent('searchManager');
    }
    $scope.isSearchModuleReady.resolve();
    };

    javascript return error on map.addComponent is not function.

    We use to load searchManager by just

    new Microsoft.Maps.Search.SearchManager(map);

    but seems like that won't work anymore.  (searchManager.search not defined)

    How should I fix this?

    <o:p></o:p>

    Wednesday, May 24, 2017 1:44 AM

Answers