AnsweredAssumed Answered

Having problems using autoNavigate:false in the Search widget

Question asked by schlot on Oct 6, 2015
Latest reply on Oct 7, 2015 by schlot

I want to control the map scale on the Search widget, which I think zooms in too close for my purposes.  I have turned off autoNavigate, but it still zooms in the same as it always has.  Do I have the parameter in the wrong spot?

//Search widget, used for geocoding   
    app.searchTool = new Search ({
         map:app.map,
              minCharacters: 8, 
              countryCode: "US", 
              searchExtent:app.startExtent
       }, dom.byId('geocoder'));
       
       var sources = [];
       sources.push({
        locator: new Locator("//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),
        singleLineFieldName: "SingleLine",
        outFields: ["Addr_type"],
        name: "World Geocode Service",
        localSearchOptions: {
          minScale: 300000,
          distance: 50000
        },
        placeholder: "Enter Address",
        highlightSymbol: new PictureMarkerSymbol(app.geoSymbol).setOffset(9, 18),
        showInfoWindowOnSelect:false,
        enableInfoWindow:true,
        autoNavigate:false
      });
    
       app.searchTool.set("sources", sources);
       app.searchTool.startup();
       
        app.searchTool.on("select-result", function (evt){
          var addr = evt.result.name;
          var containsCounty = addr.indexOf(' County,');
          if (containsCounty > 0){
            app.map.centerAndZoom(evt.result.feature.geometry, 10);
          }else {
            app.map.centerAndZoom(evt.result.feature.geometry, 14);
          }
          });

Outcomes