Ticket #1275 (closed bug: fixed)

Opened 5 years ago

Last modified 2 years ago

align toString and fromString for OpenLayers.Bounds

Reported by: bartvde Owned by: euzuro
Priority: minor Milestone: 2.11 Release
Component: BaseTypes.Bounds Version: 2.5
Keywords: Cc:
State: Commit

Description

Erik's reply: hi bart, the toString() function I think was mostly just designed for debugging... not so much as a way to translate the bounds into a storable string format. I think your point is a good one... unfortunately, it wouldn't be proper of us to change a thing like this now because it would be a breach of API. for the OpenLayers 3.0 release, however, I think this would be a great thing to change. erik ps. if you really need this functionality, we could put in a patch for a function with a different name (saveToString() or something like that) for the time being and mark the current toString() as deprecated...

Original email: Hmm, one more thing, isn't it strange that toString and fromString use different string formats?

I was hoping to use toString and create a bounds again from the same string using fromString.

But toString uses: left-bottom=(23560.672130601146,384199.8282873455) right-top=(50198.73747014423,401559.87359025853 )

and fromString interprets only something like: 23560.672130601146,384199.8282873455,50198.73747014423,401559.87359025853

Attachments

patch-openlayers-1275-r10821-A0.diff Download (1.0 KB) - added by adube 3 years ago.
patch changing the 'toString' method. The old one is renamed 'toHRString'.
1275.0.patch Download (1.2 KB) - added by fredj 2 years ago.
change toString without keeping old implementation. update unit tests

Change History

  Changed 3 years ago by tschaub

  • state set to Needs Discussion
  • milestone changed from 3.0 Release to 2.11 Release

Is there consensus that changing the format of the string that toString returns is a change we can't make before 3.0?

I wouldn't be opposed to changing the format of the string.

  Changed 3 years ago by tschaub

Another note - the more things we can squeeze into 2.x, the easier it will be for people to migrate to 3.0.

follow-up: ↓ 5   Changed 3 years ago by crschmidt

I don't think that changing the format of the toString output is a violation of the API. I'd be willing to take this in a 2.x.

Changed 3 years ago by adube

patch changing the 'toString' method. The old one is renamed 'toHRString'.

  Changed 3 years ago by adube

I agree that the method has no real purpose whatsoever and changing it as mentioned above wouldn't hurt anything. Attached (above) a patch fixing the issue. I'd say this ticket is ready for review.

in reply to: ↑ 3   Changed 3 years ago by erilem

Replying to crschmidt:

I don't think that changing the format of the toString output is a violation of the API. I'd be willing to take this in a 2.x.

+1

Changed 2 years ago by fredj

change toString without keeping old implementation. update unit tests

  Changed 2 years ago by fredj

  • state changed from Needs Discussion to Review

  Changed 2 years ago by erilem

  • state changed from Review to Commit

  Changed 2 years ago by fredj

  • status changed from new to closed
  • resolution set to fixed

(In [11755]) align toString and fromString methods. r=erilem (closes #1275)

Note: See TracTickets for help on using tickets.