- markerCluster = new MarkerClusterer(map, markers, {zoomOnClick: false});
- google.maps.event.addListener(markerCluster, "clusterclick", function (cluster) {
- var markers = cluster.getMarkers();
- var bounds = new google.maps.LatLngBounds();
- /*
- * date: 24/05/2012
- * author: lbaron
- * Firefox JS Error - replaced $.each by JQuery.each
- */
- jQuery.each(markers, function(i, marker){
- bounds.extend(marker.getPosition());
+ }
+
+
+ this.set_checkbox = function(record)
+ {
+ // XXX urn should be replaced by the key
+ // XXX we should enforce that both queries have the same key !!
+ //checkbox_id = "#hazelnut-checkbox-" + object.options.plugin_uuid + "-" + unfold.escape_id(record[ELEMENT_KEY].replace(/\\/g, ''))
+ //$(checkbox_id, object.table.fnGetNodes()).attr('checked', true);
+ }
+
+ this.record_handler = function(e, event_type, record)
+ {
+ // elements in set
+ switch(event_type) {
+ case NEW_RECORD:
+ /* NOTE in fact we are doing a join here */
+ if (object.received_all)
+ // update checkbox for record
+ object.set_checkbox(record);
+ else
+ // store for later update of checkboxes
+ object.in_set_buffer.push(record);
+ break;
+ case CLEAR_RECORDS:
+ // nothing to do here
+ break;
+ case IN_PROGRESS:
+ manifold.spin($(this));
+ break;
+ case DONE:
+ if (object.received_all)
+ manifold.spin($(this), false);
+ object.received_set = true;
+ break;
+ }
+ };
+
+ this.record_handler_all = function(e, event_type, record)
+ {
+ // all elements
+ switch(event_type) {
+ case NEW_RECORD:
+ // Add the record to the table
+ object.new_record(record);
+ break;
+ case CLEAR_RECORDS:
+ // object.table.fnClearTable();
+ break;
+ case IN_PROGRESS:
+ manifold.spin($(this));
+ break;
+ case DONE:
+
+ // MarkerClusterer
+ object.markerCluster = new MarkerClusterer(object.map, object.markers, {zoomOnClick: false});
+ google.maps.event.addListener(object.markerCluster, "clusterclick", function (cluster) {
+ var markers = cluster.getMarkers();
+ var bounds = new google.maps.LatLngBounds();
+ /*
+ * date: 24/05/2012
+ * author: lbaron
+ * Firefox JS Error - replaced $.each by JQuery.each
+ */
+ jQuery.each(markers, function(i, marker){
+ bounds.extend(marker.getPosition());
+ });
+
+ //map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
+ object.map.fitBounds(bounds);