Search Widget Zoom

1318
2
Jump to solution
03-21-2020 05:15 PM
jaykapalczynski
Frequent Contributor

I am using the search widget and successfully...

I can set the scale after a result is returned as such.

If I do not set the scale as seen below it still zooms to the result of the search widget.

But I want to disable the zoom completely....is there a way to do this...I have not seen anything in the documentation

        searchWidget.on("select-result", function(event) {
            view.goTo({
                scale: 3000000
            });
        });
0 Kudos
1 Solution

Accepted Solutions
AnneFitz
Esri Regular Contributor

Hi Jay,

Check out the goToOverride property on the Search widget. This allows you to override the goTo() method invoked when a result is selected. Hope this helps! 


Thanks,

Anne

View solution in original post

2 Replies
BenTurrell
Occasional Contributor III

Hey jay kapalczynski‌,

I'll be honest it has been a while since I have written js. Could you use Map | API Reference | ArcGIS API for JavaScript 3.31  and just pass it the current maps zoom scale?

I'm sure someone will have a much better answer but this could be a quick workaround.

Thanks,

Ben


If this answer was helpful please mark it as helpful. If this answer solved your question please mark it as the answer to help others who have the same question.

AnneFitz
Esri Regular Contributor

Hi Jay,

Check out the goToOverride property on the Search widget. This allows you to override the goTo() method invoked when a result is selected. Hope this helps! 


Thanks,

Anne