Changeset 7103
- Timestamp:
- 05/08/08 10:27:29 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/camptocamp/unhcr/lib/OpenLayers/Protocol/SQL/GoogleGears.js
r7096 r7103 35 35 this.db.open(this.databaseName); 36 36 this.db.execute("CREATE TABLE IF NOT EXISTS " + this.tableName + 37 " (fid TEXT UNIQUE, geometry TEXT, properties TEXT)"); 37 " (fid TEXT UNIQUE, geometry TEXT, properties TEXT," + 38 " state TEXT)"); 38 39 39 40 this.db.execute("CREATE INDEX IF NOT EXISTS fid_idx ON " + … … 75 76 return [feature.fid, 76 77 feature.geometry.toString(), 77 this.jsonFormat.write(feature.attributes)]; 78 this.jsonFormat.write(feature.attributes), 79 feature.state]; 78 80 }, 79 81 … … 91 93 feature.attributes = this.jsonFormat.read(row.fieldByName('properties')); 92 94 feature.fid = row.fieldByName('fid'); 95 feature.state = row.fieldByName('state'); 93 96 94 97 return feature; … … 135 138 for (var i = 0; i < toCreate.length; i++) { 136 139 var feature = toCreate[i]; 137 this.db.execute("REPLACE INTO " + this.tableName + " (fid, geometry, properties) VALUES (?, ?, ?)", 140 this.db.execute("REPLACE INTO " + this.tableName + 141 " (fid, geometry, properties, state) " + 142 "VALUES (?, ?, ?, ?)", 138 143 this.freezeFeature(feature)); 139 144 createdFeatures.push(feature.clone()); … … 168 173 for (var i = 0; i < toUpdate.length; i++) { 169 174 var feature = toUpdate[i]; 170 this.db.execute("REPLACE INTO " + this.tableName + " (fid, geometry, properties) VALUES (?, ?, ?)", 175 this.db.execute("REPLACE INTO " + this.tableName + 176 " (fid, geometry, properties, state) " + 177 "VALUES (?, ?, ?, ?)", 171 178 this.freezeFeature(feature)); 172 179 updatedFeatures.push(feature.clone());
