arcgis webappbuilder 中定义map对象代码片段

来源:互联网 发布:这位程序员四十岁了还 编辑:程序博客网 时间:2024/05/18 18:02

在MapManager.js中214行如下:

_publishMapEvent: function(map) {

        //add this property for debug purpose
        window._viewerMap = map;
        if (this.loading) {
          this.loading.destroy();
        }


        MapUrlParamsHandler.postProcessUrlParams(this.urlParams, map);


        console.timeEnd('Load Map');
        if (this.map) {
          this.map = map;
          this.resetInfoWindow(true);
          console.log('map changed.');
          topic.publish('mapChanged', this.map);
        } else {
          this.map = map;
          this.resetInfoWindow(true);
          topic.publish('mapLoaded', this.map);
        }

      },


在外部页面中使用 this._viewerMap,即可以使用map地图对象了

0 0
原创粉丝点击