[OpenLayers-Trac] Re: [OpenLayers] #3060: SingleFile.js - Improvement of RegExp in _getScriptLocation function

OpenLayers trac-20090302 at openlayers.org
Fri Feb 25 15:09:41 EST 2011

#3060: SingleFile.js - Improvement of RegExp in _getScriptLocation function
  Reporter:  neumann  |       Owner:              
      Type:  feature  |      Status:  closed      
  Priority:  minor    |   Milestone:  2.11 Release
 Component:  general  |     Version:  2.10        
Resolution:  wontfix  |    Keywords:              
     State:           |  
Changes (by crschmidt):

  * status:  new => closed
  * resolution:  => wontfix


 There are only two pieces of code which depend on scriptLocation. These

  1. OpenLayers.ImgPath
  2. Automatic addition of themes to the DOM.

 The latter is not the ideal way to include themes in your page: You should
 instead set the theme: null option on your map, and include the CSS
 manually, like:

   <link rel="stylesheet" href="theme/default/style.css" type="text/css" />

 (This is highly recommended for all applications.)

 For the former problem (OpenLayers.ImgPath), you can set
 OpenLayers.ImgPath = "/my/path/to/images/", pointing to a directory which
 contains the contents of the OpenLayers 'img' directory.

 Rather than adding a new hack for every potential naming scheme that comes
 long, I highly recommend using these two methods to cause your script to
 not care about whether getScriptLocation is correct or not. As an
 alternative, you can modify the _getScriptLocation function:

   OpenLayers._getScriptLocation() { return "/my/path/"; }

 But I do not recommend this over the previous option.

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

More information about the Trac mailing list