Is it possible to reverse the Direction in The Near Me Widget? So the direction should be from the (search layer(s)) to the user Point.
Many Thanks
Solved! Go to Solution.
Husham,
It should be as simple as swapping the order that the stops are added to the selectedLocations array in the _routeSelectedLocations function in the items-list.js file in the widget folder.
currently is has this:
selectedLocations.push(this._getPointFromGeometry(this._selectedPoint.geometry));
selectedLocations.push(this._getPointFromGeometry(this._selectedFeature.geometry));
If you add reverse:
selectedLocations.push(this._getPointFromGeometry(this._selectedPoint.geometry));
selectedLocations.push(this._getPointFromGeometry(this._selectedFeature.geometry));
selectedLocations.reverse();
Then it should get you what you want.
Husham,
It should be as simple as swapping the order that the stops are added to the selectedLocations array in the _routeSelectedLocations function in the items-list.js file in the widget folder.
currently is has this:
selectedLocations.push(this._getPointFromGeometry(this._selectedPoint.geometry));
selectedLocations.push(this._getPointFromGeometry(this._selectedFeature.geometry));
If you add reverse:
selectedLocations.push(this._getPointFromGeometry(this._selectedPoint.geometry));
selectedLocations.push(this._getPointFromGeometry(this._selectedFeature.geometry));
selectedLocations.reverse();
Then it should get you what you want.
Thank you so much it worked perfectly