You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does the web map reload at full scale before zooming to the user defined extent?
A solution that I have used in the past is to modify the extent in the this.appConfig object before recreating the web map
this.own(on(this.themesDijit,"selection-change",lang.hitch(this,function(){this.appConfig.map.itemId=this.themesDijit.getSelected().itemId;//change extent in this.appConfig hereMapManager.getInstance()._recreateMap(this.appConfig);})));
Also, I'm a little concerned that this code makes a public call to a private function (denoted by the underscore). Especially when previous snippets that we have sent and examples within the Esri code identify that there are supported methods of updating the web map that involve publishing subscriber events that notify the web app builder that the map is about to change.
/The widget broadcasts a message that the map is about to be destroyed
topic.publish('beforeMapDestory',this.map);//The map is destroyedthis.map.destroy();//A new deffered object is created to handle the creation of a new webmapvarmapDeferred=jimuUtils.createWebMap(portalUrl,webMapItemId,mapContainerId,webMapOptions);//The deffered is executed ensuring that the response is executed with "this" being the widget.js filemapDeferred.then(lang.hitch(this,this._processNewMapSuccess),lang.hitch(this,this._processNewMapFail));//I set up the returned web map as a map objectvarmap=response.map;map.itemId=this.appConfig.map.itemId;map.itemInfo=response.itemInfo;map.webMapResponse=response;// enable snappingvaroptions={snapKey: keys.copyKey};map.enableSnapping(options);//The widget gets a handle on the appConfigvarappConfig=this.appConfig//The map is set as the applications map propertythis.map=map;//The widget broadcasts a message that the map has been changed//The app builder handles all the magic from heretopic.publish('mapChanged',this.map);
The text was updated successfully, but these errors were encountered:
Why does the web map reload at full scale before zooming to the user defined extent?
A solution that I have used in the past is to modify the extent in the this.appConfig object before recreating the web map
Also, I'm a little concerned that this code makes a public call to a private function (denoted by the underscore). Especially when previous snippets that we have sent and examples within the Esri code identify that there are supported methods of updating the web map that involve publishing subscriber events that notify the web app builder that the map is about to change.
The text was updated successfully, but these errors were encountered: