With the 4.32 release of the Javascript SDK, the Track widget has become deprecated and the Track component is preferred. With the old widget you could set the rotationEnabled property, but there is no similar option with the web component. Is there any way to control the view rotation with the new web component? The TrackViewModel also lacks a property to set the rotation option.
You can do a workaround by getting to the viewModel or by using the override functionality.
const arcgisTrack = document.querySelector("arcgis-track"); arcgisTrack.addEventListener("arcgisReady", (event) => { // 1. hacky way to disable rotation arcgisTrack._store.viewModel.rotationEnabled = false; // 2. or you can override the goTo function arcgisTrack.goToOverride = function(view, goToParams) { // 2.1 set any rotation goToParams.target.rotation = 80; // 2.2 or delete the parameter to keep current rotation // setting rotation to null will reset to 0 delete goToParams.target.rotation; return view.goTo(goToParams.target, goToParams.options); }; });
@FC_Basson, thanks for the heads-up. I'll open an issue to get that added at 4.33. I'm not sure why the property didn't get exposed in the component.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.