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.


Letharion’s picture

On map load, I get this JS error

TypeError: maxExtent is null
[Stop at error] this.events.triggerEvent("zoomend");}}...id=maxExtent.containsLonLat(lonlat);} 

which is hardly surprising.

nod_’s picture

I believe that's my fault somewhere, I'll have a look tonight.

NicolasH’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev

Any 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.

zzolo’s picture

Status: Active » Fixed

It 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.


Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

japo32’s picture

The 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.


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.