SearchWidget ZoomScale

492
2
Jump to solution
01-29-2019 12:29 PM
JeffreyLafleur1
New Contributor

Hi!

I built my first apps using ver. 4.6 / 4.7 / 4.8 of the JS API.

I was using ZoomScale in the Search Widget to automatically zoom to the search result at a pre-defined zoom.

If I switch my code to ver. 4.9 or 4.10, the ZoomScale isn't working.

Is there a new way to accomplish the same result.

I only want to zoom to a defined scale folowing a search on a selected result.

Thanks!

Jeff

0 Kudos
1 Solution

Accepted Solutions
xlt208
by Esri Contributor
Esri Contributor

Hi Jeffrey,

I was able to reproduce the issue so I went ahead and logged a defect.

  • BUG-000129390: The ZoomScale property fails to set zoom scale for the selected search result from LayerSearchSource.

Just in case you were still experiencing this issue, a workaround would be to set view.scale in a select-result event. For example:

searchWidget.on("select-result"function () {
                        view.goTo({
                            scale: 500000
                        });
                    });

Apologies for the inconvenience!

Lingtao

Esri Support Services

View solution in original post

2 Replies
xlt208
by Esri Contributor
Esri Contributor

Hi Jeffrey,

I was able to reproduce the issue so I went ahead and logged a defect.

  • BUG-000129390: The ZoomScale property fails to set zoom scale for the selected search result from LayerSearchSource.

Just in case you were still experiencing this issue, a workaround would be to set view.scale in a select-result event. For example:

searchWidget.on("select-result"function () {
                        view.goTo({
                            scale: 500000
                        });
                    });

Apologies for the inconvenience!

Lingtao

Esri Support Services

JeffreyLafleur1
New Contributor

Hi,

Thanks, thats exactly the work around that I was using.

Jeffrey

>>> Lingtao Xie <geonet@esri.com> 13/03/20 16:35 >>>

GeoNet, The Esri Community | GIS and Geospatial

Professional Community Re: SearchWidget ZoomScale reply from

Lingtao Xie in ArcGIS API for JavaScript - View the full discussion

Hi Jeffrey,

I was able to reproduce the issue so I went ahead and logged a defect.

  • BUG-000129390: The ZoomScale property fails to set zoom scale for the

selected search result from LayerSearchSource.

A workaround would be to set view.scale in a select-result event. For

example:

searchWidget.on("select-result", function () {

view.goTo({

scale: 500000

});

});

Apologies for the inconvenience!

Lingtao

Esri Support Services

Reply to this message by replying to this email, or go to the

message on GeoNet, The Esri Community | GIS and Geospatial Professional

Community Start a new discussion in ArcGIS API for

JavaScript by email or at GeoNet, The Esri Community | GIS and

Geospatial Professional Community Following Re: SearchWidget

ZoomScale in these streams: Inbox

This email was sent by GeoNet, The Esri

Community | GIS and Geospatial Professional Community because you are a

registered user.

You may unsubscribe instantly from GeoNet, The

Esri Community | GIS and Geospatial Professional Community, or adjust

email frequency in your email preferences

Avant d'imprimer, pensez à l'environnement.