vivo/productMods/js/visualization/mapofscience/Marker.js
kongchinhua 815ef7f26e Support discipline labels
Support display order for the Scimap circles
Support custom tooltip
Add % information on click action
Add info text
Add numerical information for mapped, total publications
Set default map view to 554 Sub-Discipline
Enable labels by default
2011-06-03 21:45:47 +00:00

56 lines
1.3 KiB
JavaScript

/* $This file is distributed under the terms of the license in /doc/license.txt$ */
/**
* Marker Object for that hold external information - data. Please refer to the
* Google.map.MakerOptions for options' details
*/
var Marker = Class.extend({
init : function(options) {
this.options = $.extend({}, this.options, options);
this.marker = createGoogleMarker(this.options);
this.hide();
this.registerEvents();
},
options : {
value : 0,
map : null,
icon : null,
position : null,
content : null
},
addToMap : function() {
this.marker.setMap(this.options.map);
this.registerEvents();
},
removeFromMap : function() {
this.marker.setMap(null);
this.unregisterEvents();
},
show : function() {
this.marker.setVisible(true);
},
hide : function() {
this.marker.setVisible(false);
},
setIcon : function(icon) {
this.marker.setIcon(icon);
},
setZIndex: function(zIndex){
this.marker.setZIndex(zIndex);
},
setTitle : function(title) {
this.marker.title = title;
},
registerEvents : function() {
var handlers = new Array();
var marker = this.marker;
handlers.push(addClickListener(marker, function() {
updateIFrame(this.url);
}));
this.handlers = handlers;
},
unregisterEvents : function() {
removeListeners(this.handlers);
this.handlers = null;
}
});