[mapserver-users] Zooming Strangeness

Stephan Dunning SDunning at nephrology.org
Thu Feb 28 11:42:43 EST 2002


Stephen,

I had what could have been a similar issue not too long ago.  Here's the
message I posted.

********************
I could be wrong or this may have already been discovered, but I think I
found a slight bug in the gmap75.php file that affects the zoom and query
rectangles.

The GMap75CheckClick() function includes the following code:

			if ($oPixelRect->minx >  $oPixelRect->maxx)
			{
                            // Use intval() to avoid dfTmp becoming a
reference
                            // to $oPixelRect->minx with PHP4 !?!?!?
			    $dfTmp = intval($oPixelRect->minx);
			    $oPixelRect->set("minx",$oPixelRect->maxx);
			    $oPixelRect->set("maxx",$dfTmp);
			}
**line of code in question**
			if ($oPixelRect->miny <  $oPixelRect->maxy)
**line of code in question**
			{
			    $dfTmp = intval($oPixelRect->miny);
			    $oPixelRect->set("miny", $oPixelRect->maxy);
			    $oPixelRect->set("maxy", $dfTmp);
			}
		    }

Should this -
	"if ($oPixelRect->miny <  $oPixelRect->maxy)"
be this -
	"if ($oPixelRect->miny >  $oPixelRect->maxy)" 
instead?

Thanks,
Stephan
********************

Maybe this will help.


-----Original Message-----
From: Assefa Yewondwossen [mailto:assefa at dmsolutions.ca]
Sent: Thursday, February 28, 2002 9:55 AM
To: Stephen Woodbridge
Cc: MapServer List
Subject: Re: [mapserver-users] Zooming Strangeness


Hi there,

 I am not sure what the problem is but I am going to look at it this
afternoon.

 Stephen, is it possible for you to send me the necessary files (map,
phpcode,
data ...) so I can try to reprodue the problem here.

Later,

Stephen Woodbridge wrote:

> I never saw any response to this post, I am somewhat at a loss on this.
> Does anyone have any ideas.
>
> DM Solutions guys,
>
> Does the code in GMap that maps from pixel to map units work if I am
> using lat/long data instead of meters like the original app was using?
>
> Would it account for the symptoms I am seeing?
>
> Any help would be appreaciated,
>   -Steve W.
>
> Stephen Woodbridge wrote:
> >
> > Hi all,
> >
> > I am using a modified version of GMap75 which is working great, but I
> > have run into a strange problem related to zooming which may or may not
> > be related to the GMap code. I am using
> >
> > EXTENT -180.0 -90.0 180.0 90.0
> > UNITS DD
> >
> > PROJECTION
> >   "proj=latlong"
> > END
> >
> > and all my data is in lat/long coordinates.
> >
> > Here are two of the symptons:
> >
> > 1) I am zoom in to +-0.013 degrees (approx. 0.75 miles over 600 pix)
> > with a marker in the center of the image. I zoom out using rosa and the
> > GMap code and my marker is still at the same lat/long, the image zooms
> > out but has shifted so that the marker is now center on the lower left
> > quarter of the image like (M => marker position):
> >
> > +--------------------+                 +--------------------+
> > +                    +                 +                    +
> > +                    +                 +                    +
> > +                    +                 +                    +
> > +                    +  < before       +                    +
> > +         M          +                 +                    +
> > +                    +                 +                    +
> > +                    +                 +                    +
> > +                    +    after >      +               M    +
> > +                    +                 +                    +
> > +--------------------+                 +--------------------+
> >
> > If I recenter/pan (using rosa) and clicking on the marker it moves
> > correctly to the center.
> >
> > 2) I am zoomed to the full extents of the map and I try to zoom in on
> > roughly a 4 state area using rosa and the GMap code. I get the zoom but
> > the rectangle that is zoomed to is positioned significantly below the
> > rectangle I selected. For example, I zoom in on Massachussetts and I end
> > up somewhere in the Carribean. Likewise, is I try to pan to the correct
> > location using the reference map, I have to click up in Canada to end up
> > in Mass. I think there is also a horizontal shift like in 1) above so
> > these are both probably the same problem only magnified by scale.
> >
> > Anyone have any ideas? I this an artifact that GMap75 was designed
> > around different assumptions regard the output projection?
> >
> > You can try it out at
> >
> > http://swoodbridge.com/cgi-bin/geo
> > http://swoodbridge.com/web2/nmap
> >
> > I only have Tiger data loaded for the eastern half of the US.
> >
> > Thanks for the help,
> >   Stephen Woodbridge

--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056
Fax:   (613) 565-0925
----------------------------------------------------------------




More information about the mapserver-users mailing list