Ticket #2982 (closed bug: fixed)

Opened 2 years ago

Last modified 15 months ago

Document that the script name MUST be OpenLayers.js, or ImgPath must be set

Reported by: slinkp Owned by:
Priority: minor Milestone: 2.12 Release
Component: documentation Version: SVN
Keywords: Cc:
State:

Description

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

Change History

Changed 15 months ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.