1) Install OL module and geofield
2) Clone the "Geofield widget map"
3) Check the "restrict extend" checkbox.
3) Set the center of your map. Shift-click and drag to set the extent.
When I try to set the extent, the map itself behaves as expected, I get a white semi-transparent box with a red border over the restricted area while dragging. When I release the mouse however, I expect the settings to get copied over to the text box below the "restrict extend" checkbox, and possibly the extent to remain visible on the map. Neither of these happen however, which looks like a bug to me.
I'm not very good with JS, but I looked in the Firebug console to see if there was an error message that might provide a clue as to what was going on, but sadly that gave nothing.
Comments
Comment #1
Letharion commentedOn map load, I get this JS error
which is hardly surprising.
Comment #2
nod_I believe that's my fault somewhere, I'll have a look tonight.
Comment #3
nicolash commentedAny news on this? Seems to still be happening in the dev version as well.
Is it only the UI for setting the extend by shift-dragging? If so, what is the format for the extend textbox, so I can set it manually?
I've tried the order of "left, bottom, right, top", as it appears here, but that doesn't seem to work, either.
Comment #4
zzolo commentedIt took awhile, but the problem was that I put the Navigation and PanZoom controls on the settings map which override using shift and click. The better solution would be to make a button to select the extent but that is for another time.
http://drupalcode.org/project/openlayers.git/commit/9a3711e
Comment #6
japo32 commentedThe fix still doesn't work for me. :( Can you guys tell me what values are supposed to be in the restrict extent text field? So I can enter them manually.
Oh and if you can please give example values.
UPDATE:
I had to keep guessing the right values.
It turns out since I was using a map that uses EPSG:900913 values, I had to use values for that projection type.
e.g. -20037508.34, -20037508.34, 20037508.34, 20037508.34
after a lot of hit and misses in guessing the values I narrowed it down finally to the values I wanted.