[mapserver-users] Image centering problem...

Mike Smith nospam at cnrit.tamu.edu
Mon Sep 23 07:21:02 PDT 2002


But if I don't set the form value of "imgxy" somewhere the image doesn't 
even load!  Looking at the Itasca demo I see that this value is manually 
being set at the bottom of the html code, but that demo recenters and 
zooms on mouse clicked points just fine.  I guess I'm confused as to why 
the imgxy value is even needed, because mapserver seems to automatically 
pick up on the img.x and img.y coordinates when I click, but this 
doesn't help because the image just blows up if I don't manually set 
imgxy somewhere.  Can I do something like this?

<input type=hidden name="imgxy" value="[img.x] [img.y]">

right now I'm just manually setting it to the centerpoint of my starting 
image like this:

<input type="hidden" name="imgxy" value="249.5 250.0">


This is exactly what the Itasca demo does and it works there, but all it 
appears to be doing for me is forcing me to zoom in to the same point 
every time regardless of where I've clicked....and pan doesn't even work.

HELP?!?!



Van Ulden, Joost wrote:

>Just get rid of the imgxy form element.  By having it in there you are
>overriding the user coordinates.  Any other suggestions from the list?
>
>Cheers,
>
>Joost
>
>-----Original Message-----
>From: Mike Smith [mailto:nospam at cnrit.tamu.edu]
>Sent: Friday, September 20, 2002 3:37 PM
>To: mapserver-users at lists.gis.umn.edu
>Subject: [mapserver-users] Image centering problem...
>
>
>Hello,
>
>    I'm sure I'm missing something really elementary here, but I've gone 
>and added so much complexity to my mapserver web pages that I can't get 
>the image to recenter on my mouse clicks anymore!  I see the "img.x" and 
>"img.y" values appear in the URL when I click on the image, but I'm also 
>setting "imgxy" in various places and I guess I'm clobbering something 
>becuase no matter where I click, the map just zooms in and out centered 
>on the mid-point of my main image.  I'm talking about non-applet 
>implementations of Mapserver, and I'm not using Mapscript either.  If 
>you want to see the problem I'm talking about look at any of my 
>"non-applet" maps at the following URL:
>
>http://cnrit.tamu.edu/maps/map_init.html
>
>Can somebody explain to me the reason why "imgxy" has to be set in the 
>html "hidden" form variables?  In the basic demo, this value is 
>arbitrarily set to the centerpoint of the top level image...why?  What 
>am I doing wrong?  This bug in my code is totally disabling the pan 
>feature...I can't pan or recenter at all, I just always get the 
>centerpoint...even when I click on the reference image.
>
>Help!
>
>Thanks,
>
>Mike
>
>





More information about the MapServer-users mailing list