[OpenLayers-Users] OpenLayers in Rails

Arnd Wippermann arnd.wippermann at web.de
Thu Oct 11 14:19:12 EDT 2007


Hello Christopher,

Setting OpenLayers.Util.ImgPath = ... has no effect.

If you look at this, I would think there is "Util." missing:

OpenLayers.Util.getImagesLocation =
function () {
    return OpenLayers.ImgPath || OpenLayers._getScriptLocation() + "img/";
} 

Setting OpenLayers.ImgPath = ... works.

Is there possibly a variable to set the path to the theme-dir as well?

Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/



-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Christopher Schmidt
Gesendet: Donnerstag, 11. Oktober 2007 13:49
An: staff-gmail
Cc: users at openlayers.org
Betreff: Re: [OpenLayers-Users] OpenLayers in Rails

On Wed, Oct 10, 2007 at 11:55:04PM -0600, staff-gmail wrote:
> angus scown wrote:
> > staff-gmail wrote:
> >> The control icons are not showing up in Rails - I have 
> >> OpenLayers.js from the build directory in the Rails javascripts 
> >> folder  and put the /img and /theme also within the javascripts 
> >> folder but they are not being accessed correctly.  The control 
> >> buttons seem to work okay - but the images don't show.  Anyone work
around this ?
> >> _______________________________________________
> >> Users mailing list
> >> Users at openlayers.org
> >> http://openlayers.org/mailman/listinfo/users
> >>
> >>   
> > if you don't want to modify the openlayers javascript then you need 
> > to place the /img folder in a folder with the controller name under 
> > the public directory.
> >
> > i.e. /public/some-controller-name/img e.g /public/jobs/img
> >
> 
> Michael Quentel wrote:
>  >
>  > Try modifying the image path in Utils.js to what the Rails 
> application  > would use for the img and theme directories.
>  >
> 
> thks - yeah, I saw that about the controller location.   Problem is if 
> you use the map in more than 1 view, then you have the same image 
> folders in multiple locations, not good though a hackable solution.   So 
> it would be better to modify the Utils.js

Util.js provides the functionality to override the base image path, via the
OpenLayers.Util.ImgPath constant
(http://dev.openlayers.org/docs/files/OpenLayers/Util-js.html#Util.ImgPath
, not well enough documented).

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list