OpenLayers OpenLayers

Ticket #1134 (new bug)

Opened 9 months ago

Last modified 6 months ago

zoomToMaxExtent should optionally zoom to map.restrictedExtent, if defined

Reported by: jachym Assigned to:
Priority: minor Milestone: 2.7 Release
Component: general Version: 2.5
Keywords: Cc:
State: Needs More Work

Description

Currently, when user click on zoomWorld icon in PanZoom panel, it will zoom to maxExtent, without no matter if map.restrectedExtent is defined or not.

This behaviour is IMHO bug - restricted extent is here, for define region of interest. zoomWorld icon should zoom to the region of interest, not to whole area.

This patch makes PanZoom to look first, if this.map.restrictedExtent is defined and zooms to it. If not, than it zooms to maxExtent.

Attachments

PanZoom.js.diff (0.6 kB) - added by jachym on 11/09/07 17:44:50.
Makes PanZoom zoom to restrictedExtent, rather then maxExtent

Change History

11/09/07 17:44:50 changed by jachym

  • attachment PanZoom.js.diff added.

Makes PanZoom zoom to restrictedExtent, rather then maxExtent

11/15/07 09:53:31 changed by crschmidt

Can we have a test for this, please?

11/27/07 04:45:44 changed by crschmidt

Actually, thinking about this, this may not be the right solution. It's possible we should have zoomToMaxExtent be implementing this on the map level. I think that's the right solution: Tim would probably know better. Tim?

11/30/07 13:33:00 changed by tschaub

jachym, can you talk about the case where maxExtent is different than restrictedExtent. I may have my head on backwards - but I think I just always set the restrictedExtent to maxExtent. I just gave them different names to maintain the existing maxExtent behavior. Now that I'm writing this, I can see why you'd have them different. Since we tie tile origin to maxExtent, it would make sense to maintain a cache but allow different client side "max extent." Anyway, there are probably other cases.

And, I agree with crschmidt. The "best" solution would probably be to give map.zoomToMaxExtent a "restricted" argument. If true, and map.restrictedExtent is set, the method would zoom to that.

11/30/07 13:36:34 changed by crschmidt

I think that the restricted argument should default to true. I know that it's a slight change in behavior, but if you're using zoomToMaxExtent, I think it's the one you actually want. I'm happy to have it be an option -- or even not an option, and just always prefer zooming to maxExtent (since there is always map.zoomToExtent(map.maxExtent) if you care...)

12/11/07 00:44:25 changed by crschmidt

  • keywords deleted.
  • summary changed from zoomWorldIcon in PanZoom should zoom to map.restrictedExtent, if defined to zoomToMaxExtent should optionally zoom to map.restrictedExtent, if defined.

12/15/07 13:46:35 changed by crschmidt

  • state set to Needs More Work.

01/22/08 17:43:27 changed by crschmidt

  • milestone changed from 2.6 Release to 2.7 Release.

Mass ticket move to 2.7 post dev meeting. If you are actively working on this task, please update this ticket with information and change the milestone to 2.6. At the time of the next IRC meeting (most likely 1-31-08), this will mean the ticket can *not* be brought back into 2.6 unless there is further feedback.