Hi Rik!
I've just upgraded to latest DEV version of both ip_geoloc and openlayers.
Results: all my maps have disappeared and the following warning is shown:
There's a problem in the plugin definition of the layer type openlayers_layer_type_ip_geoloc. The layer will be disabled.
(see attachment)
What can be the issue?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 0001-Issue-1946714-Fix-for-new-beta-of-OpenLayers.-See-13.patch | 2.47 KB | pol |
| Layer error.jpg | 32.34 KB | mxt |
Comments
Comment #1
rdeboerHi Max,
As far as I know nothing has changed on the IP Geolocation V&M side of things in terms of the interface with OpenLayers.
So the OpenLayers guys must have changed something in their datastructures that make it incompatible with the way they did things previously.
If that is indeed the case, expect other OpenLayers site builders to have the same problem... and perhaps a solution. Suggest you check the OpenLayers issue queue.
Rik
Comment #2
mxtThank you Rik, I'll move this to openlayers issue queue in the hope that they tell us what has changed in particular that can breaks things.
Thank you
Comment #3
polHello,
As explained in #1331410: Better Handling of Projections, there are changes in the way Projections are handled.
Example, in the file ip_geoloc.openlayers.inc:
Line 77: Change
baselayerintoisBaseLayer.Line 79: Change
'900913'into'EPSG:900913'.Line 91: Change
4326intoEPSG:4326.Do that for every layers defined there and it should be good.
Comment #4
mxtThank you for your answer Pol: I did the changes as you've suggested, but nothing is changed: maps are still not visible and the warning message is still shown...
There is something other we have to consider?
Thank you for your support.
Comment #5
rdeboerThanks Pol for the pointers.
I'll have a closer look at the "IP Geolocation V&M" end as well, but don't have much time for a few days.
I did spot this as potentially suspicious, if the API has changed:
Line 99:
$marker_layer->api_version = 1;may have to be:
$marker_layer->api_version = 2;?Related: I guess this means we need two copies of the interface to OpenLayers now?
Comment #6
polHere's a patch fixing the warnings, I didn't not tested it though...
Comment #7
rdeboerThanks Pol! Hope to test-drive these changes soon.
Rik
Comment #8
mxtI've applied patch in #6 with the following results:
This using latest openlayers DEV.
Please help me to resolve
Thank you very much
Comment #9
augustus.kling commentedI don't have any clue about the named layer type, so the following is a pure guess:
In line 253 of openlayers.module a projection of the layer is read to be sent to the client. However it appears there is no projection defined for your layer. Please open the edit screen of your layer and make sure a projection is selected in the projection list there. From looking at Pol's patch I assume either EPSG:900913 or EPSG:3857 should be selected.
Comment #10
mxtThank you Augustus,
I went to /admin/structure/openlayers/layers
and edit ALL ip_geoloc_marker and geofield layers: EPSG:900913 was already selected, but I RE-SAVED all layers to be sure and error 3 above has disappeared.
Unfortunately no maps are shown yet in my views pages using "Map (OpenLayers, via IP Geolocation)" as format.
Comment #11
jpablus commentedHi
Additionally to changes suggested on comment 3, I did
Line 107: Change '900913' into 'EPSG:900913'.
And it works
Comment #12
mxtApplying patch in #6 and after updating to last openlayers 7.x-2.0-beta5 my maps have reappeared, but:
What can be the problem?
Comment #13
polIt's a projection problem, is this site online so I can have a look ?
Comment #14
mxtHi Pol, the website is not online but I can show you it on staging environment.
I wrote to you the details using your contact form here on drupal.org.
Thank you very much for help.
Comment #15
polHello,
This is clearly a projection problem.
I don't use ip_geoloc, but by looking at the source, I think I see something wrong... but I'm not sure.
The projection should be: EPSG:4326 instead of 4326.
Check this issue and the links inside: #1959018: Error message on OpenLayers with latest dev version (1.19+18-dev), it should gives you a way to fix it.
Comment #16
mxtThank you Pol!
Following your suggestion I was able to find where the projection is not set correctly.
So, in ip_geoloc module > views folder > ip_geoloc_plugin_style_openlayers.inc file > line 122
from:
sould be:
This resolve correctly markers position.
I'll switch to ip_geoloc issue in the hope that RdeBoer will commit your patch and correction above in this post
Thank you!
Comment #17
polYou're welcome!
Comment #18
rdeboerThanks Pol and MXT. I have applied your combined patches to IP Geolocation Views and Maps 7.x-1.x-dev.
In my simple test map the markers show up correctly (as simple black circles) without errors.
However we're not done yet. When I go to this page: admin/structure/openlayers/maps and click "Edit" or "Clone" on any of the maps I get the same as what is mentioned here: http://drupal.org/node/1944074#comment-7324132.
Therefore I can't do anything like assigning colours or info balloon, as described in the IP Geolocation Views & Maps README:
Initially the location markers are likely to show up as black circles. To
change the marker shapes and colours you need to first associate the "Location
markers" layer with your map at Structure >> OpenLayers >> Maps >> List. If
there is no custom map on this page yet, you have to first clone and save under
a different name one of the existing maps. Once you've done that, you'll find
that on Structure >> OpenLayers >> Maps >> List the map appears with an Edit
link. Click that, followed by the "Layers & Styles" vertical tab. In the bottom
section of the page you'll find the "Current visitor marker" layer and a number
of "Location markers" layers. You'll only need to activate Location markers #1,
unless you have defined a "differentiator" (e.g. taxonomy term) on your view.
Pick marker styles from the drop-downs as you please and press Save. Note that
the location markers won't show up in the map preview, but the visitor marker
should. This is because the map doesn't know which view it will be paired with.
In fact there may be several views using the same map. Return to edit your view.
Under Format, Settings select the map you've just created and edited. Save the
format and the view. Visit the page containing your view and all markers should
appear in the colours you chose.
In order to make the text balloons pop up at a marker when hovered or clicked,
visit Structure >> OpenLayers >> Maps >> Edit and click the "Behaviors"
vertical tab. Scroll down the page until you reach the "Pop Up for Features"
check box. Tick it and select the layers you're interested with, e.g.
ip_geoloc_visitor_marker_layer1 and/or ip_geoloc_marker_layer. Same for
"Tooltip for Features". Other nice behaviors that you may wish to flick on on
the same page are "Full Screen", "Layer Switcher", "Pan and Zoom Bar Controls"
and "Scale Line".
Comment #19
polI'll test and report ASAP, thanks !
Comment #20
polI'm not able to reproduce the bug Rick.
Can you test with simplytest.me ?
Comment #21
rdeboerI'll give it a go... quite a few modules involved though...
Comment #22
rdeboerHmmm... works here: http://s540fd173c35cc02.s3.simplytest.me (try admin/admin) and visit /map.
So what's going on?
Comment #23
rdeboerHi Pol,
The test site from #22 was working with a clean install of IP Geolocation Views and Maps (7.x-1.x branch), CTools, Views, Proj4s, Libraries and Openlayers, but has been auto-deleted. This suggests that Openlayers 7.x-2.0-beta5 is good on a pristine vanilla install.
However, I also checked on my local system, which has the identical set of modules. Despite running update.php and clearing all caches a couple of times I find that function
openlayers_get_projection_by_identifier($identifier)gets called sometimes with and sometime without the preceding 'EPSG:' authority code.We talked about this before. The patch that works on my system is to simply prefix the received $identifier with the authority code if it isn't already there.
openlayers.module (7.x-2.0-beta5) , line 989:
Adding these 3 lines would save a lot of people a lot of upgrade issues, don't you think?
Rik
Comment #24
polHello Rick,
We already discussed this and I'm aware that it would help people, and I'm sorry but we won't allow it. We prefer not doing that to force module developers to upgrade their module and provide a good code.
We are about to release a new beta tonight, I'm happy that this is finally sorted out.
Have a good day.
Comment #25
rdeboerHi Pol,
Ok, if you say so.
Good night here ;-)
Rik