first commit

This commit is contained in:
2024-05-23 15:34:45 +08:00
commit 57ef9aedd2
655 changed files with 96823 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
var _ = require('underscore');
var Backbone = require('backbone');
/**
* Base style object.
*
* @fires error
* @constructor
* @abstract
* @memberof carto.style
* @api
*/
function Base () {}
_.extend(Base.prototype, Backbone.Events);
Base.prototype.$setError = function (cartoError) {
this._error = cartoError;
this.trigger('error', cartoError);
};
Base.prototype.$setEngine = function (newEngine) {
if (this._engine && this._engine !== newEngine) {
throw new Error('CartoCSS engine cannot be changed');
}
this._engine = newEngine;
};
Base.prototype.$getEngine = function () {
return this._engine;
};
module.exports = Base;