Zoom button and auto zoom in Directions widget

1827
3
Jump to solution
06-22-2017 02:17 AM
NiklasKöhn
Esri Contributor

I'm experiencing two issues with the Directions widget of the JS API:

  • The first issue came in with API version 3.19: The “Zoom to full route” button was available up to API version 3.18 and is missing now. Our customers would like to have it back.
  • The 2nd issue was probably always there: After performing “autoSolve” the Directions widget does not zoom to the route. Only after hitting “Get Directions”, the map will zoom in to the route. The issue didn’t attract so much attention before, because you could just hit the “Zoom to full route” button, which you can’t anymore now.

 

The attached screenshots show the behavior. You can reproduce the issue by using the sample at https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=widget_directions_basic:

  • Add 2 locations and let the widget auto solve the route. It won’t zoom to the routing result. Only after hitting “Get directions”, the zoom will occur.
  • Alter the code to use API version 3.18 instead of 3.20: The “Zoom to full route” button will appear above the directions list after calculating the first route. The button is missing in API version 3.19 and 3.20.

 

The JS API documentation says:

esriResultsViewFullRoute

Class assigned to the 'Zoom to full route' button.

/*Change the color of the Zoom to full route text*/

.simpleDirections .esriResultsViewFullRoute{

  color:#999;

}

I’d say this proves that the button is not intended to be missing. odoe‌ any idea?

 3.18 has no auto zoom after autoSolve, but a zoom button

3.19 has no auto zoom after autoSolve AND the zoom button is missing

0 Kudos
1 Solution

Accepted Solutions
NiklasKöhn
Esri Contributor

In the meantime, I've opened up a support case and the missing button has become an enhancement request.

ENH-000106066 : Add the "ZOOM TO FULL ROUTE" option back to the Directions widget.

BUG-000106065 : When using the Directions widget if the user adds stops by clicking on the map the map does not zoom to the extent of the route automatically.

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Niklas,

   I have looked through all the html elements to see if the zoom button was just set to not display, but it just doesn't exist in the html. So it seems like the docs may have not been updated to reflect a change to do away with this button in lieu of the get directions button zooming to the full route. 

NiklasKöhn
Esri Contributor

Yeah, that's possible.. but I actually hope that they've lost the button by accident and that it will be included again.

0 Kudos
NiklasKöhn
Esri Contributor

In the meantime, I've opened up a support case and the missing button has become an enhancement request.

ENH-000106066 : Add the "ZOOM TO FULL ROUTE" option back to the Directions widget.

BUG-000106065 : When using the Directions widget if the user adds stops by clicking on the map the map does not zoom to the extent of the route automatically.