The version number of the library doesnt doesnt get detected due to
1. the new structure of placing the library variants in sites/all/libraries/openlayers3
2. the new release download files dont contain the version number.

Please check suggested changes in the patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alansaviolobo created an issue. See original summary.

ken-g’s picture

Status: Active » Needs review

Hi Alan,

Thanks for your suggested changes. They all look fine to me, so I have committed them to 7.x-3.x-dev.

For the record, and for anyone else reading this, when I took over as the maintainer for this module recently, it had been around 5 years since any work had been done on it. In that time, the Openlayers library itself had gone through 4 major versions and multiple minor versions - 3.11.2 to 6.14.1. As that is quite big step for any existing user of the module to take in one leap, I decided on a strategy of allowing multiple local versions of the OL library to be held, and people could easily switch between the local versions as they tried to catch up with the latest OL library.

Also, as far as I am aware, it is not possible to determine the version number of later releases of the OL library from the library itself. Therefore, when the OL library is being downloaded (currently only in 7.x-3.x-dev) it should be placed in a folder of the following structure where the two main OL files are located:

/sites/all/libraries/openlayers3/versions/v3.11.2/build/ol.js and /sites/all/libraries/openlayers3/versions/v3.11.2/css/ol.css

Or for the very latest version:

/sites/all/libraries/openlayers3/versions/v6.14.1/build/ol.js and /sites/all/libraries/openlayers3/versions/v6.14.1/css/ol.css

NB. I still need to document this change somewhere in the documentation for the module.

ken-g’s picture

I have just documented (module documentation) the new facility that allows multiple local versions of the Openlayers library. Comments welcome...

alansaviolobo’s picture

FileSize
4.84 KB

Hi Ken,

on further analysis, I found some more issues with the version detection. PFA patch for the same.

ken-g’s picture

Thanks for your additional patch. I reviewed it, and could follow what you are doing. However, when I applied your patch to my local system, the ol.js and ol.css files wouldn't load and all my maps disappeared.

I think you deleted a couple of lines that were important for the loading of the OL library, so before committing your patch, I re-instated the following lines of code in openlayers.module:

unset($libraries['openlayers3']['library path']);
$libraries['openlayers3']['variants'] = $local_variants;

Everything seem to work well after that.

ken-g’s picture

Status: Needs review » Fixed

Fixed in 7.x-3.2 release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.