// ------------------------------------------------
// MapsWrapper script
// Обертка для различных картографических движков.
// ------------------------------------------------

MapsWrapper.current_engine;

/**
 *  @constructor
 *  Основной класс
 */
function MapsWrapper(engine) {
    MapsWrapper.current_engine = engine;
    return MapsWrapper;
}

MapsWrapper.Map = function(element, options) {
    return new MapsWrapper.current_engine.Map(element, options);
}

MapsWrapper.Layer = function() {
    return new MapsWrapper.current_engine.Layer();
}

MapsWrapper.Marker = function(coords, options) {
    return new MapsWrapper.current_engine.Marker(coords, options);
}

MapsWrapper.InfoWindow = function() {
    return new MapsWrapper.current_engine.InfoWindow();
}

MapsWrapper.Icon = function(source, width, height) {
    return new MapsWrapper.current_engine.Icon(source, width, height);
}

MapsWrapper.Route = function(map, coords, callback) {
    return new MapsWrapper.current_engine.Route(map, coords, callback);
}

MapsWrapper.Events = function() { return this; }

MapsWrapper.Events.addListener = function(object, event, handler) {
    return MapsWrapper.current_engine.Events.addListener(object, event, handler);
}

MapsWrapper.Events.removeListener = function(object, handler) {
    return MapsWrapper.current_engine.Events.removeListener(object, handler);
}


/**
 *  @constructor
 */
MapsWrapper.GeoObject = function(options) {
    this._options = (options) ? options : {};
    
    return this;
}

MapsWrapper.GeoObject.prototype._object;
MapsWrapper.GeoObject.prototype._options;

MapsWrapper.GeoObject.prototype.object = function() { return this._object; }
MapsWrapper.GeoObject.prototype.options = function() { return this._options; }


/**
 *  @constructor
 */
MapsWrapper.GeoCoder = function() {
    return new MapsWrapper.current_engine.GeoCoder;
}

