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.
The map appeares in it's default view. If I try to navigate, or click on a pin placed on the map, it automatically jumps a bit towards Southwest and the navigation gets stuck there, not possible to move back. However, if I use the zoom first (or after it gets stuck), the problem will not show until I reload the page.
I use "restrict extent", have a default location and zoom level set up. There are two layers on the base map, and the issue appears regardless of which base map I use. I have the following behaviours enabled:
- Cluster features
- geofield
- layer switcher
- Mouse drag pan
- Pop up for Features
- Full screen
- Zoom control
Is it a known bug? Any workaround or solution? Thank you in advance!
Comments
Comment #1
nod_Can you track down which one is causing the bug ?
I'd try disabling popup and/or cluster.
Comment #2
thlor CreditAttribution: thlor commentedI turned off/on each behaviour separately and checked. Then I turned everything but "Pop Up for Features" off (I left it on so I can click on something to reproduce the bug). None of these solved the problem. Even when no navigation by mouse, keyboard or nav icons was enabled, the map still got "dislocated" the same way, when I clicked to open a popup.
Still, if I hit the zoom button, the navigation goes back to normal, however I can not close those popus I opened when it got stuck.
Further details:
Thanks a lot in advance, I really don't know where to go here.
Comment #3
thlor CreditAttribution: thlor commentedUpdate:
Restrict extent it is. I took a fresh clone of the default Geofield Widget Map, changed nothing but added mouse navigation, the layers, set up a restrict extent rectangle and an initial map view (zoomed well inside the restrict extent boundries, obviously). With only these changes, the same issue appears. If I disable the extent restriction, it works fine.
For comparison with the vanilla Geofield Widget Map, here is the export of the foul version of it: http://pastebin.com/KEQDxfEc
Comment #4
nod_Sweet! thanks for testing that'll save me some time.
I'll be using restrict extent very soon (tomorrow in fact) so i'll very likely bump into this. I'll get working on it then.
Comment #5
thlor CreditAttribution: thlor commentedLucky me! :) Please let us know if it happens to you too. Thanks!
Comment #6
FeBus982 CreditAttribution: FeBus982 commentedI have same issue.
Don't know if it can help but there's something wrong about calculating coordinates on maps when restricted extent is active.
If i activate Behavior that shows mouse coordinates on a map showing full italy country ( Lon 6->18, Lat 37->47 ) i got Longitude going from 180 to 194 (ouch!) and Latitude going from -4 to +4.
After zooming coordinates are correctly computed.
I am using custom WMS Layers, projection 4326
Comment #7
FeBus982 CreditAttribution: FeBus982 commentedFIXED:
Something's wrong about setting Restricted Extent after zooming to the initial view.
modify file js/openlayers.js from line 196
Invert the order so Restricted Extent is applied before zooming to initial view.
Now this is going right. I'm on holyday (or I should be....) and can't produce a patch file here, hope someone will do it :P
Comment #8
mgifford@FeBus982 Hope you had a great break. Also hoping you can roll up the patch as I assume you're back. Thanks!
Comment #9
zzolo CreditAttribution: zzolo commentedCommitted. Would be nice to get some further testing on this.
http://drupalcode.org/project/openlayers.git/commit/e6dfc41