Because it otherwise fails when using /drupal/sites/mysites/...
But the proper way to do this would be to use the libraries module.

See the attached patch (which has not been really tested).
Then it should be possible to get rid of
/themes/default_dark/openlayers_style.css and some stuff in openlayers.install.

CommentFileSizeAuthor
openlayers-implements-libraries0.patch875 bytesdrzraf

Comments

nod_’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Category: bug » feature
Priority: Minor » Normal

That's awesome, it's actually a 3.x goal.

Could you work out how to use the new libraries API? they have version dependencies and it'd be nice to enforce that.

nod_’s picture

Status: Active » Needs work

since it hasn't been tested.

drzraf’s picture

do you mean to enforce the use of OL 2.11 over OL 2.10 ?

nod_’s picture

indeed.

drzraf’s picture

I was not able to find how to do this.
There are several non-API alternative, using hook_requirements() or library_detect().

On a side note a solution must be given for the css includes/background imports in order to unbundle all the files in themes/default_dark/img/.
Another point I tried to figure out is where exactly are the .js and .css files needed in the module, so we can see where exactly the call to libraries_load("openlayers"); should happen.

(also forgot to say that dependencies[] = libraries will obviously be needed in the .info file).

drzraf’s picture

Issue summary: View changes

typos

m.stenta’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)

I think this is fixed. Openlayers uses Libraries API now (and can also use Libraries CDN to load via CDNJS/JSDelivr). Reopen if anything else needs to be done!