[OpenLayers-Trac] [OpenLayers] #2982: Document that the script name MUST be OpenLayers.js, or ImgPath must be set

OpenLayers trac-20090302 at openlayers.org
Thu Dec 16 16:59:00 EST 2010


#2982: Document that the script name MUST be OpenLayers.js, or ImgPath must be set
---------------------------+------------------------------------------------
 Reporter:  slinkp         |       Owner:              
     Type:  bug            |      Status:  new         
 Priority:  minor          |   Milestone:  2.11 Release
Component:  documentation  |     Version:  SVN         
 Keywords:                 |       State:              
---------------------------+------------------------------------------------
 I wanted to make a single-file build of the trunk and name it after the
 revision number, eg. OpenLayers-r12345.js.

 Everything seemed to work except that my control images went 404.

 It took me quite a long time to solve this. Poking around the source and
 searching for related bugs, I eventually figured out how it works - the
 default is to use _getScriptLocation()  and find an img/ directory
 relative to that, but _getScriptLocation() assumes that the script name is
 exactly OpenLayers.js.

 That's fine, especially because there's a feature tailor-made for  this
 case - you can set OpenLayers.ImgPath - but I'm not sure if or where this
 is documented.
 http://docs.openlayers.org/search.html?q=OpenLayers.ImgPath&check_keywords=yes&area=default
 turns up nothing.

 Suggestion: add text to http://docs.openlayers.org/library/deploying.html
 something along the lines of:

 "If you name your build anything other than OpenLayers.js, note that
 OpenLayers will not be able to automatically find the img/ or theme/
 directories. In this case, you should set OpenLayers.ImgPath to the
 relative base URI at which the img/ directory will be served. You should
 probably also include style.css in your html explicitly."

 Related wontfix bug: #1932

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


More information about the Trac mailing list