Directions Widget - "Show Traffic" off by Default?

386
2
Jump to solution
04-10-2017 05:04 AM
JasonStanton__GISP
Occasional Contributor

In the Directions Widget (v2.4) is there a way to have "Show Traffic" off by default?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   In the Directions Widget.js Startup function make the change below (line 4):

          if(this.config.trafficLayerUrl){
            this._trafficLayer = new ArcGISDynamicMapServiceLayer(this.config.trafficLayerUrl);
            options.trafficLayer = this._trafficLayer;
            options.traffic = false;
          }else{
            options.traffic = false;
            options.showTrafficOption = false;
          }

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   In the Directions Widget.js Startup function make the change below (line 4):

          if(this.config.trafficLayerUrl){
            this._trafficLayer = new ArcGISDynamicMapServiceLayer(this.config.trafficLayerUrl);
            options.trafficLayer = this._trafficLayer;
            options.traffic = false;
          }else{
            options.traffic = false;
            options.showTrafficOption = false;
          }
JasonStanton__GISP
Occasional Contributor

Thanks a million Robert!

0 Kudos