[Trac] [OpenLayers] #336: create OpenLayers.Layer.Graphic to layers created with simple static images

OpenLayers trac at openlayers.org
Tue Oct 24 22:10:16 EDT 2006


#336: create OpenLayers.Layer.Graphic to layers created with simple static images
----------------------+-----------------------------------------------------
  Reporter:  tschaub  |       Owner:             
      Type:  feature  |      Status:  new        
  Priority:  minor    |   Milestone:  2.2 Release
 Component:  general  |     Version:             
Resolution:           |    Keywords:  review     
----------------------+-----------------------------------------------------
Comment (by euzuro):

 Finally, I have to say that I don't quite understand the following snippet
 of code:

 {{{
         // If nothing to do with resolutions has been set, assume a single
         //  resolution determined by extent/size
         if(this.shouldCalcResolutions()) {
             this.options.resolutions = [this.extent.getWidth() /
 this.size.w];
         }
 }}}

 which calls this function:
 {{{
     /**
      * This is a bad method to have here.  It would be nicer to be able
      * to ask Layer directly.
      */
     shouldCalcResolutions: function() {
         var props = new Array(
             'scales', 'resolutions',
             'maxScale', 'minScale',
             'maxResolution', 'minResolution',
             'minExtent', 'maxExtent',
             'numZoomLevels', 'maxZoomLevel'
         );
         for(var i=0; i < props.length; i++) {
             var property = props[i];
             if(this.options[property] != null) {
                 return false;
             }
         }
         return true;
     },
 }}}


 do we really need this? I dont quite understand what it does... but I
 tried removing it and did some basic tests and everything seemed to work
 ok. There is probably something that I am not understanding, though, so
 please, someone speak up. I am all ears.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/336>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list