Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Creating a Geofield field to get location data from an openlayers map results in:
Error: You have no compatible openlayers maps. Make sure that at least one map has the 'GeoField' component enabled.
Despite having the component enabled on all maps.
Comments
Comment #1
droces CreditAttribution: droces commentedI get the same error. When editing a content type's geofield field with Openlayers Map as the widget type, I get that error warning plus this one:
Edit: I uninstalled the OL Examples sub-module, and I don't have any map with that machine-name.
Comment #2
MatthijsG CreditAttribution: MatthijsG commentedMe to. The widget tells me i can choose OpenLayer. OpenLayer Example is added and there are plenty of maps ..
Comment #3
webengr CreditAttribution: webengr as a volunteer commentedHas anyone figured this out?
IF we can't use openlayers... because of this, maybe this is a critical bug?
I am using Openlayers 7.x-3.0-beta3
The dev version as of 7/20/2015 did not run....either.
I went to STRUCTURE->OPENLAYERS->Maps
I added a testmap, made sure on the component tab this weas enabled
"OpenLayers Geofield openlayers_geofield_component_geofield"
NO good either.
Is the software broke?
Because I used openlayers2 previously, I went ahead and deleted openlayers modules and added them back.
I also deleted the field and put it back.
I hope this is just a documentation and/or procedural problem.... if so, please someone document the work around.
I also created a virgin website and installed Openlayers 7.x-3.0-beta3 and had same issue.
Maybe others who have a openlayers 3 from earlier alpha or beta don't see this because they
already had a map supporting geofield from a previous round.. ?
FRUSTRATING! I would like to use the recommended version but every couple weeks I come back to see if I can and yet another beta issue is preventing.
Comment #4
webengr CreditAttribution: webengr as a volunteer commentedComment #5
chobart CreditAttribution: chobart commentedThe error does not occur in version 7.x-3.x-dev of 2015-Jul-23
Comment #6
PolCould you please close the issue then ?
Comment #7
webengr CreditAttribution: webengr as a volunteer commentedI think the error may have also be gone in dev 2015-Jul-31
Comment #8
davidneedhamInteresting. I thought I had a technical problem, but it was actually a documentation problem. Perhaps this will help others.
First off, I started with the latest recommended release of the openlayers module (7.x-3.0-beta3 at time of writing). I assumed after downloading and unzipping the openlayers library that it should exist at
/sites/all/libraries/openlayers/
. (I thought I remembered it being that way the last time I used the openlayers module, but didn't see this documented in the README.md or on the project page.) No luck. The js error console suggested the openlayers files were missing, but I couldn't figure out why.After reading this post, I updated to the dev version of the module and realized after running the
drush dl-openlayers
command that it puts it in/sites/all/libraries/openlayers3/
. openlayers3. After confirming that dev did indeed work, I went back to the latest recommended release (7.x-3.0-beta3), but kept the library where it was.This worked.EDIT: This worked to fix some of the problems I saw, but it DID NOT fix the problem reported in this particular issue. I had to go back to the latest dev to resolve this error.Can we fix the README.md file to include information about the naming convention of the library? It currently looks like some broken travis-ci message.
To anyone who still has this problem: the drush command still works in the latest recommended release. Try installing the library that way.Comment #9
PolHello,
Thanks for your message, we are aware of the problem.
The lack of documentation is something that worries me. Unfortunately I cannot do both.
We are actively looking for people to help and contribute back. To ease this process we've setup a github repository where I encourage people to send pull requests.
Sometimes one paragraph is more than enough to help newcomers.
Comment #10
davidneedhamAh, bummer. I may have spoken too soon. After more testing it looks like going back to the latest recommended release with the new library directory actually did not fix all of the problems I saw. Specifically, it did not fix the specific message that this issue was created to address.
I went back to dev and everything does indeed work there. @pol: any idea when you're going to push out a new version?
Comment #11
PolHello,
I'm waiting for people to test and review this PR: https://github.com/drupol/openlayers/pull/17
Once everything is done with it, I'll release a beta5, full of awesomeness !
Comment #12
bsztreha CreditAttribution: bsztreha commentedI found one bug in openlayers_geofield_field_widget_settings_form() function that solved my problem:
Fix instanceof path like this in foreach:
edit: As i see it fixed in dev, but i cant get it work
Comment #13
PolHi,
Sorry but this is absolutely not right.
Could you let me know with which version you are doing that ?
First, we don't use 'Plugins' (with S) but 'Plugin', second, the variable $data doesn't exist there.
Thanks.
Comment #14
bsztreha CreditAttribution: bsztreha commentedLast stable version, 7.x-3.0-beta3
You are right in dev, but i'am right too in that beta3 branch :(
Comment #15
PolAh ok... possible, I haven't checked.
I think 7.x-3.x is much more stable than this version. I strongly suggest to upgrade.
When beta 4 is ready, it will fix all of this.
Comment #16
bsztreha CreditAttribution: bsztreha commentedSorry, upgrade to where? dev version? :)
In dev right now i have fatal errors
Comment #17
PolIt's possible, you have to rebuild the registry for this upgrade.
Comment #18
le dendrite CreditAttribution: le dendrite commentedalso having this issue.
not sure if related or not but for me it seems that openlayers will not keep any changes i make to settings/ default ui map. setting always returns to default selection, no error.
it very well could be me, or documentation, but i am fairly familiar with ol2, i understand it is different now....
thanks
Comment #19
chobart CreditAttribution: chobart commentedError "Error: You have no compatible openlayers maps" appears in 7.x-3.0-beta3.
Export git dev version of 23 July and clearing the cache caused the error stopped appearing and everything works.
After installing the dev version from October 2 this error does not occur, but there are other:
Comment #20
KelvinWong CreditAttribution: KelvinWong commentedSame here. The dev version work, and got a similar errors as chobart, expect the one I got is regarding to autozoom settings.
Found this ticket about that error.
https://www.drupal.org/node/2455929
Comment #21
martin.knapp CreditAttribution: martin.knapp commentedI very new to this so I may have some wrong settings somewhere. Came across this issue using Openlayers 7x.3-beta3 and Geofield 7x2.3, so downloaded the dev version. When I tried to edit the Geofield field settings the first time I got WSOD with this:
Fatal error: Class 'Drupal\openlayers\Openlayers' not found in D:\wamp\www\mdb\sites\all\modules\openlayers\modules\openlayers_geofield\openlayers_geofield.module on line 259
Going back in again I get this:
Unable to load Default openlayers_geofield_control_autozoom
Unable to load CTools exportable Component openlayers_geofield_component_geofield.
Unable to load CTools exportable Layer geofield_field_formatter_layer.
Unable to load CTools exportable Layer openlayers_geofield_layer_openstreetmap.
Unable to load CTools exportable Source geofield_field_formatter_source
But it is still not showing the Map I want - what on earth is the Geofield Component?
Comment #22
m.stentaMoving this to 7.x-3.x so we don't lose track of it.
Comment #23
PolI think all these errors are now gone since I've updated the Geofield component.
Please, reopen the issue if not.