Select to view content in your preferred language

goToOverride on Locate map component doesn't seem to be working. Bug?

36
1
5 hours ago
AllenHuang
Occasional Contributor

I am using v4.33 of the ArcGIS Maps SDK for JavaScript. 

I am disabling all the zoom-to animation for performance purposes. I notice that the goToOverride on the Locate map component doesn't work. The overriding function looks like below

export function noAnimateGoTo (view, goToParams) {
  goToParams.options = {
    animate: false
  };
  return view.goTo(goToParams.target, goToParams.options);
};

And I loaded the locate component like this

export function createLocateWidget (arcgisMap) {
  let widget = document.createElement('arcgis-locate');
  widget.position = 'top-left';
  widget.goToOverride = noAnimateGoTo;
  arcgisMap.appendChild(widget);
}

 

I use the same goToOverride method on the Home and Search widgets and both work. 

I check with v4.34 of the JS library, and it's Locate component have the same goToOverride problem.

Did I make a mistake with override? Or is there a possible bug with Locate map component?

0 Kudos
1 Reply
ReneRubalcava
Esri Frequent Contributor

Thanks for catching this. It doesn't look like there is a way to work around this at the moment, but we'll fix this for 5.0.

0 Kudos