src/js/filter/Control.Filter.js
function(filter, options) {

		// Default the options
		options = options || { suppressEvents: false, fitBounds: false };

		// Check to see if a change is being applied
		var shape = (null != this._filterState)?
			this._getGeo(this._filterState.type, this._filterState.shape)
			: undefined;

		// If there is no change, then we're just going to short circuit out of here
		if(this._toolbar.equals(shape, filter)) {
			return;
		}

		if(null != filter) {
			// Clear the old filter
			this._clearFilter(true);

			// Ask the handler for the filter object
			var filterObject = this._toolbar.setFilter(filter, options.suppressEvents);

			// Create the new filter
			this._createFilter(filterObject, options.suppressEvents);
			if(options.fitBounds) {
				this._map.fitBounds(filterObject.layer.getBounds());
			}

		}
		else {
			this._clearFilter();
		}

		return this;
	}
function(filter, options) {

		// Default the options
		options = options || { suppressEvents: false, fitBounds: false };

		// Check to see if a change is being applied
		var shape = (null != this._filterState)?
			this._getGeo(this._filterState.type, this._filterState.shape)
			: undefined;

		// If there is no change, then we're just going to short circuit out of here
		if(this._toolbar.equals(shape, filter)) {
			return;
		}

		if(null != filter) {
			// Clear the old filter
			this._clearFilter(true);

			// Ask the handler for the filter object
			var filterObject = this._toolbar.setFilter(filter, options.suppressEvents);

			// Create the new filter
			this._createFilter(filterObject, options.suppressEvents);
			if(options.fitBounds) {
				this._map.fitBounds(filterObject.layer.getBounds());
			}

		}
		else {
			this._clearFilter();
		}

		return this;
	}
function ( filter , options ) { // Default the options options = options || { suppressEvents : false , fitBounds : false } ; // Check to see if a change is being applied var shape = ( null != this . _filterState ) ? this . _getGeo ( this . _filterState . type , this . _filterState . shape ) : undefined ; // If there is no change, then we're just going to short circuit out of here if ( this . _toolbar . equals ( shape , filter ) ) { return ; } if ( null != filter ) { // Clear the old filter this . _clearFilter ( true ) ; // Ask the handler for the filter object var filterObject = this . _toolbar . setFilter ( filter , options . suppressEvents ) ; // Create the new filter this . _createFilter ( filterObject , options . suppressEvents ) ; if ( options . fitBounds ) { this . _map . fitBounds ( filterObject . layer . getBounds ( ) ) ; } } else { this . _clearFilter ( ) ; } return this ; }
Public method to programatically set the state of the filter
Public method to programatically set the state of the filter