/*
    Грид содержит Гео-точки; демонстрирует выбранные точки на карте стандартными маркерами. 
    Наследует PhenoGrid.

*/
GeoPointGrid = newClass(PhenoGrid, {
    constructor : function(args)
    {
        this.gpArray = new GeoPointArray({map:args.map});
        this.constructor.prototype.constructor.call(this, args);
    },

    drop_selection : function()
    {
        $('input[@name="' + this.cbox_name + '"]').each( function () 
        {
            if(this.checked == true) {
                $(this).removeAttr('checked');
            }
        });
        this.gpArray.drop_all_markers();
    },

    update_grid_data : function(xml_data)
    {
        this.grid_data = new Array();
        var own = this;
        var set = [];
        jQuery("/data/clips/item", xml_data).each(function(){
            var gp = {
                name   : jQuery('name', $(this)).text(),
                lng    : jQuery('lng', $(this)).text(),
                lat    : jQuery('lat', $(this)).text(),
                id     : jQuery('id', $(this)).text()
            };
            if(gp.lng && gp.lat) {
                set[gp.id] = gp;
            }
        });
        this.gpArray.set(set);
    },

    update : function(data)
    {
        //this.drop_all_markers();
        this.update_grid_data(data);
        this.constructor.prototype.update.call(this, data);
    }

});


