OpenLayers OpenLayers

Changeset 7123

Show
Ignore:
Timestamp:
05/09/08 01:50:25 (4 months ago)
Author:
fredj
Message:

commit take an array of features not a layer as argument. fix typo

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/vector-behavior/lib/OpenLayers/Protocol/SQL/GoogleGears.js

    r7082 r7123  
    196196    /** 
    197197     * Method: commit 
    198      * Go over the features in the layer and for each take action 
     198     * Go over the features and for each take action 
    199199     * based on the feature state. Possible actions are create, 
    200200     * update and delete. 
    201201     * 
    202202     * Parameters: 
    203      * layer - {<OpenLayers.Layer.Vector>
     203     * features - {Array({<OpenLayers.Feature.Vector>})
    204204     * options - {Object} Map of options, the keys of the map are 
    205205     *           'create', 'update', and 'delete' 
    206206     */ 
    207     commit: function(layer, options) { 
     207    commit: function(features, options) { 
    208208        OpenLayers.Console.debug("GoogleGears::commit()"); 
    209209        var toCreate = [], toUpdate = []; 
    210210 
    211         for (var i = layer.features.length - 1; i >= 0; i--) { 
    212             var feature = layer.features[i]; 
     211        for (var i = features.length - 1; i >= 0; i--) { 
     212            var feature = features[i]; 
    213213            switch (feature.state) { 
    214214            case OpenLayers.State.INSERT: 
     
    227227        } 
    228228        if (toUpdate.length > 0) { 
    229             this.create(toUpdate, options.update); 
     229            this.update(toUpdate, options.update); 
    230230        } 
    231231    },