[OpenLayers-Trac] Re: [OpenLayers] #2947: allow custom jsfiles array

OpenLayers trac-20090302 at openlayers.org
Sat Jan 1 14:02:46 EST 2011


#2947: allow custom jsfiles array
---------------------+------------------------------------------------------
 Reporter:  erilem   |       Owner:              
     Type:  feature  |      Status:  new         
 Priority:  minor    |   Milestone:  2.11 Release
Component:  general  |     Version:  2.10        
 Keywords:           |       State:  Review      
---------------------+------------------------------------------------------

Comment(by tschaub):

 I think what you're proposing with the "noautoload" parameter would be
 most trivially accomplished by loading the SingleFile.js instead of
 OpenLayers.js (see r10977).

 The only hassle with this is typing all the extra script tags.  I think
 the tidiest way to avoid this hassle is to allow typing an array instead.

 Here are a few variations that accomplish the same:
 {{{
 <script>
     var OpenLayers = ["OpenLayers/Util.js", "OpenLayers/foo.js"];
 </script>
 <script src="lib/OpenLayers.js"></script>
 }}}
 or
 {{{
 <script src="lib/OpenLayers.js">
     // here the OpenLayers.js script can eval the innerHTML
     // of the last script in the doc
     var OpenLayers = ["OpenLayers/Util.js", "OpenLayers/foo.js];
 </script>
 }}}
 or
 {{{
 <!-- here OpenLayers.js splits and trims the innerHTML to get the file
 list -->
 <script src="lib/OpenLayers.js">
     OpenLayers/Util.js
     OpenLayers/foo.js
 </script>
 }}}
 or
 {{{
 <script
 src="lib/OpenLayers.js?files=OpenLayers%2FUtil.js,OpenLayers%2Ffoo.js"></script>
 }}}

 I think we'd agree this last one is ugly to type.  The first is simplest
 to implement.  The others are somewhat forced.  And the whole thing is
 really just for us internally (tests and examples) - I don't think we
 should try to get too clever.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2947#comment:8>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list