An openlayers map built using views (points displayed on a Google baselayer) is outputting this js error and not displaying the map:
TypeError: Object 900913 has no method 'getUnits'
[....]/sites/all/modules/contrib/openlayers/js/openlayers.js
(Chrome 6.0.472.53 on Mac)
There's a similar error output by Firefox, though it points to the hosted OpenLayers.js file instead:
"this.projection.getUnits is not a function"
"TypError"
"http://openlayers.org/api/OpenLayers.js"
I'm assuming that this relates to OpenLayers.org releasing a new version of openlayers.js (2.10) sometime in the last 24 hrs. @Ziggy1 reported the same error in IRC, which was fixed by downloading the previous version of openlayers.js and pointing to it locally instead of pointing to the hosted version on openlayers.com.
Marking as critical because anyone downloading the module and using it in the default configuration (i.e. pointing to the hosted version of openlayers.js) would not be able to have a map displayed. Feel free to change the status if you don't think it's critical though.
Comments
Comment #1
tom_o_t commented@strk has just fixed this in dev - http://drupal.org/cvs?commit=418666
If you don't want to update to dev, you can fix this by going to /admin/build/openlayers and setting the OpenLayers source to be http://openlayers.org/api/2.9/OpenLayers.js
A better fix is to download this file and add it to your Drupal installation, and use a relative path for the source (like sites/all/modules/contrib/openlayers/OpenLayers-2.9/OpenLayers.js)
Comment #2
levelos commentedThis doesn't unfortunately fix existing installs. Probably need a hook_update_N() hook to update the variable if it's still set to http://openlayers.org/api/OpenLayers.js.
Comment #3
zzolo commentedThanks @loubabe. Created update function:
http://drupal.org/cvs?commit=419920
Comment #5
ahtih commentedThe commits above are not a complete workaround, since OL 2.9 also requires "Image Path" to be set to "http://openlayers.org/api/2.9/img/" for every preset (at least because FramedCloud image coordinates have changed in OL 2.10, producing garbage in popup decorations if image path version does not match JavaScript version).
Possibly "CSS Path" needs to similarly match the JavaScript version.
Comment #6
zzolo commentedHi @ahtih. This is a vlid-ish point. But from what I understand, the JS library will use the Img and CS paths correctly if none are set. So, this would only be be a problem for people that have set their paths explicitly to the http://openlayers.org/api/2.10/img/ path. Am I understanding this right?
Comment #7
ahtih commentedYes, it is a problem for those people, but more importantly it is a problem also for people who have the path set to http://openlayers.org/api/img/ , i.e. the latest version. For example, the people using WFS module - because WFS requires a patch to OpenLayers JS file, you have to host it yourself, which in turn means you have to set Image and CSS paths manually to http://openlayers.org/api/img/
But in any case, in the long term we should obviously change DOL so that it works with latest OL anyway, so perhaps it is not spend much time in perfecting this workaround.
Comment #8
zzolo commented@ahtih, true. This still needs to be addressed. Anyone know the actual cause of the problem?
Comment #9
tmcw commentedRetagging... this is no longer a bug report.
Comment #10
zzolo commentedI am not entirely sure what is mean by the title change in the last comment. But, overall, I don't think this is a major issue and am closing for now. Please re-open if needed.