Mark,
That change would not produce a cross origin error.
Here is what I have working fine in that exact function:
_publishMapEvent: function(map) {
topic.subscribe('toggleChanged', function(visible, layer){
console.info(visible, layer);
});
window._viewerMap = map;
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, this.layerInfosObj);
} else {
this.map = map;
this.resetInfoWindow(true);
topic.publish('mapLoaded', this.map, this.layerInfosObj);
}
},