/tmp/openlayers/tools/OpenLayers-2.13.1/lib/OpenLayers/SingleFile.js - OpenLayers

# SingleFile.js

Summary

SingleFile.js |
Constants |
VERSION_NUMBER |
singleFile | TODO: remove this in 3.0 when we stop supporting build profiles that include OpenLayers.js
Functions |
_getScriptLocation | Return the path to this script.
Properties |
ImgPath | {String} Set this to the path where control images are stored, a path given here must end with a slash.

### Constants

### VERSION_NUMBER

### singleFile

TODO: remove this in 3.0 when we stop supporting build profiles that include OpenLayers.js

### Functions

### _getScriptLocation

Return the path to this script. This is also implemented in OpenLayers.js

#### Returns

{String} Path to this script

### Properties

### ImgPath

{String} Set this to the path where control images are stored, a path given here must end with a slash. If set to ‘’ (which is the default) OpenLayers will use its script location + “img/”.

You will need to set this property when you have a singlefile build of OpenLayers that either is not named “OpenLayers.js” or if you move the file in a way such that the image directory cannot be derived from the script location.

If your custom OpenLayers build is named “my-custom-ol.js” and the images of OpenLayers are in a folder “/resources/external/images/ol” a correct way of including OpenLayers in your HTML would be:

>     <script src="/path/to/my-custom-ol.js" type="text/javascript"></script>
>     <script type="text/javascript">
>        // tell OpenLayers where the control images are
>        // remember the trailing slash
>        OpenLayers.ImgPath = "/resources/external/images/ol/";
>     </script>

Please remember that when your OpenLayers script is not named “OpenLayers.js” you will have to make sure that the default theme is loaded into the page by including an appropriate <link>-tag, e.g.:

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

Close