/**
 * Calls the relevant form input class depending on the provided service.
 *
 * @param string $coordinates
 * @param string $input_name
 * @param boolean $is_mandatory
 * @param boolean $is_disabled
 * @param array $field_args
 * 
 * @return array
 */
function smfSelectFormInputHTML($coordinates, $input_name, $is_mandatory, $is_disabled, array $field_args)
{
    // Get the service name from the field_args, and set it to null if it doesn't exist.
    $serviceName = array_key_exists('service_name', $field_args) ? $field_args['service_name'] : null;
    // Get the instance of the service class.
    $service = MapsMappingServices::getValidServiceInstance($serviceName, 'fi');
    // Get an instance of the class handling the current form input and service.
    $formInput = $service->getFeatureInstance('fi');
    // Get and return the form input HTML from the hook corresponding with the provided service.
    return $formInput->getInputOutput($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args);
}
	/**
	 * Constructor.
	 * 
	 * @param $format String
	 * @param $inline
	 */
	public function __construct( $format, $inline ) {
		global $egMapsDefaultServices;

		$this->isMapFormat = $format == 'map';
		
		// TODO: allow service parameter to override the default
		// Note: if this is allowed, then the getParameters should only return the base parameters.
		if ( $this->isMapFormat ) $format = $egMapsDefaultServices['qp'];
		
		// Get the instance of the service class.
		$service = MapsMappingServices::getValidServiceInstance( $format, 'qp' );
		
		// Get an instance of the class handling the current query printer and service.
		$QPClass = $service->getFeature( 'qp' );	
		$this->queryPrinter = new $QPClass( $format, $inline, $service );
	}
 /**
  * Constructor.
  * 
  * @param $format String
  * @param $inline
  */
 public function __construct($format, $inline = true)
 {
     $this->service = MapsMappingServices::getValidServiceInstance($format, 'qp');
     parent::__construct($format, $inline);
 }