Ticket #2105 (closed feature: fixed)

Opened 4 years ago

Last modified 4 years ago

updateSize should not call setCenter if map has no center

Reported by: elemoine Owned by:
Priority: minor Milestone: 2.9 Release
Component: general Version: SVN
Keywords: Cc:
State: Complete

Description

Currently if updateSize is called while the map has no center (map.moveTo has never been called), the map is zoomed to its max extent. So if one wants this sequence:

  • create map without a div
  • render map to a specific div
  • zoom to a specific extent

map.moveTo will actually be called twice, once in map.updateSize, itself called from within map.render, and once in map.zoomToExtent.

Attachments

patch-2105-r9410-A0.diff Download (2.0 KB) - added by elemoine 4 years ago.
2105.patch Download (2.1 KB) - added by tschaub 4 years ago.

Change History

Changed 4 years ago by elemoine

Changed 4 years ago by bartvde

Just wanted to say this fix works perfectly for me.

Changed 4 years ago by elemoine

  • state set to Review

Changed 4 years ago by tschaub

Reviewing this now. Out of curiosity, do you have an updated patch elemoine? I'll fix it up if you don't get to it first.

Changed 4 years ago by tschaub

Changed 4 years ago by tschaub

  • state changed from Review to Commit

Looks good to me. I confirmed that (Map.html) tests pass in FF3 and IE6. Funny those unused lines were left in there (center and centerLL).

Please commit.

Changed 4 years ago by elemoine

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [9587]) make updateSize not call setCenter if map has no center, and remove unused code, r=tschaub (closes #2105) (closes #2114)

Note: See TracTickets for help on using tickets.