- });
- return {marker:marker, ul:ul};
- },
-
- // add an entry in the marker <ul> tag for that record
- // returns { checkbox : <input DOM> }
- create_record_checkbox: function (record,ul,checked) {
- var checkbox = $("<input>", {type:'checkbox', checked:checked, class:'geo'});
- var hrn=this.record_hrn(record);
- ul.append($("<li>").addClass("geo").append(checkbox).
- append($("<span>").addClass("geo").append(hrn)));
- var googlemap=this;
- // the callback for when a user clicks
- // NOTE: this will *not* be called for changes done by program
- checkbox.change( function (e) {
- if (googlemap_debug) messages.debug("googlemap click handler checked= " + this.checked + " hrn=" + hrn);
- manifold.raise_event (googlemap.options.query_uuid,
- this.checked ? SET_ADD : SET_REMOVED, hrn);
- });
- return checkbox;
- },
-
- // retrieve DOM checkbox and make sure it is checked/unchecked
- set_checkbox: function(record, checked) {
- var hrn=this.record_hrn (record);
- if (! hrn) {
- try {messages.warning ("googlemap.set_checkbox: record has no hrn -- hostname="+record.hostname); }
- catch (err) {messages.warning ("googlemap.set_checkbox: record has no hrn"); }
- return;
- }
- var checkbox_s = this.by_hrn [ hrn ];
- if (! checkbox_s ) { messages.warning ("googlemap.set_checkbox: could not spot checkbox for hrn "+hrn); return; }
- checkbox_s.checkbox.prop('checked',checked);
- }, // set_checkbox
-
- // this record is *in* the slice
+ });
+ //extend the bounds to include each marker's position
+ this.bounds.extend(marker.position);
+ return {marker:marker, ul:ul};
+ },
+
+ // given an input <ul> element, this method inserts a <li> with embedded checkbox
+ // for displaying/selecting the resource corresponding to the input record
+ // returns the created <input> element for further checkbox manipulation
+ create_record_checkbox: function (record,ul,checked) {
+ var checkbox = $("<input>", {type:'checkbox', checked:checked, class:'geo'});
+ var id=this.record_id(record);
+ // use hrn as far as possible for displaying
+ // var label= ('hrn' in record) ? record.hrn : id;
+ var label= (this.key in record) ? record[this.key] : id;
+ ul.append($("<li>").addClass("geo").append(checkbox).
+ append($("<span>").addClass("geo").append(label)));
+ var googlemap=this;
+ // the callback for when a user clicks
+ // NOTE: this will *not* be called for changes done by program
+ checkbox.change( function (e) {
+ manifold.raise_event (googlemap.options.query_uuid, this.checked ? SET_ADD : SET_REMOVED, id);
+ });
+ return checkbox;
+ },
+
+ warning: function (record,message) {
+ try {messages.warning (message+" -- "+this.key+"="+record[this.key]); }
+ catch (err) {messages.warning (message); }
+ },
+
+ // retrieve DOM checkbox and make sure it is checked/unchecked
+ set_checkbox: function(record, checked) {
+ var id=this.record_id (record);
+ if (! id) {
+ this.warning (record, "googlemap.set_checkbox: record has no id");
+ return;
+ }
+ var checkbox = this.by_id [ id ];
+ if (! checkbox ) {
+ this.warning (record, "googlemap.set_checkbox: checkbox not found");
+ return;
+ }
+ checkbox.prop('checked',checked);
+ }, // set_checkbox
+
+ // this record is *in* the slice