- var googlemap = this;
- if (this.received_set) {
- /* ... and check the ones specified in the resource list */
- $.each(this.in_set_backlog, function(i, record) {
- googlemap.set_checkbox_from_record(record, true);
- });
- // reset
- googlemap.in_set_backlog = [];
- this.unspin();
+
+ /* Set checkbox and background color */
+ $.each(record_keys, function(i, record_key) {
+ var state = manifold.query_store.get_record_state(self.options.query_uuid, record_key, STATE_SET);
+ var warnings = manifold.query_store.get_record_state(self.options.query_uuid, record_key, STATE_WARNINGS);
+ switch(state) {
+ // XXX The row and checkbox still does not exists !!!!
+ case STATE_SET_IN:
+ case STATE_SET_IN_SUCCESS:
+ case STATE_SET_OUT_FAILURE:
+ self.set_checkbox_from_record_key(record_key, true);
+ break;
+ case STATE_SET_OUT:
+ case STATE_SET_OUT_SUCCESS:
+ case STATE_SET_IN_FAILURE:
+ break;
+ case STATE_SET_IN_PENDING:
+ self.set_checkbox_from_record_key(record_key, true);
+ self.set_bgcolor(record_key, GOOGLEMAP_BGCOLOR_ADDED);
+ break;
+ case STATE_SET_OUT_PENDING:
+ self.set_bgcolor(record_key, GOOGLEMAP_BGCOLOR_REMOVED);
+ break;
+ }
+ self.change_status(record_key, warnings); // XXX will retrieve status again
+ });
+ },
+
+ /**************************************************************************
+ * QUERY HANDLERS
+ **************************************************************************/
+
+ on_filter_added: function(filter)
+ {
+ this.filter_map();
+ },
+
+ on_filter_removed: function(filter)
+ {
+ this.filter_map();
+ },
+
+ on_filter_clear: function()
+ {
+ this.filter_map();
+ },
+
+ on_query_in_progress: function()
+ {
+ this.spin();
+ },
+
+ on_query_done: function()
+ {
+ this.redraw_map();
+ this.unspin();
+ },
+
+ on_field_state_changed: function(data)
+ {
+ switch(data.request) {
+ case FIELD_REQUEST_ADD:
+ case FIELD_REQUEST_ADD_RESET:
+ this.set_checkbox_from_data(data.value, true);
+ break;
+ case FIELD_REQUEST_REMOVE:
+ case FIELD_REQUEST_REMOVE_RESET:
+ this.set_checkbox_from_data(data.value, false);
+ break;
+ default:
+ break;