"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExternalLayerFactoryRegistry = void 0;
/**
 * Defines a registry of custom vector layer source drivers
 */
var ExternalLayerFactoryRegistry = /** @class */ (function () {
    function ExternalLayerFactoryRegistry() {
        this._vectorCreators = {};
        if (ExternalLayerFactoryRegistry._instance) {
            throw new Error("Error: Instantiation failed: Use ExternalLayerFactoryRegistry.getInstance() instead of new.");
        }
        ExternalLayerFactoryRegistry._instance = this;
    }
    /**
     * Gets the registry instance
     * @since 0.14
     */
    ExternalLayerFactoryRegistry.getInstance = function () {
        return ExternalLayerFactoryRegistry._instance;
    };
    /**
     * Registers the given external vector layer factory method
     *
     * @param driverName
     * @param creator
     * @since 0.14
     */
    ExternalLayerFactoryRegistry.prototype.registerExternalVectorLayerCreator = function (driverName, creator) {
        this._vectorCreators[driverName] = creator;
    };
    /**
     * Gets the external vector layer factory method for the given driver
     *
     * @param driverName
     */
    ExternalLayerFactoryRegistry.prototype.getExternalVectorLayerCreator = function (driverName) {
        return this._vectorCreators[driverName];
    };
    ExternalLayerFactoryRegistry._instance = new ExternalLayerFactoryRegistry();
    return ExternalLayerFactoryRegistry;
}());
exports.ExternalLayerFactoryRegistry = ExternalLayerFactoryRegistry;
//# sourceMappingURL=external-layer.js.map