[OpenLayers-Dev] ImgPath and theme

Tim Schaub tschaub at opengeo.org
Tue Oct 6 14:30:51 EDT 2009


Jochen Topf wrote:
> Hi!
> 
> If you want to create a different theme for OpenLayers there are two things
> you need to handle:
> * Some images are found through the setting in OpenLayers.ImgPath
> * Some images and styles are found through the theme mechanism (setting theme
>   option on map object)
> 
> Is there a reason those cases are handled differently? Wouldn't it make
> sense to put all the images in one directory and find them through the
> theme mechanism?
> 

I agree this would make sense.

What you see reflects the history of the project.  At some point, we 
started using CSS to style the elements that OL creates.  Before that 
point, all style declarations were coded in the JavaScript.

Roughly speaking, things that have not been updated are found under the 
OpenLayers.ImgPath.  Even if everything was moved to CSS, we'd likely 
still need a path to (at least) a single pixel transparent image to keep 
IE happy.

If you find code that is still using inline style declarations (plenty) 
and would like to help update the library, please create tickets with 
patches.

http://trac.openlayers.org/wiki/HowToContribute

Thanks,
Tim

> Jochen


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list