Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
within: function (bounds) {
bounds = latLngBounds(bounds);
bounds = bounds.pad(0.5);
var center = bounds.getCenter();
var ne = bounds.getNorthWest();
this.params.location = center.lng + ',' + center.lat;
this.params.distance = Math.min(Math.max(center.distanceTo(ne), 2000), 50000);
this.params.searchExtent = EsriUtil.boundsToExtent(bounds);
return this;
},
within: function (bounds) {
bounds = latLngBounds(bounds);
this.params.searchExtent = EsriUtil.boundsToExtent(bounds);
return this;
},