Zoom to Real Point

Lawrence, Kevin klawrenc at NRCAN.GC.CA
Tue Oct 19 09:17:55 EDT 2004


Eric
You may want to check out the values of the link, width and height as well
as the resultant extents.  You may be able to get an eroneous value look
like it is working and have that be the confusing point.

KL

> ----------
> From:         UMN MapServer Users List[SMTP:MAPSERVER-USERS at LISTS.UMN.EDU]
> on behalf of Eric Katherman[SMTP:vaiod at BERLOY.COM]
> Reply To:     Eric Katherman
> Sent:         Monday, October 18, 2004 11:21 PM
> To:   MAPSERVER-USERS at LISTS.UMN.EDU
> Subject:      Re: [UMN_MAPSERVER-USERS] Zoom to Real Point
>
> Yea the example I posted was the math that seems to work, albeit
> conceptually
> wrong. I initially started doing exactly what you are talking about 800/2
> =
> 400 so add 400 to the right and subtract from the left and apply the same
> concept to top/bottom.  It worked kind of but centered the point on the
> bottom right corner.  I must  be overlooking something but what I have
> seems
> to work for whatever reason... I wonder why there isn't a builtin function
> for that e.g. pointcenter(x,y) that would make this easy.
>
> Eric
>
> > I am not sure I follow your code exactly but I think you are
> > multiplying by two when you should be dividing eg:
> >
> > $right_brdr = ($link[0] + ($_COOKIE["CTRENCH_GIS_CONF-WIDTH"] /2));
> > $left_brdr = ($link[0] - ($_COOKIE["CTRENCH_GIS_CONF-WIDTH"] /2));
> > $top_brdr = ($link[1] + ($_COOKIE["CTRENCH_GIS_CONF-HEIGHT"] /2));
> > $bottom_brdr = ($link[1] - ($_COOKIE["CTRENCH_GIS_CONF-HEIGHT"] /2));
> >
> > If I follow your intent correctly you want to set the border extents
> > equal to "CTRENCH_GIS_HEIGHT" x "CTRENCH_GIS_WIDTH" so you want to add
> > half the height to the top, subtract half the height from the bottom,
> > add half the width to the right and subtract half the width from the
> > left.  By multiplying by two instead of dividing you are positioning
> > your desired point 1/4 of the way across the screen.
> >
> > But it is the end of a long day and I might be code drunk
> >
> > -Mike
>



More information about the mapserver-users mailing list