AnsweredAssumed Answered

esri/dijit/Geocoder - How to Set Max Characters allowed

Question asked by thejohnny on Feb 17, 2015
Latest reply on Feb 17, 2015 by thejohnny

I've read the API content for the esri/dijit/Geocoder and didn't see anything in regards to maxCharacters allowed for user input.  Does anyone know how I can set this in my application?  One of our network staff tossed in roughly a million characters into the search box and slowed the server to a crawl for a few seconds.  Is there any way we can set a Max Characters sort of like the way there is a minCharacters property in the geocoder api?

 

Thanks so much.  Here is the code the way I have it now.

 

// Creates the Geocoder using the RTC Streets Geocoder

  var myGeocoders = [{

    url: locatorUrl,

    name: "LocateLocationByAddress",

    placeholder: "Search By Local Address"

  }];

 

  var geocoder = new Geocoder({

    map: map,

    autoComplete: true,

    arcgisGeocoder: false,

    geocoders: myGeocoders

  }, "search");

  geocoder.startup();

     

  var geoSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,
18,

    new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,

    new Color([255, 153, 153, 0.5]), 8),

    new Color([255, 0, 0])

  );

       

// Modify the symbol user to show geocoded location

  geocoder.on("select", function showLocation(evt){

    var point = evt.result.feature.geometry;

    var graphic = new esri.Graphic(point, geoSymbol);

    map.graphics.add(graphic);

  });

Outcomes