Hi all, I changed my map extent using:
var extent = graphicsUtils.graphicsExtent(featureSet.features).expand(1);
extent.spatialReference = spatialRef;
this.map.setExtent(extent, true);
Now I'm trying to set home widget button extent...
Anyone knows how to do it?
Thanks,
Naty
Solved! Go to Solution.
Hi Naty,
The extent property of homeButtonWidget can be set, for details: HomeButton | API Reference | ArcGIS API for JavaScript 3.17
In WAB, you could write your code like this:
//get the reference of HomeButtonWidget var homeButtonWidget = window._widgetManager.getWidgetsByName("HomeButton"); if(homeButtonWidget){ //the extent you want var extent = window._widgetManager.map.extent; //set extent homeButtonWidget[0].homeDijit.extent = extent; }
Hi Naty,
The extent property of homeButtonWidget can be set, for details: HomeButton | API Reference | ArcGIS API for JavaScript 3.17
In WAB, you could write your code like this:
//get the reference of HomeButtonWidget var homeButtonWidget = window._widgetManager.getWidgetsByName("HomeButton"); if(homeButtonWidget){ //the extent you want var extent = window._widgetManager.map.extent; //set extent homeButtonWidget[0].homeDijit.extent = extent; }
Tao, Thank you!!!
Great!!
Naty