[OpenLayers-Trac] [OpenLayers] #2976: Rico.Color.js: Error as a result of an undefined function

OpenLayers trac-20090302 at openlayers.org
Sun Dec 12 13:13:39 EST 2010


#2976: Rico.Color.js: Error as a result of an undefined function
---------------------+------------------------------------------------------
 Reporter:  jorix    |       Owner:              
     Type:  bug      |      Status:  new         
 Priority:  minor    |   Milestone:  2.11 Release
Component:  general  |     Version:  2.10        
 Keywords:           |       State:              
---------------------+------------------------------------------------------
 {{{RicoUtil.getElementsComputedStyle}}} used in
 {{{OpenLayers.Rico.Color.createColorFromBackground}}} is not defined!

 Try:

 {{{
 <div id="divTransparent">A</div>
 <script>
   var bColor = OpenLayers.RicoUtil.getElementsComputedStyle(
     OpenLayers.Util.getElement("divTransparent"),
     "backgroundColor",
     "background-color"
   );
 </script>
 }}}

 In the patch I put this function from the Rico trunk translated into
 OpenLayers.

 Closure Compiler reports this error.

 ----

 The bug was introduced in [70]!

 The function {{{OpenLayers.Rico.Color.createColorFromBackground}}} is only
 used once into Rico/Corner.js but wrapped in a "try", and in the
 catch(err) gives "#ffffff"[[BR]]
 So another solution is remove the function and always return "#ffffff"

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


More information about the Trac mailing list