MapServer / MapServer

Source code of the MapServer project. Please submit pull requests to the 'main' branch.
https://mapserver.org
Other
1.02k stars 373 forks source link

mapObj scale and resolution should be methods _not_ attributes #440

Closed mapserver-bot closed 12 years ago

mapserver-bot commented 12 years ago

Reporter: sgillies@frii.com Date: 2003/09/26 - 17:21 Trac URL: http://trac.osgeo.org/mapserver/ticket/440

MapScript can be improved by converting mapObj scale and resolution to methods
rather than attributes.  Read-only attributes whose values are set by side-effect
of other attributes or methods are confusing and give off a "bad smell" so to 
speak.

I'm happy to pick up this assignment and work with others on making the required
changes in the C library.
mapserver-bot commented 12 years ago

Author: sdlime Date: 2003/09/26 - 17:54

I might agree on scale, but not on resolution. Resolution is never computed, it
is a parameter/attribute needed to compute scale.
mapserver-bot commented 12 years ago

Author: sgillies@frii.com Date: 2003/09/26 - 18:25

My mistake on resolution.  You are right, Steve.

I suppose that the C code quite dependent on using the scale variable
in the mapObj structure?  Maybe we could let the C code use it as it
is, but hide scale from SWIG and replace it with a method than computes
the scale as needed?  This would clean up mapscript and would not require
a rewrite of the MapServer code.
mapserver-bot commented 12 years ago

Author: sdlime Date: 2003/09/26 - 18:57

Yup, scale is all over the place. Better to compute once, at least that was the
idea. Hiding the attribute from SWIG and creating the method is fine, but there
seems to be little benefit in even doing that...
mapserver-bot commented 12 years ago

Author: sgillies@frii.com Date: 2003/10/13 - 03:30

All my issues with scale are resolved by implementing a setExtent method
(like the PHP-mapscript function) to extend mapObj.  I've committed it
to the CVS (main).