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"
 
});

 

posted @ 2016-08-25 19:02  星火spark  阅读(1900)  评论(0编辑  收藏  举报