2011-05-19 15:16:56 +00:00
|
|
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
2011-06-01 21:45:22 +00:00
|
|
|
var ScinodePolygon = CirclePolygon.extend({
|
2011-05-19 15:16:56 +00:00
|
|
|
init: function(options) {
|
|
|
|
this._super(options);
|
2011-06-01 21:45:22 +00:00
|
|
|
this.hide();
|
2011-05-19 15:16:56 +00:00
|
|
|
},
|
|
|
|
setValue: function(value) {
|
2011-06-03 21:45:47 +00:00
|
|
|
this.polygon.value = value;
|
2011-05-19 15:16:56 +00:00
|
|
|
},
|
|
|
|
getValue: function() {
|
2011-06-03 21:45:47 +00:00
|
|
|
return this.polygon.value;
|
2011-05-19 15:16:56 +00:00
|
|
|
},
|
|
|
|
setSize: function(size) {
|
2011-06-01 21:45:22 +00:00
|
|
|
this.setRadius(size);
|
2011-05-19 15:16:56 +00:00
|
|
|
this.setZIndex(-size);
|
2011-05-26 23:31:39 +00:00
|
|
|
},
|
|
|
|
focus: function() {
|
2011-06-01 21:45:22 +00:00
|
|
|
this.setOptions({strokeWeight: 3.0});
|
2011-05-26 23:31:39 +00:00
|
|
|
},
|
|
|
|
unfocus: function() {
|
|
|
|
this.setOptions({strokeWeight: 1.0});
|
|
|
|
},
|
2011-06-03 21:45:47 +00:00
|
|
|
setContent: function(content) {
|
|
|
|
this.polygon.content = content;
|
|
|
|
},
|
2011-05-26 23:31:39 +00:00
|
|
|
registerEvents : function() {
|
|
|
|
var me = this;
|
|
|
|
var polygon = me.polygon;
|
2011-06-01 21:45:22 +00:00
|
|
|
this._super();
|
2011-05-26 23:31:39 +00:00
|
|
|
this.registerEvent(addClickListener(polygon, function() {
|
|
|
|
INFO_WINDOW.setPosition(this.center);
|
2011-06-03 21:45:47 +00:00
|
|
|
var content = this.content;
|
2011-05-26 23:31:39 +00:00
|
|
|
INFO_WINDOW.setContent(content);
|
|
|
|
INFO_WINDOW.open(this.map);
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.registerEvent(addMouseOverListener(polygon, function() {
|
|
|
|
me.focus();
|
|
|
|
}));
|
|
|
|
|
|
|
|
this.registerEvent(addMouseOutListener(polygon, function() {
|
|
|
|
me.unfocus();
|
|
|
|
}));
|
2011-05-19 15:16:56 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
function createScinodeMarker(map, label, value, radius, color, latlng) {
|
|
|
|
var circleOptions = {
|
|
|
|
label: label,
|
|
|
|
value: value,
|
|
|
|
strokeColor: color,
|
|
|
|
strokeOpacity: 1.0,
|
|
|
|
strokeWeight: 1.0,
|
|
|
|
fillColor: color,
|
|
|
|
fillOpacity: 0.25,
|
|
|
|
map: map,
|
|
|
|
center: latlng,
|
|
|
|
zIndex: -radius,
|
|
|
|
radius: radius // min: 10000, max: 2500000
|
|
|
|
};
|
|
|
|
|
|
|
|
return new ScinodePolygon(circleOptions);
|
|
|
|
}
|
|
|
|
|