Openlayers 自定义控件
OpenLayers.Control.YourControl = OpenLayers.Class(OpenLayers.Control, { // may private properties here ... initialize: function(options) { OpenLayers.Control.prototype.initialize.apply(this, arguments); // initialize private settings here ... }, draw: function() { OpenLayers.Control.prototype.draw.apply(this); // add private elements here ... return this.div; }, destroy: function() { // delete private elements here ... OpenLayers.Control.prototype.destroy.apply(this); }, // may event handlers here ... CLASS_NAME: "OpenLayers.Control.YourControl" });