[mapserver-users] confusion about postgis bounding box -> valid map extent

Steve Lime steve.lime at dnr.state.mn.us
Mon Aug 26 10:36:58 EDT 2002


It always centers the old extent and gaurantees that the entire old extent is contained in the new one.

You can nab the javascript at:

  http://maps.dnr.state.mn.us/javascript/mapserv3.6.js 

There a several little zooming methods in that code. Let me know if you have questions.

Steve

>>> Alex Rice <alex_rice at arc.to> 08/23/02 05:33PM >>>

On Friday, August 23, 2002, at 01:27  PM, Steve Lime wrote:
> In the C code the extent will be adjusted for output image size.

Does it try to center the old extent in the new extent, or does 
it do clipping and shifting?

> I've got all those written in C and javascript. Let me know what 
> you'd like
> to see. Otherwise MapScript already has a method to fit a rectangle to
> a new window size. It's part of the rectObj class (of which 
> extent is one)
> and is called fit. For example:
>
>   $cellsize = $map->{extent}->fit($newwidth, $newheight);

I would love to see any javascript functions you have. It's a bit 
easier to read then C for me.

> Already addressed in a generic way with the fit method.

OK I see. I guess what I am looking for is a way to do what the 
zoomScale() php function does, except I will be starting with 
georef coordinates not pixel coordinates.

Maybe after seeing some of your code it will all "click" for me!

Thanks,

Alex Rice <alex at mindlube.com>
Mindlube Software
http://www.mindlube.com/ 





More information about the mapserver-users mailing list